:root {
  /* ACCENT */
  --accent: #0A84FF;

  /* SEMANTIC */
  --positive: #30D158;
  --negative: #FF453A;
  --warning: #FF9F0A;

  /* SPACING */
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* LAYERS (Apple-inspired hierarchy) */
  --layer-0: #0a0a0a !important;
  --layer-1: #111111 !important;
  --layer-2: #1a1a1a !important;
  --layer-3: #222222 !important;
  --layer-accent: rgba(10, 132, 255, 0.12);

  /* TEXT */
  --text-0: #ffffff !important;
  --text-1: rgba(255,255,255,0.65) !important;
  --text-2: rgba(255,255,255,0.40) !important;
  --text-3: rgba(255,255,255,0.26) !important;

  /* BORDERS */
  --border-0: rgba(255,255,255,0.08) !important;
  --border-1: rgba(255,255,255,0.08) !important;
  --border-2: rgba(255,255,255,0.12) !important;
  --border-focus: rgba(255,255,255,0.12);

  /* KMFX contract aliases */
  --text-primary: var(--text-0);
  --text-secondary: var(--text-1);
  --text-muted: var(--text-2);
  --text-muted-strong: var(--text-1);
  --text-disabled: var(--text-3);
  --neutral-2: var(--text-2);
  --border-subtle: var(--border-0);
  --border-medium: var(--border-2);

  /* SHADOWS */
  --shadow-none: none;
  --shadow-card: none;
  --shadow-elevated: none;
  --shadow-control: none;
  --shadow-chart-shell: none;

  /* GLASS (only for later use) */
  --glass-subtle: rgba(255, 255, 255, 0.04);
  --glass-base: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.12);

  /* CHART */
  --chart-text: rgba(255, 255, 255, 0.45);
  --chart-grid: rgba(255, 255, 255, 0.06);
  --chart-plot-bg: #171717;
  --chart-plot-border: rgba(255, 255, 255, 0.08);
  --chart-axis-text: rgba(255, 255, 255, 0.46);
  --chart-axis-line: rgba(255, 255, 255, 0.08);
  --chart-tooltip-bg: rgba(20, 20, 22, 0.98);
  --chart-tooltip-border: rgba(255, 255, 255, 0.09);
  --chart-tooltip-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  --chart-positive: #30d158;
  --chart-negative: #ff6b5f;
  --chart-focus: #0a84ff;
  --chart-neutral: rgba(255, 255, 255, 0.18);
  --chart-radius: 12px;
  --chart-inner-gap: 16px;
  --chart-empty-bg: rgba(255, 255, 255, 0.02);
  --chart-empty-border: rgba(255, 255, 255, 0.05);

  /* CONTROLS */
  --control-height: 44px;
  --control-radius: 8px;
  --control-radius-pill: 999px;
  --focus-ring: 0 0 0 3px rgba(255, 255, 255, 0.08);
  --radius-section: 16px;
  --radius-card: 16px;
  --radius-shell: 18px;
  --row-height-compact: 36px;
  --row-height-default: 44px;
  --row-height-comfortable: 52px;
  --table-cell-padding-x: 14px;
  --table-cell-padding-y: 12px;
  --z-base: 0;
  --z-sticky: 100;
  --z-dropdown: 700;
  --z-popover: 800;
  --z-modal: 1000;
  --z-toast: 1100;
  --z-tooltip: 1200;
  --duration-fast: 140ms;
  --duration-medium: 200ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-linear: linear;

  /* KMFX design-system contract */
  --kmfx-page-bg: #0a0a0a;
  --kmfx-shell-bg: #111111;
  --kmfx-card-bg: #151515;
  --kmfx-card-bg-soft: #1a1a1a;
  --kmfx-border: rgba(255,255,255,0.08);
  --kmfx-border-strong: rgba(255,255,255,0.12);
  --kmfx-gap-page: 28px;
  --kmfx-gap-section: 24px;
  --kmfx-gap-card: 16px;
  --kmfx-card-padding: 24px;
  --kmfx-card-radius: 16px;
  --kmfx-title-size: 34px;
  --kmfx-title-line: 1.05;
  --kmfx-subtitle-size: 15px;
  --kmfx-label-size: 11px;

  /* Minimal layout contracts for future migrations */
  --card-padding: var(--space-5);
  --row-padding-y: var(--space-3);
  --section-gap: var(--space-4);
  --kpi-padding: var(--space-4);

  /* --------------------------------------------------------------------------
     KMFX Design System Token Bridge
     shadcn-inspired semantic aliases for vanilla CSS usage.
     These tokens intentionally map to the existing KMFX visual system to avoid
     a disruptive redesign. Future primitive classes can consume this bridge
     without introducing React, Tailwind, or shadcn/ui as runtime dependencies.
  -------------------------------------------------------------------------- */
  --background: var(--layer-0);
  --foreground: var(--text-0);
  --card: var(--layer-1);
  --card-foreground: var(--text-0);
  --popover: var(--layer-1);
  --popover-foreground: var(--text-0);
  --primary: var(--accent);
  --primary-foreground: #ffffff;
  --secondary: var(--layer-2);
  --secondary-foreground: var(--text-0);
  --muted: var(--layer-2);
  --muted-foreground: var(--text-2);
  --accent-foreground: #ffffff;
  --destructive: var(--negative);
  --destructive-foreground: #ffffff;
  --border: var(--border-1);
  --input: var(--border-1);
  --ring: var(--accent);
  --radius: var(--kmfx-card-radius);
  --sidebar: var(--layer-1);
  --sidebar-foreground: var(--text-0);
  --sidebar-primary: var(--accent);
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: var(--layer-accent);
  --sidebar-accent-foreground: var(--text-0);
  --sidebar-border: var(--border-0);
  --sidebar-ring: var(--accent);

  --profit: var(--positive);
  --profit-foreground: #061b10;
  --profit-muted: rgba(48, 209, 88, 0.14);
  --loss: var(--negative);
  --loss-foreground: #ffffff;
  --loss-muted: rgba(255, 69, 58, 0.14);
  --breakeven: var(--text-1);
  --breakeven-foreground: var(--text-0);
  --risk: var(--warning);
  --risk-foreground: #1f1300;
  --risk-muted: rgba(255, 159, 10, 0.14);
  --drawdown: var(--negative);
  --drawdown-foreground: #ffffff;
  --equity: var(--accent);
  --equity-foreground: #ffffff;
  --funded: #A78BFA;
  --funded-foreground: #ffffff;

  --chart-1: var(--profit);
  --chart-2: var(--equity);
  --chart-3: var(--risk);
  --chart-4: var(--loss);
  --chart-5: var(--funded);
  --chart-axis: var(--chart-axis-text);
  --chart-tooltip: var(--chart-tooltip-bg);

  --surface-page: var(--layer-0);
  --surface-card: var(--layer-1);
  --surface-card-hover: var(--layer-2);
  --surface-elevated: var(--layer-2);
  --surface-overlay: rgba(0, 0, 0, 0.58);
  --radius-sm: var(--control-radius);
  --radius-md: var(--radius-card);
  --radius-lg: var(--radius-section);
  --radius-xl: var(--radius-shell);
}

html,
body {
  background: var(--layer-0);
  color: var(--text-0);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--layer-0);
  background-image: none;
}

body::before,
body::after {
  content: none;
}

/* --------------------------------------------------------------------------
   KMFX Primitive Layer
   Vanilla shadcn-inspired reusable UI classes.
   These classes are intentionally additive and are not applied automatically.
   Future renderer migrations should use these primitives gradually.
   Note: `.kmfx-card` already exists in the legacy system, so this layer uses
   the safer `.kmfx-ui-*` prefix to avoid accidental overrides.
-------------------------------------------------------------------------- */
.kmfx-ui-card {
  color: var(--card-foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.kmfx-ui-card--interactive {
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.kmfx-ui-card--interactive:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-2);
}

.kmfx-ui-card--flat {
  box-shadow: none;
}

.kmfx-ui-card--elevated {
  background: var(--surface-elevated);
  box-shadow: var(--shadow-elevated);
}

.kmfx-ui-card__header,
.kmfx-ui-card__content,
.kmfx-ui-card__footer {
  padding: 24px;
}

.kmfx-ui-card__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid var(--border-0);
}

.kmfx-ui-card__title {
  margin: 0;
  color: var(--card-foreground);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.kmfx-ui-card__eyebrow {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kmfx-ui-card__description {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.45;
}

.kmfx-ui-card__content {
  color: var(--foreground);
}

.kmfx-ui-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-0);
}

.kmfx-ui-kpi {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 150px;
  padding: 18px 20px;
  color: var(--foreground);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 3%, transparent), transparent 58%),
    var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition:
    border-color var(--duration-fast) var(--ease-standard),
    background-color var(--duration-fast) var(--ease-standard);
}

.kmfx-ui-kpi:hover {
  border-color: color-mix(in srgb, var(--foreground) 12%, var(--border));
}

.kmfx-ui-kpi__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
}

.kmfx-ui-kpi__icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  background: color-mix(in srgb, var(--foreground) 4%, transparent);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-md);
}

.kmfx-ui-kpi__icon svg {
  width: 16px;
  height: 16px;
}

.kmfx-ui-kpi__badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.kmfx-ui-kpi__body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.kmfx-ui-kpi__media {
  min-width: 0;
}

.kmfx-ui-kpi__label {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.1;
  font-weight: 760;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.kmfx-ui-kpi__value {
  margin: 0;
  color: var(--foreground);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1;
  font-weight: 680;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.kmfx-ui-kpi__meta {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.4;
}

.kmfx-ui-trend-badge,
.kmfx-ui-kpi__trend {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  color: var(--muted-foreground);
  background: color-mix(in srgb, var(--muted) 72%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--control-radius-pill);
  font-size: 10px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kmfx-ui-trend-badge[data-tone="profit"],
.kmfx-ui-kpi__trend[data-tone="profit"],
.kmfx-ui-kpi__trend[data-tone="positive"] {
  color: var(--profit);
  background: var(--profit-muted);
  border-color: color-mix(in srgb, var(--profit) 24%, var(--border));
}

.kmfx-ui-trend-badge[data-tone="loss"],
.kmfx-ui-kpi__trend[data-tone="loss"],
.kmfx-ui-kpi__trend[data-tone="negative"] {
  color: var(--loss);
  background: var(--loss-muted);
  border-color: color-mix(in srgb, var(--loss) 24%, var(--border));
}

.kmfx-ui-trend-badge[data-tone="neutral"],
.kmfx-ui-kpi__trend[data-tone="neutral"] {
  color: var(--muted-foreground);
}

.kmfx-ui-kpi[data-tone="profit"] {
  border-color: color-mix(in srgb, var(--profit) 18%, var(--border));
}

.kmfx-ui-kpi[data-tone="profit"] .kmfx-ui-kpi__value {
  color: var(--profit);
}

.kmfx-ui-kpi[data-tone="loss"] {
  border-color: color-mix(in srgb, var(--loss) 18%, var(--border));
}

.kmfx-ui-kpi[data-tone="loss"] .kmfx-ui-kpi__value {
  color: var(--loss);
}

.kmfx-ui-kpi[data-tone="warning"],
.kmfx-ui-kpi[data-tone="risk"] {
  border-color: color-mix(in srgb, var(--risk) 18%, var(--border));
}

.kmfx-ui-kpi[data-tone="warning"] .kmfx-ui-kpi__value,
.kmfx-ui-kpi[data-tone="risk"] .kmfx-ui-kpi__value {
  color: var(--risk);
}

.kmfx-ui-kpi[data-tone="info"] {
  border-color: color-mix(in srgb, var(--equity) 18%, var(--border));
}

.kmfx-ui-kpi[data-tone="info"] .kmfx-ui-kpi__value {
  color: var(--equity);
}

.kmfx-ui-button {
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--secondary-foreground);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease-standard),
    background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}

.kmfx-ui-button:hover {
  background: var(--muted);
  border-color: var(--border-2);
}

.kmfx-ui-button[data-variant="primary"] {
  color: var(--primary-foreground);
  background: var(--primary);
  border-color: var(--primary);
}

.kmfx-ui-button[data-variant="primary"]:hover {
  background: color-mix(in srgb, var(--primary) 88%, #ffffff 12%);
  border-color: color-mix(in srgb, var(--primary) 88%, #ffffff 12%);
}

.kmfx-ui-button[data-variant="secondary"] {
  color: var(--secondary-foreground);
  background: var(--secondary);
}

.kmfx-ui-button[data-variant="ghost"] {
  color: var(--muted-foreground);
  background: transparent;
  border-color: transparent;
}

.kmfx-ui-button[data-variant="ghost"]:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.04);
}

.kmfx-ui-button[data-variant="destructive"] {
  color: var(--destructive-foreground);
  background: var(--destructive);
  border-color: var(--destructive);
}

.kmfx-ui-button[data-size="sm"] {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.kmfx-ui-button[data-size="md"] {
  height: 40px;
  padding: 0 16px;
  font-size: 13px;
}

.kmfx-ui-button[data-size="lg"] {
  height: 48px;
  padding: 0 20px;
  font-size: 14px;
}

.kmfx-ui-button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.kmfx-ui-button:disabled,
.kmfx-ui-button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.kmfx-ui-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  gap: 5px;
  min-height: 22px;
  padding: 3px 8px;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--control-radius-pill);
}

.kmfx-ui-badge[data-tone="neutral"] {
  color: var(--muted-foreground);
  background: rgba(255, 255, 255, 0.04);
}

.kmfx-ui-badge[data-tone="profit"] {
  color: var(--profit);
  background: var(--profit-muted);
  border-color: rgba(48, 209, 88, 0.22);
}

.kmfx-ui-badge[data-tone="loss"] {
  color: var(--loss);
  background: var(--loss-muted);
  border-color: rgba(255, 69, 58, 0.22);
}

.kmfx-ui-badge[data-tone="warning"],
.kmfx-ui-badge[data-tone="risk"] {
  color: var(--risk);
  background: var(--risk-muted);
  border-color: rgba(255, 159, 10, 0.22);
}

.kmfx-ui-badge[data-tone="info"] {
  color: var(--equity);
  background: var(--layer-accent);
  border-color: rgba(10, 132, 255, 0.22);
}

.kmfx-ui-badge[data-tone="funded"] {
  color: var(--funded);
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.24);
}

/* --------------------------------------------------------------------------
   KMFX Trading Primitives
   P&L and trading-state helpers built on semantic tokens.
-------------------------------------------------------------------------- */
.kmfx-ui-pnl {
  display: inline;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kmfx-ui-pnl[data-tone="profit"] {
  color: var(--profit);
}

.kmfx-ui-pnl[data-tone="loss"] {
  color: var(--loss);
}

.kmfx-ui-pnl[data-tone="breakeven"] {
  color: var(--breakeven);
}

.kmfx-ui-pnl[data-tone="neutral"] {
  color: var(--muted-foreground);
}

.kmfx-ui-pnl-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 8px;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--control-radius-pill);
  font-variant-numeric: tabular-nums;
}

.kmfx-ui-pnl-badge[data-tone="profit"] {
  color: var(--profit);
  background: var(--profit-muted);
  border-color: color-mix(in srgb, var(--profit) 24%, var(--border) 76%);
}

.kmfx-ui-pnl-badge[data-tone="loss"] {
  color: var(--loss);
  background: var(--loss-muted);
  border-color: color-mix(in srgb, var(--loss) 24%, var(--border) 76%);
}

.kmfx-ui-pnl-badge[data-tone="breakeven"] {
  color: var(--breakeven);
  background: var(--muted);
  border-color: var(--border);
}

.kmfx-ui-pnl-badge[data-tone="neutral"] {
  color: var(--muted-foreground);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.kmfx-ui-table-wrap {
  overflow: auto;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.kmfx-ui-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.kmfx-ui-table th,
.kmfx-ui-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-0);
}

.kmfx-ui-table th {
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--muted) 72%, transparent);
}

.kmfx-ui-table td {
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.35;
}

.kmfx-ui-table tbody tr {
  transition: background-color 140ms ease;
}

.kmfx-ui-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.kmfx-ui-table .is-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.kmfx-ui-table .is-muted {
  color: var(--muted-foreground);
}

.kmfx-ui-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--surface-overlay);
}

.kmfx-ui-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1001;
  width: min(560px, calc(100vw - 32px));
  max-height: min(84vh, 760px);
  overflow: hidden;
  color: var(--popover-foreground);
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
}

.kmfx-ui-dialog__header,
.kmfx-ui-dialog__content,
.kmfx-ui-dialog__footer {
  padding: 24px;
}

.kmfx-ui-dialog__header {
  border-bottom: 1px solid var(--border);
}

.kmfx-ui-dialog__title {
  margin: 0;
  color: var(--popover-foreground);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.kmfx-ui-dialog__description {
  margin: 8px 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.45;
}

.kmfx-ui-dialog__content {
  overflow: auto;
}

.kmfx-ui-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-0);
}

.kmfx-ui-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: var(--kmfx-gap-page);
}

.kmfx-ui-page-header__eyebrow {
  margin: 0 0 8px;
  color: var(--muted-foreground);
  font-size: var(--kmfx-label-size);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.kmfx-ui-page-header__title {
  margin: 0;
  color: var(--foreground);
  font-size: var(--kmfx-title-size);
  line-height: var(--kmfx-title-line);
  font-weight: 780;
  letter-spacing: -0.045em;
}

.kmfx-ui-page-header__description {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted-foreground);
  font-size: var(--kmfx-subtitle-size);
  line-height: 1.45;
}

.kmfx-ui-page-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.kmfx-ui-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.kmfx-ui-field {
  display: grid;
  gap: 6px;
}

.kmfx-ui-field__label {
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kmfx-ui-field__hint {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.4;
}

.kmfx-ui-input,
.kmfx-ui-select {
  height: var(--control-height);
  min-width: 0;
  padding: 0 12px;
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  background: var(--card);
  border: 1px solid var(--input);
  border-radius: var(--control-radius);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.kmfx-ui-select {
  padding-right: 34px;
}

.kmfx-ui-input::placeholder {
  color: var(--muted-foreground);
}

.kmfx-ui-input:focus-visible,
.kmfx-ui-select:focus-visible {
  border-color: color-mix(in srgb, var(--ring) 55%, var(--border) 45%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent);
}

.kmfx-ui-empty-state,
.kmfx-ui-loading-state,
.kmfx-ui-error-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 160px;
  padding: 24px;
  text-align: center;
  color: var(--muted-foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.kmfx-ui-empty-state__title {
  margin: 0;
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
}

.kmfx-ui-empty-state__description {
  max-width: 420px;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.45;
}

.kmfx-ui-error-state {
  color: var(--loss);
  background: var(--loss-muted);
  border-color: rgba(255, 69, 58, 0.22);
}

/* --------------------------------------------------------------------------
   KMFX Primitive Layer — DS-2 Additions
   Future-ready shadcn-inspired primitives for vanilla CSS.
   These classes are additive only and are not applied automatically.
-------------------------------------------------------------------------- */
.kmfx-ui-segmented,
.kmfx-ui-tabs__list {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 2px;
  padding: 3px;
  color: var(--muted-foreground);
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--control-radius-pill);
}

.kmfx-ui-segmented__item,
.kmfx-ui-tabs__trigger {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--control-radius-pill);
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.kmfx-ui-segmented__item:hover,
.kmfx-ui-tabs__trigger:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.035);
}

.kmfx-ui-segmented__item[aria-selected="true"],
.kmfx-ui-segmented__item.is-active,
.kmfx-ui-tabs__trigger[aria-selected="true"],
.kmfx-ui-tabs__trigger.is-active {
  color: var(--foreground);
  background: var(--surface-card-hover);
  border-color: var(--border-1);
}

.kmfx-ui-segmented__item:focus-visible,
.kmfx-ui-tabs__trigger:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.kmfx-ui-tabs {
  display: grid;
  gap: 14px;
}

.kmfx-ui-tooltip {
  position: relative;
  z-index: var(--z-tooltip);
  width: max-content;
  max-width: min(280px, calc(100vw - 32px));
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition:
    opacity var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}

.kmfx-ui-tooltip[data-state="open"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.kmfx-ui-tooltip__content {
  padding: 8px 10px;
  color: var(--popover-foreground);
  font-size: 12px;
  line-height: 1.35;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--chart-tooltip-shadow);
}

.kmfx-ui-popover,
.kmfx-ui-dropdown {
  position: relative;
  z-index: var(--z-popover);
  color: var(--popover-foreground);
}

.kmfx-ui-popover__content,
.kmfx-ui-dropdown {
  min-width: 180px;
  padding: 6px;
  color: var(--popover-foreground);
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
}

.kmfx-ui-dropdown__item {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  color: var(--foreground);
  font-size: 13px;
  line-height: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease-standard),
    background-color var(--duration-fast) var(--ease-standard);
}

.kmfx-ui-dropdown__item:hover,
.kmfx-ui-dropdown__item:focus-visible {
  color: var(--foreground);
  background: var(--muted);
  outline: none;
}

.kmfx-ui-dropdown__item[aria-selected="true"] {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.06);
}

.kmfx-ui-dropdown__separator {
  height: 1px;
  margin: 6px -6px;
  background: var(--border);
}

.kmfx-ui-scroll-area {
  overflow: auto;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
}

.kmfx-ui-scroll-area::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.kmfx-ui-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.kmfx-ui-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border: 3px solid transparent;
  border-radius: var(--control-radius-pill);
  background-clip: padding-box;
}

.kmfx-ui-scroll-area::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
  border: 3px solid transparent;
  background-clip: padding-box;
}

.kmfx-ui-scroll-area--thin::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.kmfx-ui-scroll-area--hidden {
  scrollbar-width: none;
}

.kmfx-ui-scroll-area--hidden::-webkit-scrollbar {
  display: none;
}

.kmfx-ui-chart-card {
  color: var(--card-foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.kmfx-ui-chart-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border-0);
}

.kmfx-ui-chart-card__title {
  margin: 0;
  color: var(--card-foreground);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.kmfx-ui-chart-card__eyebrow {
  margin: 0 0 7px;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kmfx-ui-chart-card__description {
  margin: 6px 0 0;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.4;
}

.kmfx-ui-chart-card__content {
  min-height: 240px;
  padding: 18px 20px;
}

.kmfx-ui-chart-card__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 0 20px 18px;
}

.kmfx-ui-chart-card__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1;
}

.kmfx-ui-chart-card__legend-item::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--chart-1);
  border-radius: var(--control-radius-pill);
}

.kmfx-ui-decision-layer {
  color: var(--card-foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.kmfx-ui-decision-layer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 0;
}

.kmfx-ui-decision-layer__eyebrow,
.kmfx-ui-decision-card__label {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kmfx-ui-decision-layer__title {
  margin: 6px 0 0;
  color: var(--card-foreground);
  font-size: 18px;
  line-height: 1.18;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.kmfx-ui-decision-layer__description {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.45;
}

.kmfx-ui-decision-layer__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 20px 20px;
}

.kmfx-ui-decision-card {
  min-width: 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-md);
}

.kmfx-ui-decision-card[data-tone="neutral"] {
  border-color: var(--border-0);
}

.kmfx-ui-decision-card[data-tone="info"] {
  background: color-mix(in srgb, var(--equity) 8%, transparent);
  border-color: color-mix(in srgb, var(--equity) 20%, var(--border-0));
}

.kmfx-ui-decision-card[data-tone="warning"] {
  background: var(--risk-muted);
  border-color: color-mix(in srgb, var(--risk) 22%, var(--border-0));
}

.kmfx-ui-decision-card[data-tone="success"] {
  background: var(--profit-muted);
  border-color: color-mix(in srgb, var(--profit) 22%, var(--border-0));
}

.kmfx-ui-decision-card[data-tone="danger"] {
  background: var(--loss-muted);
  border-color: color-mix(in srgb, var(--loss) 22%, var(--border-0));
}

.kmfx-ui-decision-card__title {
  margin: 9px 0 0;
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 740;
}

.kmfx-ui-decision-card__description {
  margin: 6px 0 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Calendario — Summary KPI Row
-------------------------------------------------------------------------- */

.calendar-kpi-card {
  min-height: 132px;
}

.calendar-kpi-card .kmfx-ui-kpi__body {
  min-height: 100%;
}

.calendar-kpi-card .kmfx-ui-kpi__label {
  margin: 0;
}

.calendar-kpi-card .kmfx-ui-kpi__value {
  margin-top: 10px;
  color: var(--foreground);
}

.calendar-kpi-card[data-tone="profit"] .kmfx-ui-kpi__value {
  color: var(--profit);
}

.calendar-kpi-card[data-tone="loss"] .kmfx-ui-kpi__value {
  color: var(--loss);
}

.calendar-kpi-card[data-tone="warning"] .kmfx-ui-kpi__value {
  color: var(--risk);
}

.calendar-kpi-card--days .kmfx-ui-kpi__value,
.calendar-kpi-card--review .kmfx-ui-kpi__value {
  font-size: clamp(20px, 1.55vw, 24px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.calendar-kpi-card--days[data-tone="info"] .kmfx-ui-kpi__value {
  color: var(--foreground);
}

.calendar-kpi-card--review:not([data-tone="warning"]) .kmfx-ui-kpi__value {
  color: var(--foreground);
}

.calendar-kpi-card .kmfx-ui-kpi__meta {
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Dashboard — KPI Row
-------------------------------------------------------------------------- */

.dashboard-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.dashboard-kpi-card {
  min-height: 118px;
  padding: 14px 15px 15px;
  gap: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 2.5%, transparent), transparent 60%),
    var(--card);
}

.dashboard-kpi-card .kmfx-ui-kpi__top {
  min-height: 28px;
}

.dashboard-kpi-card[data-tone="warning"],
.dashboard-kpi-card[data-tone="risk"] {
  border-color: color-mix(in srgb, var(--risk) 18%, var(--border));
}

.dashboard-kpi-card .kmfx-ui-kpi__body {
  gap: 8px;
}

.dashboard-kpi-card .kmfx-ui-kpi__value {
  color: inherit;
  font-size: inherit;
  line-height: normal;
  font-weight: inherit;
  letter-spacing: normal;
}

.dashboard-kpi-card__value-stack {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.dashboard-kpi-card__metric {
  color: var(--foreground);
  font-size: clamp(22px, 1.8vw, 30px);
  line-height: 0.98;
  font-weight: 720;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.dashboard-kpi-card[data-dashboard-kpi="equity"] .dashboard-kpi-card__metric {
  font-size: clamp(20px, 1.7vw, 28px);
}

.dashboard-kpi-card[data-tone="profit"] .dashboard-kpi-card__metric {
  color: var(--profit);
}

.dashboard-kpi-card[data-tone="loss"] .dashboard-kpi-card__metric {
  color: var(--loss);
}

.dashboard-kpi-card[data-tone="warning"] .dashboard-kpi-card__metric,
.dashboard-kpi-card[data-tone="risk"] .dashboard-kpi-card__metric {
  color: var(--risk);
}

.dashboard-kpi-card[data-tone="info"] .dashboard-kpi-card__metric {
  color: var(--equity);
}

.dashboard-kpi-card[data-dashboard-kpi="equity"][data-tone="info"] .dashboard-kpi-card__metric {
  color: var(--foreground);
}

.dashboard-kpi-card[data-dashboard-kpi="edge"] .dashboard-kpi-card__metric {
  color: color-mix(in srgb, var(--foreground) 92%, var(--muted-foreground));
}

.dashboard-kpi-card__meta {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 520;
  letter-spacing: 0;
}

@media (max-width: 1280px) {
  .dashboard-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .dashboard-kpi-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .kmfx-ui-decision-layer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .kmfx-ui-segmented,
  .kmfx-ui-tabs__list {
    width: 100%;
    overflow-x: auto;
  }

  .kmfx-ui-decision-layer__header {
    flex-direction: column;
  }

  .kmfx-ui-decision-layer__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kmfx-ui-card--interactive,
  .kmfx-ui-kpi,
  .kmfx-ui-button,
  .kmfx-ui-table tbody tr,
  .kmfx-ui-input,
  .kmfx-ui-select,
  .kmfx-ui-segmented *,
  .kmfx-ui-tabs *,
  .kmfx-ui-popover *,
  .kmfx-ui-dropdown *,
  .kmfx-ui-tooltip *,
  .kmfx-ui-chart-card *,
  .kmfx-ui-decision-layer * {
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
  }
}

.app-shell {
  background: var(--layer-0);
  box-shadow: none;
  border: 0;
  min-height: 100vh;
}

.sidebar {
  background: var(--layer-1);
  border-right: 1px solid var(--border-0);
  box-shadow: none;
  width: 212px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: var(--radius-shell);
}

/* Nav section labels */
.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 8px 4px;
}

/* Nav items — Apple style: sin background, solo texto */
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-1);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
  background: transparent;
  border: none;
  text-decoration: none;
  width: 100%;
  min-width: 0;
}

.nav-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  flex-shrink: 0;
  opacity: 0.7;
}

/* Hover — muy sutil */
.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-0);
}

.nav-item:hover svg {
  opacity: 1;
}

/* Activo — solo tinte muy sutil, sin pill azul */
.nav-item.active {
  background: rgba(255,255,255,0.06) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: none !important;
  border-radius: 7px !important;
}

.nav-item.active svg {
  stroke: var(--accent) !important;
  opacity: 1 !important;
}

.nav-item.active span {
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* Badge numérico en nav items */
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--layer-3);
  border-radius: 20px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

/* Brand / logo area */
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 12px;
  border-bottom: 1px solid var(--border-0);
  margin-bottom: 4px;
}

.brand-lockup .brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.022em;
}

/* Footer del sidebar */
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-0);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.sidebar-profile:hover {
  background: rgba(255,255,255,0.05);
}

.sidebar-profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
  line-height: 1.2;
}

.sidebar-profile-email {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.2;
}

.topbar {
  background: var(--layer-0);
  border-bottom: 1px solid #1C1C1E;
  box-shadow: none;
  height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-panel {
  background: var(--layer-0);
  box-shadow: none;
  margin-left: 242px;
  padding: 20px 20px 20px 0;
  gap: 16px;
}

.content {
  background: var(--layer-0);
  box-shadow: none;
  width: min(100%, 1500px);
  padding: 0 0 22px;
  gap: 20px;
}

.sidebar-header {
  padding: 8px 10px 2px;
  gap: 14px;
}

.sidebar-nav {
  padding-inline: 4px;
}

.sidebar-footer {
  padding-top: 14px;
}

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

.topbar-meta,
.topbar-user-shell {
  gap: 8px;
}

.topbar-user-card,
.topbar-time-stack {
  background: var(--layer-2);
  box-shadow: none;
  border: 0.5px solid var(--border-0);
}

/* Temporary dark-only migration: hide theme switching UI entry points */
.theme-toggle-badge,
[data-theme-toggle],
label.form-stack:has(select[data-settings-field="theme"]) {
  display: none;
}

/* Temporary dark-only migration: make v2 the source of truth for the shell */
html,
html:not([data-theme="dark"]),
html[data-theme="dark"] {
  background: var(--layer-0);
  color: var(--text-0);
  color-scheme: dark;
}

body,
html:not([data-theme="dark"]) body,
html[data-theme="dark"] body,
body[data-theme="dark"] {
  background: var(--layer-0);
  color: var(--text-0);
  background-image: none;
}

html body::before,
html body::after,
html .content::before {
  content: none;
  display: none;
}

.app-shell,
html:not([data-theme="dark"]) .app-shell,
html[data-theme="dark"] .app-shell,
body[data-theme="dark"] .app-shell {
  background: var(--layer-0);
  border: 0;
  box-shadow: none;
}

.sidebar,
html:not([data-theme="dark"]) .sidebar,
html[data-theme="dark"] .sidebar,
body[data-theme="dark"] .sidebar {
  background: var(--layer-1);
  border-right: 1px solid var(--border-0);
  box-shadow: none;
  border-radius: var(--radius-shell);
}

.topbar,
html:not([data-theme="dark"]) .topbar,
html[data-theme="dark"] .topbar,
body[data-theme="dark"] .topbar {
  background: var(--layer-0);
  border-bottom: 1px solid #1C1C1E;
  box-shadow: none;
}

.main-panel,
html:not([data-theme="dark"]) .main-panel,
html[data-theme="dark"] .main-panel,
body[data-theme="dark"] .main-panel {
  background: var(--layer-0);
  box-shadow: none;
}

.content,
html:not([data-theme="dark"]) .content,
html[data-theme="dark"] .content,
body[data-theme="dark"] .content {
  background: var(--layer-0);
  box-shadow: none;
}

.brand-lockup,
html:not([data-theme="dark"]) .brand-lockup,
html[data-theme="dark"] .brand-lockup {
  background: var(--layer-1);
  border-color: var(--border-0);
  box-shadow: none;
}

.sidebar-search,
.sidebar-profile,
.topbar-user-card,
.topbar-time-stack,
html:not([data-theme="dark"]) .sidebar-search,
html:not([data-theme="dark"]) .sidebar-profile,
html:not([data-theme="dark"]) .topbar-user-card,
html:not([data-theme="dark"]) .topbar-time-stack,
html[data-theme="dark"] .sidebar-search,
html[data-theme="dark"] .sidebar-profile,
html[data-theme="dark"] .topbar-user-card,
html[data-theme="dark"] .topbar-time-stack {
  background: var(--layer-2);
  border: 0.5px solid var(--border-0);
  box-shadow: none;
}

/* ── NAV ITEM ACTIVE — eliminar pill azul de styles.css ── */
html .nav-item.active,
html[data-theme="dark"] .nav-item.active {
  background: rgba(255,255,255,0.06) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: none !important;
  border-radius: 7px !important;
}

html .nav-item.active svg,
html[data-theme="dark"] .nav-item.active svg {
  stroke: var(--accent) !important;
  opacity: 1 !important;
}

html .nav-item.active span,
html[data-theme="dark"] .nav-item.active span {
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* ── NAV ITEM BASE — quitar cualquier background heredado ── */
html .nav-item,
html[data-theme="dark"] .nav-item {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* ── SIDEBAR — negro puro sin tinte azul ── */
html .sidebar,
html[data-theme="dark"] .sidebar,
html:not([data-theme="dark"]) .sidebar,
body[data-theme="dark"] .sidebar {
  background: #111111 !important;
  border-right: 1px solid rgba(255,255,255,0.05) !important;
  box-shadow: none !important;
}

/* ── APP SHELL Y BODY — negro puro ── */
html .app-shell,
html[data-theme="dark"] .app-shell,
html:not([data-theme="dark"]) .app-shell,
body[data-theme="dark"] .app-shell,
html body,
html[data-theme="dark"] body {
  background: #0a0a0a !important;
  background-image: none !important;
  background-color: #0a0a0a !important;
}

/* ── TOPBAR — mismo negro que body ── */
html .topbar,
html[data-theme="dark"] .topbar {
  background: #0a0a0a !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  box-shadow: none !important;
}

html .main-panel,
html[data-theme="dark"] .main-panel {
  background: #0a0a0a !important;
  box-shadow: none !important;
}

/* ── SECTION LABELS — quitar uppercase pesado ── */
html .sidebar-section-label,
html[data-theme="dark"] .sidebar-section-label,
.nav-section-label,
.nav-group-label,
.sidebar-nav-group-label {
  font-size: 10.5px !important;
  font-weight: 500 !important;
  color: rgba(255,255,255,0.30) !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  padding: 14px 8px 3px !important;
}

[data-admin-only][hidden] {
  display: none !important;
}

.sidebar-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: -4px 0 4px 54px;
  padding: 6px 10px;
  border: 0.5px solid rgba(59, 130, 246, 0.32);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: rgba(191, 219, 254, 0.92);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-admin-badge span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text-1);
  box-shadow: none;
}

.sidebar-admin-nav {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.sidebar-admin-nav .nav-group-label {
  color: rgba(147, 197, 253, 0.68) !important;
}

.sidebar-admin-nav .nav-item {
  color: rgba(219, 234, 254, 0.78) !important;
}

.sidebar-admin-nav .nav-item svg {
  stroke: rgba(147, 197, 253, 0.84) !important;
}

.kmfx-admin-trace-card {
  grid-column: 1 / -1;
  padding: 18px;
  border-color: rgba(59, 130, 246, 0.22);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(17, 17, 17, 0) 42%),
    var(--layer-1);
}

.kmfx-admin-trace-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.kmfx-admin-trace-card__eyebrow {
  color: rgba(147, 197, 253, 0.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.kmfx-admin-trace-card__title {
  margin-top: 5px;
  color: var(--text-0);
  font-size: 18px;
  font-weight: 760;
}

.kmfx-admin-trace-card__sub {
  margin-top: 5px;
  color: var(--text-2);
  font-size: 13px;
}

.kmfx-admin-trace-card__badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 0.5px solid rgba(59, 130, 246, 0.28);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: rgba(191, 219, 254, 0.88);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kmfx-admin-trace-card__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.kmfx-admin-trace-card__item {
  min-width: 0;
  padding: 12px;
  border: 0.5px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.kmfx-admin-trace-card__item span,
.kmfx-admin-trace-card__item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kmfx-admin-trace-card__item span {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kmfx-admin-trace-card__item strong {
  margin-top: 7px;
  color: var(--text-0);
  font-size: 13px;
  font-weight: 720;
}

/* Shared section wrappers */
.tl-section-card,
.widget-card,
.chart-card,
.pnlcal-card,
.account-switcher,
.account-banner,
.table-wrap,
.widget-table-wrap {
  background: var(--layer-1);
  background-image: none;
  border: 0.5px solid var(--border-0);
  box-shadow: var(--shadow-card);
  color: var(--text-0);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: var(--radius-section);
}

.tl-section-card::before,
.widget-card::before,
.chart-card::before,
.pnlcal-card::before,
.account-switcher::before,
.account-banner::before,
.table-wrap::before,
.widget-table-wrap::before,
.tl-section-card::after,
.widget-card::after,
.chart-card::after,
.pnlcal-card::after,
.account-switcher::after,
.account-banner::after,
.table-wrap::after,
.widget-table-wrap::after {
  display: none;
}

.tl-section-card:hover,
.widget-card:hover,
.chart-card:hover,
.pnlcal-card:hover,
.account-switcher:hover,
.account-banner:hover,
.table-wrap:hover,
.widget-table-wrap:hover {
  background: var(--layer-1);
  background-image: none;
  border-color: var(--border-0);
  box-shadow: var(--shadow-card);
  transform: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.account-switcher--empty {
  min-height: 0;
}

.account-registry-card--active {
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.035) inset;
}

.accounts-empty-state .connections-guide-grid {
  margin-top: 12px;
}

.kmfx-mt5-page {
  display: grid;
  gap: 24px;
}

.kmfx-mt5-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.kmfx-mt5-header__title {
  margin: 0;
  font-size: clamp(28px, 3vw, 34px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.kmfx-mt5-header__subtitle {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.45;
}

.kmfx-mt5-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.kmfx-mt5-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.kmfx-mt5-card {
  background: var(--layer-2);
  border: 1px solid var(--border-1);
  border-radius: 22px;
  padding: 22px;
  display: grid;
  gap: 18px;
  box-shadow: var(--shadow-none);
}

.kmfx-mt5-card.is-active {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border-1));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.kmfx-mt5-card__alias {
  font-size: 21px;
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--text-0);
}

.kmfx-mt5-card__identity {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}

.kmfx-mt5-card__status-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.kmfx-mt5-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.kmfx-mt5-status__dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 5px;
  flex: 0 0 12px;
}

.kmfx-mt5-status--connected .kmfx-mt5-status__dot {
  background: #34c759;
  box-shadow: 0 0 0 5px rgba(52, 199, 89, 0.12);
}

.kmfx-mt5-status--waiting .kmfx-mt5-status__dot,
.kmfx-mt5-status--stale .kmfx-mt5-status__dot {
  background: #f5a623;
  box-shadow: 0 0 0 5px rgba(245, 166, 35, 0.14);
}

.kmfx-mt5-status--pending .kmfx-mt5-status__dot,
.kmfx-mt5-status--neutral .kmfx-mt5-status__dot {
  background: rgba(142, 142, 147, 0.92);
  box-shadow: 0 0 0 5px rgba(142, 142, 147, 0.12);
}

.kmfx-mt5-status--error .kmfx-mt5-status__dot {
  background: #ff453a;
  box-shadow: 0 0 0 5px rgba(255, 69, 58, 0.12);
}

.kmfx-mt5-status__label {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-0);
  letter-spacing: -0.01em;
}

.kmfx-mt5-status__subtitle {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.kmfx-mt5-card__sync {
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
  padding-top: 2px;
}

.kmfx-mt5-card__actions {
  display: flex;
  justify-content: flex-start;
}

.kmfx-mt5-admin-panel {
  margin-top: 2px;
  padding: 16px;
  display: grid;
  gap: 14px;
  background: color-mix(in srgb, var(--layer-1) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border-1));
  border-radius: 20px;
}

.kmfx-mt5-admin-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.kmfx-mt5-admin-panel__eyebrow,
.kmfx-mt5-admin-panel__badge {
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.kmfx-mt5-admin-panel__eyebrow {
  color: var(--text-2);
}

.kmfx-mt5-admin-panel__title {
  margin-top: 4px;
  color: var(--text-0);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.kmfx-mt5-admin-panel__badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  color: color-mix(in srgb, var(--accent) 82%, var(--text-0));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 999px;
}

.kmfx-mt5-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kmfx-mt5-admin-actions .btn-secondary:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.kmfx-mt5-admin-meta {
  display: grid;
  gap: 8px;
  color: var(--text-2);
  font-size: 12px;
}

.kmfx-mt5-admin-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-1);
}

.kmfx-mt5-admin-meta strong {
  max-width: 70%;
  color: var(--text-0);
  font-family: var(--mono);
  font-weight: 650;
  text-align: right;
  overflow-wrap: anywhere;
}

.kmfx-mt5-admin-payload,
.kmfx-mt5-admin-empty {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border-1);
  border-radius: 16px;
}

.kmfx-mt5-admin-payload {
  max-height: 240px;
  overflow: auto;
  color: var(--text-1);
  background: rgba(0, 0, 0, 0.24);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.kmfx-mt5-admin-empty {
  color: var(--text-2);
  background: color-mix(in srgb, var(--layer-2) 72%, transparent);
  font-size: 13px;
  line-height: 1.45;
}

.kmfx-mt5-empty {
  background: var(--layer-2);
  border: 1px solid var(--border-1);
  border-radius: 28px;
  padding: clamp(28px, 6vw, 56px);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 16px;
  box-shadow: var(--shadow-none);
}

.kmfx-mt5-empty__icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: var(--text-primary);
  background: var(--layer-2);
}

.kmfx-mt5-empty__title {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: var(--text-0);
}

.kmfx-mt5-empty__copy {
  max-width: 540px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.5;
}

.kmfx-mt5-empty__steps {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  width: min(100%, 420px);
}

.kmfx-mt5-empty__steps li {
  background: var(--layer-1);
  border: 1px solid var(--border-1);
  border-radius: 16px;
  padding: 14px 16px;
  text-align: left;
  color: var(--text-1);
  font-size: 14px;
}

.kmfx-mt5-empty__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.kmfx-mt5-modal {
  max-width: 560px;
  width: min(92vw, 560px);
  margin: 48px auto;
  background: var(--layer-1);
  border: 1px solid var(--border-1);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-elevated);
}

.kmfx-mt5-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.kmfx-mt5-modal__eyebrow {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kmfx-mt5-modal__title {
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: var(--text-0);
}

.kmfx-mt5-modal__subtitle {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
}

.kmfx-mt5-modal__body {
  margin-top: 20px;
}

.kmfx-mt5-inline-error {
  color: var(--negative);
  font-size: 13px;
  line-height: 1.4;
}

.kmfx-mt5-modal__success {
  margin-top: 24px;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 12px;
}

.kmfx-mt5-modal__success-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 24px;
  color: #34c759;
  background: rgba(52, 199, 89, 0.12);
}

.kmfx-mt5-modal__success-title {
  font-size: 22px;
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--text-0);
}

.kmfx-mt5-modal__success-copy {
  max-width: 420px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
}

.kmfx-mt5-modal__footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

/* INICIO BLOQUE: wizard-legacy-removed */
/* Reemplazado por el bloque runtime scoped al final del archivo para evitar que
   inputs, buttons y widget-card globales pisen el wizard real. */
/* FIN BLOQUE: wizard-legacy-removed */

@media (max-width: 720px) {
  .kmfx-mt5-page {
    gap: 20px;
  }

  .kmfx-mt5-header {
    flex-direction: column;
    align-items: stretch;
  }

  .kmfx-mt5-header__actions {
    width: 100%;
  }

  .kmfx-mt5-header__actions > * {
    flex: 1 1 220px;
  }

  .kmfx-mt5-card {
    padding: 18px;
    gap: 16px;
    border-radius: 20px;
  }

  .kmfx-mt5-card__status-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .kmfx-mt5-card__sync {
    padding-top: 0;
  }

  .kmfx-mt5-empty {
    padding: 24px;
    border-radius: 24px;
  }

  .kmfx-mt5-empty__actions {
    width: 100%;
  }

  .kmfx-mt5-empty__actions > * {
    flex: 1 1 220px;
  }

  .kmfx-mt5-modal {
    width: min(94vw, 560px);
    margin: 24px auto;
    padding: 20px;
    border-radius: 22px;
  }

  .kmfx-mt5-modal__header {
    flex-direction: column;
    align-items: stretch;
  }

  .kmfx-mt5-modal__footer {
    justify-content: stretch;
  }

  .kmfx-mt5-modal__footer > * {
    flex: 1 1 220px;
  }
}

/* Elevated KPI cards */
.tl-kpi-card,
.rm4-card {
  background: var(--layer-2);
  background-image: none;
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-elevated);
  color: var(--text-0);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: var(--radius-card);
}

.tl-kpi-card::before,
.rm4-card::before,
.tl-kpi-card::after,
.rm4-card::after {
  display: none;
}

.tl-kpi-card:hover,
.rm4-card:hover {
  background: var(--layer-2);
  background-image: none;
  border-color: var(--border-1);
  box-shadow: var(--shadow-elevated);
  transform: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Shared control family */
html input:not([type="checkbox"]):not([type="radio"]),
html textarea,
html select,
html .custom-select-trigger,
html .risk-select-trigger,
html .funded-size-input {
  min-height: var(--control-height);
  border-radius: var(--control-radius);
  background: var(--layer-2);
  color: var(--text-0);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-none);
}

html input:not([type="checkbox"]):not([type="radio"])::placeholder,
html textarea::placeholder {
  color: var(--text-2);
}

html input:not([type="checkbox"]):not([type="radio"]):focus,
html textarea:focus,
html select:focus,
html .custom-select.open .custom-select-trigger,
html .risk-select.open .risk-select-trigger,
html .funded-size-input:focus {
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
  outline: none;
}

html .custom-select-trigger,
html .risk-select-trigger {
  min-height: var(--control-height);
  border-radius: var(--control-radius);
  padding: 12px 42px 12px 14px;
  background: var(--layer-2);
  color: var(--text-0);
  border: 1px solid var(--border-1);
}

html .risk-select-trigger::after,
html .custom-select-trigger::after {
  opacity: 0.88;
}

html .risk-stepper {
  min-height: var(--control-height);
  border-radius: var(--control-radius);
  background: var(--layer-2);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-none);
}

html .risk-stepper-btn {
  min-height: calc(var(--control-height) - 2px);
  background: transparent;
  color: var(--text-1);
  border: none;
  box-shadow: none;
}

html .risk-stepper-btn:hover {
  background: var(--layer-3);
  color: var(--text-0);
}

html .risk-config-toggle-ui {
  background: var(--layer-2);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-none);
}

html .risk-config-toggle-ui::after {
  background: var(--text-0);
  box-shadow: var(--shadow-control);
}

html .risk-config-toggle input:checked + .risk-config-toggle-ui {
  background: var(--layer-3);
  border-color: var(--border-2);
}

/* Tabs / segmented / pills / badges */
html .tl-tab-bar,
html .widget-segmented {
  background: var(--layer-2);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-none);
}

html .tl-tab,
html .widget-segmented-btn {
  min-height: 36px;
  border-radius: 10px;
  color: var(--text-1);
  background: transparent;
  border: 1px solid transparent;
}

html .tl-tab:hover,
html .widget-segmented-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-0);
}

html .tl-tab.active,
html .widget-segmented-btn.active {
  background: var(--layer-3);
  color: var(--text-0);
  border-color: var(--border-2);
  box-shadow: var(--shadow-none);
}

html .pill,
html .calc-chip,
html .calc-pill,
html .widget-pill,
html .ui-badge,
html .footer-chip,
html .row-chip {
  min-height: 28px;
  border-radius: var(--control-radius-pill);
  background: var(--layer-2);
  border: 1px solid var(--border-1);
  color: var(--text-1);
  box-shadow: var(--shadow-none);
}

html .ui-badge--ok {
  color: var(--positive);
  border-color: rgba(52, 217, 123, 0.22);
  background: rgba(52, 217, 123, 0.12);
}

html .ui-badge--warn {
  color: var(--warning);
  border-color: rgba(255, 176, 32, 0.2);
  background: rgba(255, 176, 32, 0.12);
}

html .ui-badge--error {
  color: var(--negative);
  border-color: rgba(255, 92, 92, 0.2);
  background: rgba(255, 92, 92, 0.12);
}

html .ui-badge--info {
  color: var(--text-1);
  border-color: var(--border-2);
  background: transparent;
}

/* Buttons */
html .btn-primary,
html .btn-secondary,
html .btn-destructive,
html .btn-ghost {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-none);
  transition: transform 0.12s ease, opacity 0.12s ease, filter 0.12s ease, background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

html .btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: none;
}

html .btn-primary:hover {
  filter: brightness(1.08);
}

html .btn-primary:active {
  transform: scale(0.97);
  filter: brightness(0.96);
}

html .btn-secondary {
  background: var(--layer-2);
  color: var(--text-0);
  border: 1px solid var(--border-1);
}

html .btn-secondary:hover {
  background: var(--layer-3);
  border-color: var(--border-2);
}

html .btn-secondary:active {
  transform: scale(0.97);
  opacity: 0.82;
}

html .btn-destructive {
  background: rgba(255, 92, 92, 0.14);
  color: var(--negative);
  border: none;
}

html .btn-destructive:hover {
  filter: brightness(1.05);
}

html .btn-destructive:active {
  transform: scale(0.97);
}

html .btn-ghost {
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border-1);
}

html .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-2);
  color: var(--text-0);
}

html .btn-ghost:active {
  opacity: 0.72;
}

html .btn-primary:disabled,
html .btn-secondary:disabled,
html .btn-destructive:disabled,
html .btn-ghost:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

/* Restrained dark glass system for floating surfaces */
html .risk-select-menu,
html .custom-select-dropdown,
html .bnav-more-menu,
html .sidebar-profile-menu,
html .kmfx-chart-tooltip {
  background: var(--glass-base);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  color: var(--text-0);
}

html .risk-select-menu,
html .custom-select-dropdown,
html .sidebar-profile-menu,
html .bnav-more-menu {
  border-radius: 14px;
}

html .topbar-user-card,
html .topbar-time-stack,
html .theme-toggle-badge {
  background: var(--glass-subtle);
  border: 1px solid var(--border-0);
  box-shadow: none;
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
}

html .sidebar-profile-menu-item,
html .custom-select-option {
  color: var(--text-1);
}

html .sidebar-profile-menu-item:hover,
html .custom-select-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-0);
}

html .sidebar-profile-menu-item.danger {
  color: var(--negative);
}

html .kmfx-chart-tooltip {
  background: var(--chart-tooltip-bg);
  border: 1px solid var(--chart-tooltip-border);
  box-shadow: var(--chart-tooltip-shadow);
  border-radius: 12px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html .kmfx-chart-tooltip-title {
  color: var(--chart-axis-text);
}

html .kmfx-chart-tooltip-body {
  color: var(--text-0);
}

/* Dashboard / Summary hierarchy */
.dashboard-page-flow,
.dashboard-premium-grid {
  gap: 20px;
}

.dashboard-hero-shell,
.dashboard-main-grid,
.dashboard-secondary-grid,
.dashboard-tertiary-grid,
.dashboard-bottom-grid {
  gap: 20px;
}

.dashboard-kpi-premium-grid,
.tl-kpi-row,
.tl-kpi-row.five {
  gap: 16px;
  margin-bottom: 16px;
}

.grid-2,
.grid-2.equal {
  gap: 16px;
  margin-bottom: 20px;
}

.tl-section-card,
.widget-card,
.chart-card,
.pnlcal-card,
.account-switcher,
.account-banner,
.table-wrap,
.widget-table-wrap {
  border-radius: var(--radius-section);
  padding: 20px;
}

.tl-section-header {
  margin-bottom: 14px;
  gap: 14px;
}

.tl-section-title {
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.022em;
}

.tl-section-title::before {
  width: 5px;
  height: 5px;
  background: var(--text-2);
}

.widget-card {
  background: var(--layer-2);
  border: 1px solid var(--border-1);
  padding: 20px;
}

.widget-card--kpi {
  min-height: 164px;
  padding: 20px;
}

.widget-card:hover {
  background: var(--layer-2);
  border-color: var(--border-1);
  box-shadow: none;
}

.widget-card--feature {
  min-height: 420px;
}

.widget-card-head {
  margin-bottom: 14px;
  gap: 14px;
}

.widget-card-meta,
.widget-eyebrow,
.metric-rail-hint {
  color: var(--text-2);
}

.widget-kpi-trend {
  margin-top: 10px;
  color: var(--text-2);
}

.tl-kpi-card,
.rm4-card {
  border-radius: var(--radius-card);
  padding: 20px;
}

.tl-kpi-label,
.rm4-label,
.table-subhead {
  margin-bottom: 8px;
  color: var(--text-2);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.tl-kpi-val,
.rm4-val,
.metric-large {
  font-size: 30px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.tl-kpi-card:hover,
.rm4-card:hover {
  border-color: var(--border-1);
  box-shadow: var(--shadow-elevated);
}

.chart-shell,
.weekly-chart-shell {
  margin-top: 0;
  border-radius: var(--radius-card);
}

.kmfx-chart-shell,
.chart-shell,
.weekly-chart-shell {
  background: var(--chart-plot-bg);
  background-image: none;
  border: 1px solid var(--chart-plot-border);
  box-shadow: var(--shadow-chart-shell);
  border-radius: var(--chart-radius);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.kmfx-chart-shell--kpi {
  min-height: 84px;
}

.kmfx-chart-shell--feature {
  min-height: 228px;
}

.kmfx-chart-shell canvas {
  background: transparent;
}

.kmfx-chart-empty {
  display: grid;
  gap: 6px;
  align-content: center;
  justify-items: start;
  min-height: 164px;
  padding: 20px;
  border-radius: var(--chart-radius);
  border: 1px dashed var(--chart-empty-border);
  background: var(--chart-empty-bg);
}

.kmfx-chart-empty__title {
  color: var(--text-0);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.kmfx-chart-empty__note {
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.45;
  max-width: 42ch;
}

/* Account hero / premium cards */
.account-hero-card {
  background: var(--layer-2);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-card);
  color: var(--text-0);
  border-radius: var(--radius-card);
}

.account-hero-card:hover {
  border-color: var(--border-1);
  box-shadow: var(--shadow-card);
}

.account-hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 30%);
  opacity: 0.35;
  mix-blend-mode: normal;
}

.account-hero-card::after {
  content: none;
}

.account-card-blobs {
  inset: 1px;
}

.account-card-blob {
  filter: blur(44px);
  opacity: 0;
}

.account-card-blob.blob-1 {
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.07), transparent 72%);
}

.account-card-blob.blob-2 {
  background: radial-gradient(ellipse, rgba(186, 186, 186, 0.06), transparent 72%);
}

.account-card-blob.blob-3 {
  background: radial-gradient(ellipse, rgba(96, 96, 96, 0.08), transparent 72%);
}

.account-card-blob.blob-4 {
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.04), transparent 72%);
}

.account-hero-card:not(.active):not(.account-hero-card--main) {
  background: var(--layer-2);
  border-color: var(--border-1);
  box-shadow: var(--shadow-card);
}

.account-hero-card:not(.active):not(.account-hero-card--main) .account-card-blob {
  opacity: 0;
}

.account-hero-card:not(.active):not(.account-hero-card--main) .account-hero-card__name,
.account-hero-card:not(.active):not(.account-hero-card--main) .account-hero-card__equity,
.account-hero-card:not(.active):not(.account-hero-card--main) .account-hero-card__stat-val {
  color: var(--text-0);
}

.account-hero-card:not(.active):not(.account-hero-card--main) .account-hero-card__meta,
.account-hero-card:not(.active):not(.account-hero-card--main) .account-hero-card__equity-label,
.account-hero-card:not(.active):not(.account-hero-card--main) .account-hero-card__stat-label {
  color: var(--text-1);
}

.account-hero-card.active,
.account-hero-card--main {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 34%),
    var(--layer-2);
  border: 0.5px solid var(--border-1);
  box-shadow: none;
  color: #ffffff;
}

.account-hero-card.active::before,
.account-hero-card--main::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 28%),
    radial-gradient(140% 90% at 50% 120%, rgba(255, 255, 255, 0.03), transparent 58%);
  opacity: 0.42;
}

.account-hero-card.active .account-card-blob,
.account-hero-card--main .account-card-blob {
  opacity: 0.18;
}

html .account-hero-card,
html[data-theme="dark"] .account-hero-card,
body[data-theme="dark"] .account-hero-card,
html .account-hero-card:not(.active):not(.account-hero-card--main),
html[data-theme="dark"] .account-hero-card:not(.active):not(.account-hero-card--main),
body[data-theme="dark"] .account-hero-card:not(.active):not(.account-hero-card--main) {
  background: var(--layer-2) !important;
  background-image: none !important;
  border: 1px solid var(--border-1) !important;
  box-shadow: none !important;
}

html .account-hero-card.active,
html .account-hero-card--main,
html[data-theme="dark"] .account-hero-card.active,
html[data-theme="dark"] .account-hero-card--main,
body[data-theme="dark"] .account-hero-card.active,
body[data-theme="dark"] .account-hero-card--main {
  background: #FF453A !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

html .account-hero-card::before,
html .account-hero-card::after,
html[data-theme="dark"] .account-hero-card::before,
html[data-theme="dark"] .account-hero-card::after,
body[data-theme="dark"] .account-hero-card::before,
body[data-theme="dark"] .account-hero-card::after {
  content: none !important;
  background: none !important;
}

html .account-card-blob,
html[data-theme="dark"] .account-card-blob,
body[data-theme="dark"] .account-card-blob,
html .account-hero-card.active .account-card-blob,
html .account-hero-card--main .account-card-blob,
html[data-theme="dark"] .account-hero-card.active .account-card-blob,
html[data-theme="dark"] .account-hero-card--main .account-card-blob,
body[data-theme="dark"] .account-hero-card.active .account-card-blob,
body[data-theme="dark"] .account-hero-card--main .account-card-blob {
  opacity: 0 !important;
  background: none !important;
}

.account-hero-card.active .account-hero-card__name,
.account-hero-card--main .account-hero-card__name,
.account-hero-card.active .account-hero-card__equity,
.account-hero-card--main .account-hero-card__equity,
.account-hero-card.active .account-hero-card__stat-val,
.account-hero-card--main .account-hero-card__stat-val {
  color: #ffffff;
}

.account-hero-card.active .account-hero-card__meta,
.account-hero-card--main .account-hero-card__meta,
.account-hero-card.active .account-hero-card__equity-label,
.account-hero-card--main .account-hero-card__equity-label,
.account-hero-card.active .account-hero-card__stat-label,
.account-hero-card--main .account-hero-card__stat-label {
  color: rgba(255, 255, 255, 0.5);
}

.account-hero-card .status-badge {
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.52);
}

.account-hero-card .status-dot {
  background: rgba(255, 255, 255, 0.24);
}

.account-hero-card .status-dot.connected,
.account-hero-card__stat-val.green {
  color: var(--positive);
  background: var(--positive);
}

/* ── SECTION CARDS ── */
.tl-section-card,
.widget-card,
.chart-card,
.pnlcal-card,
.account-switcher,
.account-banner,
.table-wrap,
.widget-table-wrap,
.rm4-card,
.analytics-bento-card {
  background: var(--layer-1);
  border: 1px solid var(--border-0);
  border-radius: 16px;
  box-shadow: none;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.tl-section-card::before,
.widget-card::before,
.chart-card::before,
.pnlcal-card::before,
.rm4-card::before {
  display: none;
}

/* ── KPI CARDS ── */
.tl-kpi-card {
  background: var(--layer-1);
  border: 1px solid var(--border-0);
  border-radius: 14px;
  box-shadow: none;
  padding: 16px;
}

.tl-kpi-card::before,
.tl-kpi-card::after {
  display: none;
}

/* ── TIPOGRAFÍA BASE ── */
.tl-kpi-label,
.metric-label,
.kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tl-kpi-value,
.metric-value,
.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* ── TÍTULOS DE SECCIÓN ── */
.section-title,
.tl-section-title,
.widget-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.section-subtitle,
.tl-section-subtitle,
.widget-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 16px;
}

/* ── PUNTO AZUL DE TÍTULO ── */
.section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  display: inline-block;
  margin-right: 6px;
  flex-shrink: 0;
}

/* ── COLORES SEMÁNTICOS ── */
.text-positive, .text-green { color: var(--positive); }
.text-negative, .text-red   { color: var(--negative); }
.text-warning               { color: var(--warning);  }
.text-muted                 { color: var(--text-2);   }
.text-secondary             { color: var(--text-1);   }

/* ── BADGES / PILLS ── */
.ui-badge,
.widget-pill,
.pill,
.row-chip,
.calc-chip {
  background: var(--layer-2);
  border: 1px solid var(--border-0);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-1);
  padding: 3px 10px;
}

/* ── INPUTS Y SELECTS ── */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  background: var(--layer-2);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  color: var(--text-0);
  font-size: 15px;
  padding: 10px 14px;
  min-height: 44px;
  width: 100%;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-2);
}

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

/* ── BOTONES ── */
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.btn-primary:hover  { opacity: 0.88; }
.btn-primary:active { transform: scale(0.97); opacity: 0.82; }

.btn-secondary {
  background: var(--layer-2);
  color: var(--text-0);
  border: 1px solid var(--border-1);
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.btn-secondary:hover  { background: var(--layer-3); }
.btn-secondary:active { transform: scale(0.97); }

.btn-destructive {
  background: rgba(255,69,58,0.14);
  color: #ff453a;
  border: none;
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.btn-destructive:active { transform: scale(0.97); }

/* ── TABLAS BASE ── */
.table-wrap table,
.widget-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-0);
  text-align: left;
  background: transparent;
}

td {
  font-size: 13px;
  color: var(--text-0);
  padding: 12px 12px;
  border-bottom: 1px solid var(--border-0);
  background: transparent;
}

tbody tr:hover td {
  background: rgba(255,255,255,0.018);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.20);
}

/* Scroll viewports inside cards follow the shadcn pattern: the card clips,
   the inner content scrolls, and the scrollbar stays inset from the border. */
html[data-theme="dark"] .kmfx-mt5-admin-payload,
body[data-theme="dark"] .kmfx-mt5-admin-payload,
html[data-theme="dark"] .trades-table-wrap,
body[data-theme="dark"] .trades-table-wrap,
html[data-theme="dark"] .trades-history-card .table-wrap,
body[data-theme="dark"] .trades-history-card .table-wrap,
html[data-theme="dark"] .portfolio-table-wrap,
body[data-theme="dark"] .portfolio-table-wrap,
html[data-theme="dark"] .risk-ladder-table,
body[data-theme="dark"] .risk-ladder-table,
html[data-theme="dark"] .calendar-returns-panel .table-wrap,
body[data-theme="dark"] .calendar-returns-panel .table-wrap,
html[data-theme="dark"] .analytics-panel .table-wrap,
body[data-theme="dark"] .analytics-panel .table-wrap,
html[data-theme="dark"] #section-discipline .execution-entry-table,
body[data-theme="dark"] #section-discipline .execution-entry-table,
html[data-theme="dark"] .modal-body--focus-panel,
body[data-theme="dark"] .modal-body--focus-panel,
html[data-theme="dark"] #kmfx-posttrade-modal .ptt-body,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-body {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}

html[data-theme="dark"] .kmfx-mt5-admin-payload::-webkit-scrollbar,
body[data-theme="dark"] .kmfx-mt5-admin-payload::-webkit-scrollbar,
html[data-theme="dark"] .trades-table-wrap::-webkit-scrollbar,
body[data-theme="dark"] .trades-table-wrap::-webkit-scrollbar,
html[data-theme="dark"] .trades-history-card .table-wrap::-webkit-scrollbar,
body[data-theme="dark"] .trades-history-card .table-wrap::-webkit-scrollbar,
html[data-theme="dark"] .portfolio-table-wrap::-webkit-scrollbar,
body[data-theme="dark"] .portfolio-table-wrap::-webkit-scrollbar,
html[data-theme="dark"] .risk-ladder-table::-webkit-scrollbar,
body[data-theme="dark"] .risk-ladder-table::-webkit-scrollbar,
html[data-theme="dark"] .calendar-returns-panel .table-wrap::-webkit-scrollbar,
body[data-theme="dark"] .calendar-returns-panel .table-wrap::-webkit-scrollbar,
html[data-theme="dark"] .analytics-panel .table-wrap::-webkit-scrollbar,
body[data-theme="dark"] .analytics-panel .table-wrap::-webkit-scrollbar,
html[data-theme="dark"] #section-discipline .execution-entry-table::-webkit-scrollbar,
body[data-theme="dark"] #section-discipline .execution-entry-table::-webkit-scrollbar,
html[data-theme="dark"] .modal-body--focus-panel::-webkit-scrollbar,
body[data-theme="dark"] .modal-body--focus-panel::-webkit-scrollbar,
html[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

html[data-theme="dark"] .kmfx-mt5-admin-payload::-webkit-scrollbar-track,
body[data-theme="dark"] .kmfx-mt5-admin-payload::-webkit-scrollbar-track,
html[data-theme="dark"] .trades-table-wrap::-webkit-scrollbar-track,
body[data-theme="dark"] .trades-table-wrap::-webkit-scrollbar-track,
html[data-theme="dark"] .trades-history-card .table-wrap::-webkit-scrollbar-track,
body[data-theme="dark"] .trades-history-card .table-wrap::-webkit-scrollbar-track,
html[data-theme="dark"] .portfolio-table-wrap::-webkit-scrollbar-track,
body[data-theme="dark"] .portfolio-table-wrap::-webkit-scrollbar-track,
html[data-theme="dark"] .risk-ladder-table::-webkit-scrollbar-track,
body[data-theme="dark"] .risk-ladder-table::-webkit-scrollbar-track,
html[data-theme="dark"] .calendar-returns-panel .table-wrap::-webkit-scrollbar-track,
body[data-theme="dark"] .calendar-returns-panel .table-wrap::-webkit-scrollbar-track,
html[data-theme="dark"] .analytics-panel .table-wrap::-webkit-scrollbar-track,
body[data-theme="dark"] .analytics-panel .table-wrap::-webkit-scrollbar-track,
html[data-theme="dark"] #section-discipline .execution-entry-table::-webkit-scrollbar-track,
body[data-theme="dark"] #section-discipline .execution-entry-table::-webkit-scrollbar-track,
html[data-theme="dark"] .modal-body--focus-panel::-webkit-scrollbar-track,
body[data-theme="dark"] .modal-body--focus-panel::-webkit-scrollbar-track,
html[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar-track,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar-track {
  background: transparent;
}

html[data-theme="dark"] .kmfx-mt5-admin-payload::-webkit-scrollbar-thumb,
body[data-theme="dark"] .kmfx-mt5-admin-payload::-webkit-scrollbar-thumb,
html[data-theme="dark"] .trades-table-wrap::-webkit-scrollbar-thumb,
body[data-theme="dark"] .trades-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="dark"] .trades-history-card .table-wrap::-webkit-scrollbar-thumb,
body[data-theme="dark"] .trades-history-card .table-wrap::-webkit-scrollbar-thumb,
html[data-theme="dark"] .portfolio-table-wrap::-webkit-scrollbar-thumb,
body[data-theme="dark"] .portfolio-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="dark"] .risk-ladder-table::-webkit-scrollbar-thumb,
body[data-theme="dark"] .risk-ladder-table::-webkit-scrollbar-thumb,
html[data-theme="dark"] .calendar-returns-panel .table-wrap::-webkit-scrollbar-thumb,
body[data-theme="dark"] .calendar-returns-panel .table-wrap::-webkit-scrollbar-thumb,
html[data-theme="dark"] .analytics-panel .table-wrap::-webkit-scrollbar-thumb,
body[data-theme="dark"] .analytics-panel .table-wrap::-webkit-scrollbar-thumb,
html[data-theme="dark"] #section-discipline .execution-entry-table::-webkit-scrollbar-thumb,
body[data-theme="dark"] #section-discipline .execution-entry-table::-webkit-scrollbar-thumb,
html[data-theme="dark"] .modal-body--focus-panel::-webkit-scrollbar-thumb,
body[data-theme="dark"] .modal-body--focus-panel::-webkit-scrollbar-thumb,
html[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar-thumb,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
}

html[data-theme="dark"] .kmfx-mt5-admin-payload::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .kmfx-mt5-admin-payload::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .trades-table-wrap::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .trades-table-wrap::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .trades-history-card .table-wrap::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .trades-history-card .table-wrap::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .portfolio-table-wrap::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .portfolio-table-wrap::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .risk-ladder-table::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .risk-ladder-table::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .calendar-returns-panel .table-wrap::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .calendar-returns-panel .table-wrap::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .analytics-panel .table-wrap::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .analytics-panel .table-wrap::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] #section-discipline .execution-entry-table::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] #section-discipline .execution-entry-table::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .modal-body--focus-panel::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .modal-body--focus-panel::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.24);
}

/* --------------------------------------------------------------------------
   Capital — Overview and Evolution
-------------------------------------------------------------------------- */

.capital-page {
  display: grid;
  gap: 16px;
}

.capital-page__header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.capital-page .tl-page-title::before,
.capital-section .tl-section-title::before {
  content: none;
  display: none;
}

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

.capital-kpi {
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-height: 118px;
  padding: 15px 16px;
  border: 1px solid var(--border-0);
  border-radius: var(--radius-card);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 2.5%, transparent), transparent 60%),
    var(--card);
  color: var(--foreground);
}

.capital-kpi__label {
  color: var(--muted-foreground);
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.capital-kpi__value {
  color: var(--foreground);
  font-size: clamp(22px, 1.8vw, 30px);
  line-height: 0.98;
  font-weight: 740;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.capital-kpi__value .kmfx-ui-pnl {
  font: inherit;
  letter-spacing: inherit;
}

.capital-kpi__meta {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 520;
}

.capital-kpi[data-tone="info"] .capital-kpi__value {
  color: color-mix(in srgb, var(--equity) 70%, var(--foreground));
}

.capital-kpi[data-tone="profit"] .capital-kpi__value {
  color: var(--profit);
}

.capital-kpi[data-tone="loss"] .capital-kpi__value,
.capital-kpi[data-tone="risk"] .capital-kpi__value {
  color: var(--loss);
}

.capital-kpi[data-tone="warning"] .capital-kpi__value {
  color: var(--risk);
}

.funded-page-stack .tl-page-title::before,
.funded-page-stack .tl-section-title::before {
  content: none;
  display: none;
}

.funded-page-stack .tl-page-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.funding-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  color: var(--foreground);
}

.funding-kpi {
  display: grid;
  align-content: space-between;
  gap: 6px;
  min-height: 98px;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--border-0);
  border-radius: var(--radius-card);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 2.4%, transparent), transparent 60%),
    var(--card);
}

.funding-kpi__label {
  color: var(--muted-foreground);
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.funding-kpi__value {
  overflow: hidden;
  color: var(--foreground);
  font-size: clamp(17px, 1.32vw, 22px);
  line-height: 1.02;
  font-weight: 740;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-kpi__meta {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 11.5px;
  line-height: 1.3;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-kpi[data-tone="info"] .funding-kpi__value {
  color: color-mix(in srgb, var(--equity) 72%, var(--foreground));
}

.funding-kpi[data-tone="profit"] .funding-kpi__value {
  color: var(--profit);
}

.funding-kpi[data-tone="warning"] .funding-kpi__value {
  color: color-mix(in srgb, var(--risk) 78%, var(--foreground));
}

.funding-kpi[data-tone="risk"] .funding-kpi__value {
  color: var(--loss);
}

.funding-kpi--muted .funding-kpi__value {
  color: color-mix(in srgb, var(--foreground) 76%, var(--muted-foreground));
}

.funded-page-stack .funded-mismatch-note {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--risk) 34%, var(--border-0));
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in srgb, var(--risk) 10%, transparent);
  color: var(--foreground);
}

.funded-page-stack .funded-mismatch-note strong {
  color: var(--risk);
  font-size: 12.5px;
  line-height: 1.25;
  font-weight: 740;
}

.funded-page-stack .funded-mismatch-note span {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.35;
}

.funded-page-stack .funded-mismatch-value {
  color: var(--risk);
  font-size: 0.78em;
  line-height: 1.1;
  font-weight: 740;
  letter-spacing: -0.025em;
}

.funding-config-modal {
  gap: 8px;
  grid-template-columns: 1fr;
}

.funding-config-modal {
  display: grid;
}

.funded-page-stack .funded-size-wrap,
.funding-config-modal .funded-size-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-1);
  border-radius: var(--control-radius);
  background: var(--layer-2);
  color: var(--text-0);
}

.funded-page-stack .funded-size-wrap:focus-within,
.funding-config-modal .funded-size-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

.funding-config-modal .form-stack select,
.funded-page-stack .funded-size-input {
  min-height: 38px;
  padding-top: 9px;
  padding-bottom: 9px;
  font-size: 13px;
}

.funded-page-stack .funded-size-input,
.funding-config-modal .funded-size-input {
  width: 100%;
  min-width: 0;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}

.funded-page-stack .funded-size-input:focus,
.funding-config-modal .funded-size-input:focus {
  border: 0;
  box-shadow: none;
  outline: none;
}

.funded-page-stack .funded-size-prefix,
.funding-config-modal .funded-size-prefix {
  position: static;
  min-width: max-content;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 680;
}

.funded-page-stack .funded-preset-note,
.funding-config-modal .funded-preset-note {
  font-size: 11px;
  line-height: 1.3;
}

.funded-page-stack .funded-detail-btn {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 12.5px;
}

.funding-section-head,
.funding-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.funding-accounts-panel,
.funding-detail-panel,
.funding-review-panel {
  display: grid;
  gap: 12px;
}

.funding-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}

.funding-challenge-card {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--border-0) 72%, transparent);
  border-radius: calc(var(--radius) + 10px);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 3.5%, transparent), transparent 48%),
    color-mix(in srgb, var(--foreground) 1.4%, transparent);
  color: var(--foreground);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.funding-challenge-card:hover {
  border-color: color-mix(in srgb, var(--equity) 28%, var(--border-0));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--equity) 8%, transparent), transparent 52%),
    color-mix(in srgb, var(--foreground) 2.2%, transparent);
  transform: translateY(-1px);
}

.funding-challenge-card.is-active {
  border-color: color-mix(in srgb, var(--equity) 52%, var(--border-0));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--equity) 16%, transparent);
}

.funding-challenge-card[data-tone="warning"].is-active {
  border-color: color-mix(in srgb, var(--risk) 28%, var(--border-0));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--risk) 10%, transparent);
}

.funding-challenge-card[data-tone="risk"].is-active {
  border-color: color-mix(in srgb, var(--loss) 46%, var(--border-0));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--loss) 18%, transparent);
}

.funding-challenge-card.is-secondary {
  opacity: 0.64;
  border-color: color-mix(in srgb, var(--border-0) 48%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 1.4%, transparent), transparent 52%),
    color-mix(in srgb, var(--foreground) 0.5%, transparent);
}

.funding-challenge-card.is-secondary.is-active {
  opacity: 0.82;
}

.funding-challenge-card.is-secondary .funding-card-summary,
.funding-challenge-card.is-secondary .funding-card-gauges {
  opacity: 0.78;
}

.funding-challenge-card__head,
.funding-challenge-card__snapshot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.funding-challenge-card__identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.funding-challenge-card__identity strong {
  overflow: hidden;
  color: var(--foreground);
  font-size: clamp(16.5px, 1.08vw, 19px);
  line-height: 1.08;
  font-weight: 760;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-challenge-card__identity small {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-challenge-card__identity em {
  overflow: hidden;
  color: color-mix(in srgb, var(--muted-foreground) 78%, transparent);
  font-size: 11px;
  line-height: 1.25;
  font-style: normal;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-card-summary {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.funding-card-summary > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.funding-card-summary strong {
  flex: 0 0 auto;
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 660;
}

.funding-card-summary em {
  min-width: 0;
  overflow: hidden;
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.2;
  font-style: normal;
  font-weight: 710;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-card-summary [data-tone="risk"] em {
  color: var(--loss);
}

.funding-card-summary [data-tone="warning"] em {
  color: var(--risk);
}

.funding-card-summary [data-tone="profit"] em {
  color: var(--profit);
}

.funding-card-badges {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 118px;
}

.funding-challenge-card__meta,
.funding-challenge-card__snapshot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.funding-challenge-card__snapshot {
  align-items: stretch;
}

.funding-challenge-card__meta > span,
.funding-challenge-card__snapshot > span {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--border-0) 48%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--background) 46%, transparent);
}

.funding-challenge-card__meta small,
.funding-challenge-card__snapshot small {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.funding-challenge-card__meta strong,
.funding-challenge-card__snapshot strong {
  overflow: hidden;
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.18;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 24px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--border-0) 70%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--foreground) 2.6%, transparent);
  color: var(--muted-foreground);
  font-size: 10.5px;
  line-height: 1;
  font-weight: 720;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.funding-status-chip span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.funding-status-chip__dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--muted-foreground);
}

.funding-status-chip[data-tone="profit"] {
  border-color: color-mix(in srgb, var(--profit) 26%, var(--border-0));
  color: var(--profit);
}

.funding-status-chip[data-tone="profit"] .funding-status-chip__dot {
  background: var(--profit);
}

.funding-status-chip[data-tone="warning"] {
  border-color: color-mix(in srgb, var(--risk) 22%, var(--border-0));
  color: color-mix(in srgb, var(--risk) 78%, var(--foreground));
  background: color-mix(in srgb, var(--risk) 5%, transparent);
}

.funding-status-chip[data-tone="warning"] .funding-status-chip__dot {
  background: color-mix(in srgb, var(--risk) 78%, var(--foreground));
}

.funding-status-chip[data-tone="info"] {
  border-color: color-mix(in srgb, var(--equity) 24%, var(--border-0));
  color: color-mix(in srgb, var(--equity) 78%, var(--foreground));
  background: color-mix(in srgb, var(--equity) 5%, transparent);
}

.funding-status-chip[data-tone="info"] .funding-status-chip__dot {
  background: color-mix(in srgb, var(--equity) 78%, var(--foreground));
}

.funding-status-chip[data-tone="risk"] {
  border-color: color-mix(in srgb, var(--loss) 30%, var(--border-0));
  color: var(--loss);
}

.funding-status-chip[data-tone="risk"] .funding-status-chip__dot {
  background: var(--loss);
}

.funding-bar__rail {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--foreground) 8%, transparent);
}

.funding-bar__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: color-mix(in srgb, var(--muted-foreground) 58%, transparent);
}

.funding-gauge[data-tone="profit"] .funding-bar__fill {
  background: var(--profit);
}

.funding-gauge[data-tone="warning"] .funding-bar__fill {
  background: color-mix(in srgb, var(--risk) 78%, var(--foreground));
}

.funding-gauge[data-tone="risk"] .funding-bar__fill {
  background: var(--loss);
}

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

.funding-gauge {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--border-0) 38%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--foreground) 1.1%, transparent);
}

.funding-gauge__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.funding-gauge__head span,
.funding-gauge__meta {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-gauge__head strong {
  flex: 0 0 auto;
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.15;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.funding-card-summary .kmfx-ui-pnl,
.funding-state-row .kmfx-ui-pnl {
  font: inherit;
  letter-spacing: inherit;
}

.funding-rule-chip {
  align-self: end;
  justify-self: end;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--border-0) 70%, transparent);
  border-radius: 999px;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1;
  font-weight: 720;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-rule-chip[data-tone="profit"] {
  border-color: color-mix(in srgb, var(--profit) 22%, var(--border-0));
  color: var(--profit);
}

.funding-rule-chip[data-tone="warning"] {
  border-color: color-mix(in srgb, var(--risk) 20%, var(--border-0));
  background: color-mix(in srgb, var(--risk) 4%, transparent);
  color: color-mix(in srgb, var(--risk) 76%, var(--foreground));
}

.funding-rule-chip[data-tone="info"] {
  border-color: color-mix(in srgb, var(--equity) 22%, var(--border-0));
  background: color-mix(in srgb, var(--equity) 5%, transparent);
  color: color-mix(in srgb, var(--equity) 78%, var(--foreground));
}

.funding-challenge-card__snapshot .kmfx-ui-pnl {
  font: inherit;
  letter-spacing: inherit;
}

.funding-detail-panel {
  border-color: color-mix(in srgb, var(--border-0) 72%, transparent);
  gap: 11px;
}

.funding-detail-panel[data-tone="warning"] {
  border-color: color-mix(in srgb, var(--risk) 20%, var(--border-0));
}

.funding-detail-panel[data-tone="risk"] {
  border-color: color-mix(in srgb, var(--loss) 30%, var(--border-0));
}

.funding-detail-title {
  margin-top: 3px;
  color: var(--foreground);
  font-size: clamp(15.5px, 1vw, 18px);
  line-height: 1.18;
  font-weight: 720;
  letter-spacing: -0.018em;
  overflow-wrap: anywhere;
}

.funding-detail-sub {
  margin-top: 3px;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 560;
}

.funding-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.funding-edit-config-btn {
  border-color: color-mix(in srgb, var(--equity) 34%, var(--border-1));
  color: color-mix(in srgb, var(--equity) 78%, var(--foreground));
}

.funding-reading-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.funding-rule-card,
.funding-state-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--border-0) 46%, transparent);
  border-radius: calc(var(--radius) + 6px);
  background: color-mix(in srgb, var(--foreground) 1.15%, transparent);
}

.funding-rule-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.funding-rule-card__head strong {
  overflow: hidden;
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 740;
  letter-spacing: -0.018em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-rule-card__head span {
  flex: 0 1 auto;
  overflow: hidden;
  max-width: 52%;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--border-0) 65%, transparent);
  border-radius: 999px;
  color: var(--muted-foreground);
  font-size: 10.5px;
  line-height: 1;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-rule-card__head span[data-tone="risk"] {
  border-color: color-mix(in srgb, var(--loss) 30%, var(--border-0));
  color: var(--loss);
}

.funding-rule-card__head span[data-tone="warning"] {
  border-color: color-mix(in srgb, var(--risk) 20%, var(--border-0));
  background: color-mix(in srgb, var(--risk) 4%, transparent);
  color: color-mix(in srgb, var(--risk) 76%, var(--foreground));
}

.funding-rule-card__head span[data-tone="profit"] {
  border-color: color-mix(in srgb, var(--profit) 26%, var(--border-0));
  color: var(--profit);
}

.funding-rule-card__head span[data-tone="info"] {
  border-color: color-mix(in srgb, var(--equity) 24%, var(--border-0));
  background: color-mix(in srgb, var(--equity) 5%, transparent);
  color: color-mix(in srgb, var(--equity) 78%, var(--foreground));
}

.funding-rule-list {
  display: grid;
  gap: 0;
  border-top: 1px solid color-mix(in srgb, var(--border-0) 36%, transparent);
}

.funding-rule-row,
.funding-state-row {
  display: grid;
  grid-template-columns: minmax(112px, 0.82fr) minmax(0, 0.78fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding: 6px 0;
}

.funding-rule-row + .funding-rule-row,
.funding-state-row + .funding-state-row {
  border-top: 1px solid color-mix(in srgb, var(--border-0) 40%, transparent);
}

.funding-rule-row small,
.funding-state-row small {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-rule-row strong,
.funding-state-row strong {
  overflow: hidden;
  color: var(--foreground);
  font-size: 12.5px;
  line-height: 1.2;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-rule-row em,
.funding-state-row em {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.25;
  font-style: normal;
  font-weight: 540;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-rule-row[data-tone="warning"] strong,
.funding-state-row[data-tone="warning"] strong {
  color: color-mix(in srgb, var(--risk) 78%, var(--foreground));
}

.funding-rule-row[data-tone="info"] strong,
.funding-state-row[data-tone="info"] strong {
  color: color-mix(in srgb, var(--equity) 78%, var(--foreground));
}

.funding-state-row[data-tone="risk"] strong {
  color: var(--loss);
}

.funding-state-row[data-tone="profit"] strong {
  color: var(--profit);
}

.funding-detail-block {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--border-0) 64%, transparent);
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in srgb, var(--foreground) 2.1%, transparent);
}

.funding-detail-kicker {
  color: var(--muted-foreground);
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.funding-rule-note-line {
  color: var(--muted-foreground);
  font-size: 11.5px;
  line-height: 1.35;
  font-weight: 540;
}

.funding-economics-panel {
  display: grid;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--border-0) 44%, transparent);
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in srgb, var(--foreground) 0.9%, transparent);
}

.funding-economics-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.funding-economics-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.funding-economics-metrics > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--border-0) 36%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--background) 42%, transparent);
}

.funding-economics-metrics span {
  color: var(--muted-foreground);
  font-size: 9.5px;
  line-height: 1.2;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.funding-economics-metrics strong {
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.15;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.funding-economics-metrics .kmfx-ui-pnl {
  font: inherit;
  letter-spacing: inherit;
}

.funding-economics-empty,
.funding-economics-note {
  color: var(--muted-foreground);
  font-size: 11.5px;
  line-height: 1.35;
  font-weight: 540;
}

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

.funding-ledger-form textarea {
  min-height: 82px;
  resize: vertical;
}

.funding-review-list {
  display: grid;
  gap: 0;
  border-top: 1px solid color-mix(in srgb, var(--border-0) 40%, transparent);
}

.funding-review-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 0;
}

.funding-review-row + .funding-review-row {
  border-top: 1px solid color-mix(in srgb, var(--border-0) 42%, transparent);
}

.funding-review-row__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--muted-foreground);
}

.funding-review-row[data-tone="error"] .funding-review-row__dot {
  background: var(--loss);
}

.funding-review-row[data-tone="warn"] .funding-review-row__dot {
  background: var(--risk);
}

.funding-review-row[data-tone="ok"] .funding-review-row__dot {
  background: var(--profit);
}

.funding-review-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.funding-review-row strong {
  color: var(--foreground);
  font-size: 12.5px;
  line-height: 1.25;
  font-weight: 710;
}

.funding-review-row span:not(.funding-review-row__dot) {
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.32;
  font-weight: 520;
}

.funding-review-more {
  padding: 5px 17px 0;
  color: var(--muted-foreground);
  font-size: 11.5px;
  line-height: 1.25;
  font-weight: 620;
}

@media (max-width: 1280px) {
  .funding-economics-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .funding-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .funding-reading-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .funding-overview {
    grid-template-columns: 1fr;
  }

  .funding-kpi {
    min-height: 92px;
  }

  .funding-challenge-card__meta,
  .funding-card-gauges {
    grid-template-columns: 1fr;
  }

  .funding-challenge-card__head,
  .funding-challenge-card__snapshot {
    grid-template-columns: 1fr;
    display: grid;
  }

  .funding-rule-chip {
    justify-self: start;
  }

  .funding-card-badges {
    justify-content: flex-start;
    min-width: 0;
  }

  .funding-detail-header,
  .funding-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .funding-detail-actions {
    justify-content: flex-start;
  }

  .funding-economics-head {
    flex-direction: column;
  }

  .funding-rule-row,
  .funding-state-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .funding-rule-row em,
  .funding-state-row em {
    text-align: left;
  }

  .funding-economics-metrics {
    grid-template-columns: 1fr;
  }
}

.tools-page-stack {
  display: grid;
  gap: 18px;
}

.tools-hub-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.tools-card {
  display: grid;
  align-content: space-between;
  gap: 9px;
  min-height: 118px;
  min-width: 0;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--border-0) 62%, transparent);
  border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 2.2%, transparent), transparent 62%),
    color-mix(in srgb, var(--foreground) 0.9%, transparent);
}

.tools-card.is-active {
  border-color: color-mix(in srgb, var(--equity) 34%, var(--border-0));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--equity) 7%, transparent), transparent 64%),
    color-mix(in srgb, var(--foreground) 1.4%, transparent);
}

.tools-card.is-included {
  border-color: color-mix(in srgb, var(--border-0) 72%, transparent);
  background: color-mix(in srgb, var(--foreground) 0.8%, transparent);
}

.tools-card.is-disabled {
  opacity: 0.48;
}

.tools-card__top {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.tools-card strong {
  overflow: hidden;
  color: var(--foreground);
  font-size: 13.5px;
  line-height: 1.15;
  font-weight: 740;
  letter-spacing: -0.018em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tools-card span:not(.ui-badge) {
  color: var(--muted-foreground);
  font-size: 11.5px;
  line-height: 1.35;
  font-weight: 520;
}

.calculator-active-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 14px;
  align-items: stretch;
}

.calculator-workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.calculator-result-card,
.calculator-advice-card,
.calculator-config-card,
.calculator-spec-card {
  display: grid;
  gap: 14px;
}

.calculator-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.calculator-primary-result {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--equity) 20%, var(--border-0));
  border-radius: calc(var(--radius) + 8px);
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--equity) 10%, transparent), transparent 34%),
    color-mix(in srgb, var(--foreground) 1.4%, transparent);
}

.calculator-primary-result span,
.calculator-advice-primary span,
.calculator-metric span {
  color: var(--muted-foreground);
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.calculator-primary-result strong {
  color: var(--foreground);
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 0.92;
  font-weight: 780;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}

.calculator-primary-result small,
.calculator-metric small,
.calculator-advice-copy small {
  color: var(--muted-foreground);
  font-size: 11.5px;
  line-height: 1.35;
  font-weight: 540;
}

.calculator-metric-grid,
.calculator-spec-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

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

.calculator-metric {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--border-0) 44%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--foreground) 1%, transparent);
}

.calculator-metric strong {
  overflow: hidden;
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.1;
  font-weight: 760;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-exposure-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.calculator-exposure-strip > span,
.calculator-exposure-strip strong {
  color: var(--muted-foreground);
  font-size: 11.5px;
  line-height: 1.2;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.calculator-advice-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.38fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.calculator-advice-primary,
.calculator-advice-empty {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--border-0) 42%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--foreground) 1%, transparent);
}

.calculator-advice-primary strong {
  color: var(--foreground);
  font-size: 28px;
  line-height: 0.95;
  font-weight: 760;
  letter-spacing: -0.045em;
}

.calculator-advice-copy {
  display: grid;
  gap: 6px;
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.42;
  font-weight: 560;
}

.calculator-advice-empty strong {
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 720;
}

.calculator-advice-empty span {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 540;
}

.calculator-form-grid {
  gap: 12px;
}

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

.calculator-config-card .form-stack small,
.calculator-spec-card .form-stack small,
.calculator-spec-note {
  color: var(--muted-foreground);
  font-size: 11.5px;
  line-height: 1.35;
  font-weight: 540;
}

.calculator-mode-field {
  align-content: start;
}

.calculator-price-fields {
  display: none;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.calculator-price-fields.is-visible {
  display: grid;
}

.calculator-spec-note {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border-0) 44%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--foreground) 1%, transparent);
}

.calculator-advice-action {
  justify-self: start;
  min-height: 34px;
  padding: 8px 12px;
  font-size: 12px;
}

.calculator-spec-card input[readonly],
.calculator-config-card input[readonly] {
  color: var(--muted-foreground);
  cursor: default;
}

@media (max-width: 1320px) {
  .tools-hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .calculator-active-shell,
  .calculator-workbench-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .tools-hub-grid,
  .calculator-metric-grid,
  .calculator-spec-list,
  .calculator-advice-grid,
  .calculator-form-grid,
  .calculator-spec-form,
  .calculator-price-fields {
    grid-template-columns: 1fr;
  }

  .calculator-result-head,
  .calculator-exposure-strip {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }
}

.capital-data-note,
.capital-cashflow-notice {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in srgb, var(--foreground) 2.4%, transparent);
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.35;
}

.capital-data-note {
  padding: 0;
  border: 0;
  background: transparent;
}

.capital-data-note strong {
  color: var(--foreground);
  font-weight: 650;
}

.capital-cashflow-notice {
  justify-self: start;
  max-width: max-content;
  padding: 7px 10px;
  font-size: 11.5px;
}

.capital-evolution-card,
.capital-section {
  border: 1px solid var(--border-0);
  border-radius: var(--radius-card);
  background: var(--card);
}

.capital-section {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.capital-evolution-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.capital-section__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.capital-section__eyebrow {
  color: var(--muted-foreground);
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 680;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.capital-section__title {
  margin: 3px 0 0;
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 730;
  letter-spacing: -0.02em;
}

.capital-section__description,
.capital-section__footnote {
  margin: 4px 0 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.35;
}

.capital-section__pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  color: var(--muted-foreground);
  background: color-mix(in srgb, var(--foreground) 3%, transparent);
  font-size: 10.5px;
  line-height: 1;
  font-weight: 640;
  white-space: nowrap;
}

.capital-evolution-card__summary {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 560;
}

.capital-evolution-card__summary .kmfx-ui-pnl {
  font-size: 18px;
  line-height: 1;
  font-weight: 740;
  letter-spacing: -0.025em;
}

.capital-evolution-card__chart .kmfx-chart-shell,
.capital-evolution-chart {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.capital-evolution-empty {
  display: grid;
  gap: 5px;
  min-height: 132px;
  align-content: center;
  justify-items: center;
  border: 1px dashed color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: calc(var(--radius) + 4px);
  color: var(--muted-foreground);
  text-align: center;
}

.capital-evolution-empty strong {
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.2;
}

.capital-evolution-empty span {
  max-width: 42ch;
  font-size: 12px;
  line-height: 1.35;
}

.capital-account-grid {
  margin-top: 0;
}

.capital-account-card {
  width: 100%;
  display: grid;
  gap: 14px;
  min-height: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: calc(var(--radius-card) - 4px);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 2%, transparent), transparent 68%),
    color-mix(in srgb, var(--card) 92%, var(--background));
  color: var(--foreground);
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.capital-account-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--equity) 28%, var(--border));
}

.capital-account-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--equity) 58%, transparent);
  outline-offset: 3px;
}

.capital-account-card.is-current {
  border-color: color-mix(in srgb, var(--equity) 34%, var(--border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--equity) 8%, transparent), transparent 72%),
    color-mix(in srgb, var(--card) 92%, var(--background));
}

.capital-account-card__identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 158px);
  gap: 12px;
  align-items: start;
}

.capital-account-card__identity > div:first-child {
  min-width: 0;
}

.capital-account-card__name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 720;
  letter-spacing: -0.015em;
  word-break: break-word;
}

.capital-account-card__meta {
  display: block;
  margin-top: 4px;
  color: var(--muted-foreground);
  font-size: 11.5px;
  line-height: 1.35;
}

.capital-account-card__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-self: start;
  align-content: flex-start;
  gap: 6px;
  width: 100%;
}

.capital-account-card__chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--border) 68%, transparent);
  border-radius: 999px;
  color: var(--muted-foreground);
  background: color-mix(in srgb, var(--foreground) 3%, transparent);
  font-size: 10px;
  line-height: 1;
  font-weight: 690;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.capital-account-card__chip[data-tone="connected"] {
  color: color-mix(in srgb, var(--profit) 78%, var(--foreground));
  background: color-mix(in srgb, var(--profit) 9%, transparent);
  border-color: color-mix(in srgb, var(--profit) 24%, transparent);
}

.capital-account-card__chip[data-tone="warning"] {
  color: color-mix(in srgb, var(--risk) 82%, var(--foreground));
  background: color-mix(in srgb, var(--risk) 10%, transparent);
  border-color: color-mix(in srgb, var(--risk) 26%, transparent);
}

.capital-account-card__chip[data-tone="info"] {
  color: color-mix(in srgb, var(--equity) 76%, var(--foreground));
  background: color-mix(in srgb, var(--equity) 9%, transparent);
  border-color: color-mix(in srgb, var(--equity) 24%, transparent);
}

.capital-account-card__chip[data-tone="muted"] {
  color: color-mix(in srgb, var(--muted-foreground) 86%, var(--foreground));
}

.capital-account-card__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--border) 64%, transparent);
}

.capital-account-card__metric {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.capital-account-card__metric span {
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 680;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.capital-account-card__metric strong {
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.18;
  font-weight: 720;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.capital-account-card__metric .kmfx-ui-pnl {
  font: inherit;
  letter-spacing: inherit;
}

.capital-exposure-table {
  width: 100%;
  overflow-x: auto;
}

.capital-exposure-table table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.capital-exposure-table th,
.capital-exposure-table td {
  padding: 11px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
}

.capital-exposure-table th:first-child,
.capital-exposure-table td:first-child {
  padding-left: 0;
}

.capital-exposure-table th:last-child,
.capital-exposure-table td:last-child {
  padding-right: 0;
}

.capital-exposure-table tr:last-child td {
  border-bottom: 0;
}

.capital-table-empty {
  color: var(--muted-foreground);
  text-align: center;
}

@media (max-width: 1280px) {
  .capital-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .capital-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capital-section__header,
  .capital-data-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .capital-evolution-card__summary {
    justify-items: start;
  }

  .capital-account-card__identity {
    grid-template-columns: 1fr;
  }

  .capital-account-card__chips {
    justify-content: flex-start;
    max-width: none;
  }

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

@media (max-width: 520px) {
  .capital-overview {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] .tl-kpi-card,
html[data-theme="dark"] .rm4-card,
html[data-theme="dark"] .tl-section-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .pnlcal-card,
html[data-theme="dark"] .widget-card,
html[data-theme="dark"] .account-switcher,
html[data-theme="dark"] .account-banner,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .widget-table-wrap,
html[data-theme="dark"] .kmfx-chart-shell,
html[data-theme="dark"] .tl-kpi-card,
html[data-theme="dark"] .rm4-card {
  background: #111111 !important;
  border: 1px solid rgba(255,255,255,0.05) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .tl-kpi-card::before,
html[data-theme="dark"] .tl-kpi-card::after,
html[data-theme="dark"] .tl-section-card::before,
html[data-theme="dark"] .tl-section-card::after,
html[data-theme="dark"] .widget-card::before,
html[data-theme="dark"] .widget-card::after,
html[data-theme="dark"] .chart-card::before,
html[data-theme="dark"] .chart-card::after,
html[data-theme="dark"] .pnlcal-card::before,
html[data-theme="dark"] .pnlcal-card::after,
html[data-theme="dark"] .rm4-card::before,
html[data-theme="dark"] .rm4-card::after {
  display: none !important;
}

html[data-theme="dark"] .main-panel,
html[data-theme="dark"] .content,
body[data-theme="dark"] .main-panel,
body[data-theme="dark"] .content,
[data-theme="dark"] .main-panel,
[data-theme="dark"] .content {
  background: #0a0a0a !important;
  box-shadow: none !important;
}

html .sidebar,
html[data-theme="dark"] .sidebar,
html:not([data-theme="dark"]) .sidebar,
body[data-theme="dark"] .sidebar {
  background: #0a0a0a !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-right: 1px solid rgba(255,255,255,0.06) !important;
  box-shadow: none !important;
}

html .topbar,
html[data-theme="dark"] .topbar {
  background: #0a0a0a !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  box-shadow: none !important;
}

html .main-panel,
html[data-theme="dark"] .main-panel,
body[data-theme="dark"] .main-panel,
[data-theme="dark"] .main-panel,
html .content,
html[data-theme="dark"] .content,
body[data-theme="dark"] .content,
[data-theme="dark"] .content,
html body,
html[data-theme="dark"] body {
  background: #0a0a0a !important;
  background-image: none !important;
}

/* Shell base continuity override */
:root {
  --layer-0: #0a0a0a !important;
  --layer-1: #111111 !important;
  --layer-2: #1a1a1a !important;
  --border-0: rgba(255,255,255,0.08) !important;
}

html,
html[data-theme="dark"],
body,
html[data-theme="dark"] body,
body[data-theme="dark"],
.app-shell,
html[data-theme="dark"] .app-shell,
body[data-theme="dark"] .app-shell,
.sidebar,
html[data-theme="dark"] .sidebar,
body[data-theme="dark"] .sidebar,
.topbar,
html[data-theme="dark"] .topbar,
body[data-theme="dark"] .topbar,
.main-panel,
html[data-theme="dark"] .main-panel,
body[data-theme="dark"] .main-panel,
[data-theme="dark"] .main-panel,
.content,
html[data-theme="dark"] .content,
body[data-theme="dark"] .content,
[data-theme="dark"] .content {
  background: var(--layer-0) !important;
  background-color: var(--layer-0) !important;
  background-image: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.sidebar,
html[data-theme="dark"] .sidebar,
body[data-theme="dark"] .sidebar,
.topbar,
html[data-theme="dark"] .topbar,
body[data-theme="dark"] .topbar,
.main-panel,
html[data-theme="dark"] .main-panel,
body[data-theme="dark"] .main-panel,
[data-theme="dark"] .main-panel,
.content,
html[data-theme="dark"] .content,
body[data-theme="dark"] .content,
[data-theme="dark"] .content {
  border: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  border-radius: 0 !important;
}

body::before,
body::after,
html body::before,
html body::after,
.app-shell::before,
.app-shell::after,
.sidebar::before,
.sidebar::after,
.topbar::before,
.topbar::after,
.main-panel::before,
.main-panel::after,
.content::before,
.content::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

/* Shell continuity override — dark only */
html[data-theme="dark"] .app-shell,
body[data-theme="dark"] .app-shell,
html[data-theme="dark"] .sidebar,
body[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar,
body[data-theme="dark"] .topbar,
html[data-theme="dark"] .main-panel,
body[data-theme="dark"] .main-panel,
[data-theme="dark"] .main-panel {
  background: #0a0a0a !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .sidebar,
body[data-theme="dark"] .sidebar {
  border-right: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .topbar,
body[data-theme="dark"] .topbar {
  border-bottom: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .main-panel,
body[data-theme="dark"] .main-panel,
[data-theme="dark"] .main-panel {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .sidebar::before,
html[data-theme="dark"] .sidebar::after,
body[data-theme="dark"] .sidebar::before,
body[data-theme="dark"] .sidebar::after,
html[data-theme="dark"] .topbar::before,
html[data-theme="dark"] .topbar::after,
body[data-theme="dark"] .topbar::before,
body[data-theme="dark"] .topbar::after,
html[data-theme="dark"] .main-panel::before,
html[data-theme="dark"] .main-panel::after,
body[data-theme="dark"] .main-panel::before,
body[data-theme="dark"] .main-panel::after {
  content: none !important;
  display: none !important;
}

/* Shell continuity override — content alignment */
html[data-theme="dark"] .content,
body[data-theme="dark"] .content,
[data-theme="dark"] .content {
  background: #0a0a0a !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .content::before,
html[data-theme="dark"] .content::after,
body[data-theme="dark"] .content::before,
body[data-theme="dark"] .content::after {
  content: none !important;
  display: none !important;
}

/* Sidebar flattening override — dark only */
html[data-theme="dark"] .sidebar,
body[data-theme="dark"] .sidebar {
  background: #0a0a0a !important;
  border-right: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .sidebar::before,
html[data-theme="dark"] .sidebar::after,
body[data-theme="dark"] .sidebar::before,
body[data-theme="dark"] .sidebar::after {
  content: none !important;
  display: none !important;
}

html[data-theme="dark"] .risk-page-stack,
body[data-theme="dark"] .risk-page-stack {
  display: grid;
  gap: 14px;
}

html[data-theme="dark"] .risk-data-state,
body[data-theme="dark"] .risk-data-state {
  display: grid;
  gap: 6px;
  padding: 16px 18px !important;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: color-mix(in srgb, var(--card-surface) 92%, rgba(255, 255, 255, 0.02));
}

html[data-theme="dark"] .risk-data-state__eyebrow,
body[data-theme="dark"] .risk-data-state__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-data-state strong,
body[data-theme="dark"] .risk-data-state strong {
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

html[data-theme="dark"] .risk-data-state p,
body[data-theme="dark"] .risk-data-state p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-1);
}

html[data-theme="dark"] .risk-data-state small,
body[data-theme="dark"] .risk-data-state small {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-data-state--error,
body[data-theme="dark"] .risk-data-state--error {
  border-color: rgba(255, 69, 58, 0.18);
}

html[data-theme="dark"] .risk-data-state--warning,
body[data-theme="dark"] .risk-data-state--warning,
html[data-theme="dark"] .risk-data-state--loading,
body[data-theme="dark"] .risk-data-state--loading {
  border-color: rgba(255, 159, 10, 0.15);
}

html[data-theme="dark"] .risk-ladder-empty,
body[data-theme="dark"] .risk-ladder-empty {
  padding: 14px 0 4px;
  font-size: 13px;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-command-center,
body[data-theme="dark"] .risk-command-center {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 14px;
  align-items: start;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.012)),
    var(--card-surface);
}

html[data-theme="dark"] .risk-command-center--ok,
body[data-theme="dark"] .risk-command-center--ok {
  background:
    radial-gradient(circle at top right, rgba(48, 110, 82, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.012)),
    var(--card-surface);
}

html[data-theme="dark"] .risk-command-center--warn,
body[data-theme="dark"] .risk-command-center--warn {
  background:
    radial-gradient(circle at top right, rgba(255, 159, 10, 0.10), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.012)),
    var(--card-surface);
}

html[data-theme="dark"] .risk-command-center--danger,
body[data-theme="dark"] .risk-command-center--danger {
  background:
    radial-gradient(circle at top right, rgba(154, 46, 60, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.012)),
    var(--card-surface);
}

html[data-theme="dark"] .risk-command-center__copy,
body[data-theme="dark"] .risk-command-center__copy {
  display: grid;
  gap: 6px;
}

html[data-theme="dark"] .risk-command-center__ops,
body[data-theme="dark"] .risk-command-center__ops {
  display: grid;
  gap: 7px;
  margin-top: 4px;
}

html[data-theme="dark"] .risk-command-center__op-row,
body[data-theme="dark"] .risk-command-center__op-row {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.014);
  border: 1px solid rgba(255,255,255,0.035);
}

html[data-theme="dark"] .risk-command-center__op-row span,
body[data-theme="dark"] .risk-command-center__op-row span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-command-center__op-row strong,
body[data-theme="dark"] .risk-command-center__op-row strong {
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--text-0);
}

html[data-theme="dark"] .risk-command-center__op-row small,
body[data-theme="dark"] .risk-command-center__op-row small {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-command-center__op-row--action,
body[data-theme="dark"] .risk-command-center__op-row--action {
  background: color-mix(in srgb, var(--layer-1-subtle) 88%, rgba(255, 159, 10, 0.065));
  border-color: rgba(255, 159, 10, 0.13);
  box-shadow: inset 0 0 0 1px rgba(255, 159, 10, 0.06);
}

html[data-theme="dark"] .risk-command-center__op-row--action strong,
body[data-theme="dark"] .risk-command-center__op-row--action strong {
  font-size: 18px;
}

html[data-theme="dark"] .risk-command-center__copy h3,
body[data-theme="dark"] .risk-command-center__copy h3 {
  margin: 0;
  font-size: 28px;
  line-height: 0.98;
  letter-spacing: -0.045em;
  color: var(--text-0);
}

html[data-theme="dark"] .risk-command-center__copy p,
body[data-theme="dark"] .risk-command-center__copy p {
  margin: 0;
  max-width: 58ch;
  font-size: 13px;
  line-height: 1.42;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-command-center__meta,
body[data-theme="dark"] .risk-command-center__meta {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 244px;
}

html[data-theme="dark"] .risk-command-center__metric,
body[data-theme="dark"] .risk-command-center__metric {
  display: grid;
  gap: 4px;
  padding: 14px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.045);
  min-height: 100%;
}

html[data-theme="dark"] .risk-command-center__metric span,
body[data-theme="dark"] .risk-command-center__metric span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-command-center__metric strong,
body[data-theme="dark"] .risk-command-center__metric strong {
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text-0);
}

html[data-theme="dark"] .risk-command-center__metric small,
body[data-theme="dark"] .risk-command-center__metric small {
  font-size: 11px;
  line-height: 1.38;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-active-rules,
body[data-theme="dark"] .risk-active-rules {
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] .risk-active-rules__context,
body[data-theme="dark"] .risk-active-rules__context {
  padding: 0 2px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-active-rules__grid,
body[data-theme="dark"] .risk-active-rules__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

html[data-theme="dark"] .risk-rule-card,
body[data-theme="dark"] .risk-rule-card {
  display: grid;
  gap: 8px;
  padding: 12px 12px 11px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--layer-1-subtle) 95%, rgba(255,255,255,0.014));
  border: 1px solid rgba(255,255,255,0.045);
}

html[data-theme="dark"] .risk-rule-card__head,
body[data-theme="dark"] .risk-rule-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

html[data-theme="dark"] .risk-rule-card__head span,
body[data-theme="dark"] .risk-rule-card__head span {
  display: inline-flex;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
}

html[data-theme="dark"] .risk-rule-card__head small,
body[data-theme="dark"] .risk-rule-card__head small {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-3);
}

html[data-theme="dark"] .risk-rule-card strong,
body[data-theme="dark"] .risk-rule-card strong {
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-0);
}

html[data-theme="dark"] .risk-rule-card__meta,
body[data-theme="dark"] .risk-rule-card__meta {
  display: grid;
  gap: 6px;
}

html[data-theme="dark"] .risk-rule-card__meta-row,
body[data-theme="dark"] .risk-rule-card__meta-row {
  display: grid;
  gap: 3px;
}

html[data-theme="dark"] .risk-rule-card__meta-row span,
body[data-theme="dark"] .risk-rule-card__meta-row span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

html[data-theme="dark"] .risk-rule-card__meta-row strong,
body[data-theme="dark"] .risk-rule-card__meta-row strong {
  font-size: 11px;
  line-height: 1.4;
  font-weight: 560;
  color: var(--text-1);
}

html[data-theme="dark"] .risk-rule-card--neutral,
body[data-theme="dark"] .risk-rule-card--neutral {
  background: color-mix(in srgb, var(--layer-1-subtle) 97%, rgba(255,255,255,0.01));
}

html[data-theme="dark"] .risk-rule-card--neutral .risk-rule-card__head span,
body[data-theme="dark"] .risk-rule-card--neutral .risk-rule-card__head span {
  color: var(--text-2);
}

html[data-theme="dark"] .risk-rule-card--warn .risk-rule-card__head span,
body[data-theme="dark"] .risk-rule-card--warn .risk-rule-card__head span {
  color: color-mix(in srgb, var(--warning) 82%, var(--text-1));
}

html[data-theme="dark"] .risk-rule-card--warn,
body[data-theme="dark"] .risk-rule-card--warn {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0.008)),
    color-mix(in srgb, var(--layer-1-subtle) 94%, rgba(255, 159, 10, 0.045));
  border-color: rgba(255, 159, 10, 0.11);
}

html[data-theme="dark"] .risk-rule-card--dominant,
body[data-theme="dark"] .risk-rule-card--dominant {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.008)),
    color-mix(in srgb, var(--layer-1-subtle) 91%, rgba(154, 46, 60, 0.085));
  border-color: rgba(214, 86, 102, 0.22);
  box-shadow: inset 0 0 0 1px rgba(214, 86, 102, 0.08);
  padding: 12px 12px 11px;
}

html[data-theme="dark"] .risk-rule-card--dominant .risk-rule-card__head span,
body[data-theme="dark"] .risk-rule-card--dominant .risk-rule-card__head span {
  color: color-mix(in srgb, var(--negative) 82%, var(--text-1));
}

html[data-theme="dark"] .risk-active-rules__grid .risk-rule-card:not(.risk-rule-card--dominant),
body[data-theme="dark"] .risk-active-rules__grid .risk-rule-card:not(.risk-rule-card--dominant) {
  background: color-mix(in srgb, var(--layer-1-subtle) 97%, rgba(255,255,255,0.008));
  border-color: rgba(255,255,255,0.04);
}

html[data-theme="dark"] .risk-core-grid,
body[data-theme="dark"] .risk-core-grid,
html[data-theme="dark"] .risk-secondary-grid,
body[data-theme="dark"] .risk-secondary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  gap: 14px;
  align-items: start;
}

html[data-theme="dark"] .risk-core-metrics,
body[data-theme="dark"] .risk-core-metrics {
  display: grid;
  gap: 12px;
}

html[data-theme="dark"] .risk-core-metrics__grid,
body[data-theme="dark"] .risk-core-metrics__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

html[data-theme="dark"] .risk-core-kpi,
body[data-theme="dark"] .risk-core-kpi {
  min-height: 126px;
}

html[data-theme="dark"] .risk-core-kpi .tl-kpi-val,
body[data-theme="dark"] .risk-core-kpi .tl-kpi-val {
  color: var(--text-0);
}

html[data-theme="dark"] .risk-core-kpi__note,
body[data-theme="dark"] .risk-core-kpi__note {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
}

html[data-theme="dark"] .risk-core-kpi__note-value,
body[data-theme="dark"] .risk-core-kpi__note-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

html[data-theme="dark"] .risk-core-kpi__note-value--positive,
body[data-theme="dark"] .risk-core-kpi__note-value--positive {
  color: color-mix(in srgb, var(--positive) 72%, var(--text-1));
}

html[data-theme="dark"] .risk-core-kpi__note-value--warning,
body[data-theme="dark"] .risk-core-kpi__note-value--warning {
  color: color-mix(in srgb, var(--warning) 78%, var(--text-1));
}

html[data-theme="dark"] .risk-core-kpi__note-value--negative,
body[data-theme="dark"] .risk-core-kpi__note-value--negative {
  color: color-mix(in srgb, var(--negative) 76%, var(--text-1));
}

html[data-theme="dark"] .risk-core-kpi__note-value--neutral,
body[data-theme="dark"] .risk-core-kpi__note-value--neutral {
  color: var(--text-1);
}

html[data-theme="dark"] .risk-exposure-card,
body[data-theme="dark"] .risk-exposure-card {
  display: grid;
  gap: 12px;
}

html[data-theme="dark"] .risk-exposure-list,
body[data-theme="dark"] .risk-exposure-list {
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] .risk-exposure-row,
body[data-theme="dark"] .risk-exposure-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--layer-1-subtle) 96%, rgba(255,255,255,0.014));
}

html[data-theme="dark"] .risk-exposure-row span,
body[data-theme="dark"] .risk-exposure-row span {
  font-size: 12px;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-exposure-row strong,
body[data-theme="dark"] .risk-exposure-row strong {
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

html[data-theme="dark"] .risk-config-surface,
body[data-theme="dark"] .risk-config-surface,
html[data-theme="dark"] .risk-limits-surface,
body[data-theme="dark"] .risk-limits-surface {
  background: color-mix(in srgb, var(--card-surface) 98%, rgba(255,255,255,0.01)) !important;
  border-color: rgba(255,255,255,0.04) !important;
  overflow: visible !important;
}

html[data-theme="dark"] .risk-policy-surface,
body[data-theme="dark"] .risk-policy-surface {
  display: grid;
  gap: 18px;
  overflow: visible !important;
}

html[data-theme="dark"] .risk-policy-header,
body[data-theme="dark"] .risk-policy-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

html[data-theme="dark"] .risk-policy-sync,
body[data-theme="dark"] .risk-policy-sync {
  display: grid;
  gap: 4px;
  min-width: 260px;
  padding: 14px 15px;
  border-radius: 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.055);
}

html[data-theme="dark"] .risk-policy-sync span,
body[data-theme="dark"] .risk-policy-sync span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-policy-sync strong,
body[data-theme="dark"] .risk-policy-sync strong {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-1);
}

html[data-theme="dark"] .risk-policy-sync--ok,
body[data-theme="dark"] .risk-policy-sync--ok {
  border-color: rgba(52, 199, 89, 0.12);
}

html[data-theme="dark"] .risk-policy-sync--warn,
body[data-theme="dark"] .risk-policy-sync--warn {
  border-color: rgba(255, 159, 10, 0.14);
}

html[data-theme="dark"] .risk-policy-sync--danger,
body[data-theme="dark"] .risk-policy-sync--danger {
  border-color: rgba(214, 86, 102, 0.16);
}

html[data-theme="dark"] .risk-policy-numeric-grid,
body[data-theme="dark"] .risk-policy-numeric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

html[data-theme="dark"] .risk-policy-field,
body[data-theme="dark"] .risk-policy-field {
  display: grid;
  gap: 8px;
}

html[data-theme="dark"] .risk-policy-field__head,
body[data-theme="dark"] .risk-policy-field__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

html[data-theme="dark"] .risk-policy-field > span,
body[data-theme="dark"] .risk-policy-field > span,
html[data-theme="dark"] .risk-policy-field__head > span,
body[data-theme="dark"] .risk-policy-field__head > span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-policy-field__state,
body[data-theme="dark"] .risk-policy-field__state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-policy-field__state--ok,
body[data-theme="dark"] .risk-policy-field__state--ok {
  color: color-mix(in srgb, var(--positive) 78%, var(--text-1));
  border-color: rgba(52, 199, 89, 0.16);
}

html[data-theme="dark"] .risk-policy-field__state--warn,
body[data-theme="dark"] .risk-policy-field__state--warn {
  color: color-mix(in srgb, var(--warning) 82%, var(--text-1));
  border-color: rgba(255, 159, 10, 0.16);
}

html[data-theme="dark"] .risk-policy-field__state--danger,
body[data-theme="dark"] .risk-policy-field__state--danger {
  color: color-mix(in srgb, var(--negative) 80%, var(--text-1));
  border-color: rgba(214, 86, 102, 0.18);
}

html[data-theme="dark"] .risk-policy-field__state--neutral,
body[data-theme="dark"] .risk-policy-field__state--neutral {
  color: var(--text-2);
  border-color: rgba(255,255,255,0.08);
}

html[data-theme="dark"] .risk-policy-input-shell,
body[data-theme="dark"] .risk-policy-input-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)),
    rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.065);
}

html[data-theme="dark"] .risk-policy-input-shell input,
body[data-theme="dark"] .risk-policy-input-shell input {
  min-height: 40px;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--text-0) !important;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .risk-policy-input-shell input:focus,
body[data-theme="dark"] .risk-policy-input-shell input:focus {
  box-shadow: none !important;
}

html[data-theme="dark"] .risk-policy-input-shell em,
body[data-theme="dark"] .risk-policy-input-shell em {
  font-style: normal;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-policy-editors,
body[data-theme="dark"] .risk-policy-editors {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  overflow: visible;
}

html[data-theme="dark"] .risk-policy-card,
body[data-theme="dark"] .risk-policy-card {
  grid-column: span 4;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--layer-1-subtle) 97%, rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.045);
  overflow: visible;
}

html[data-theme="dark"] .risk-policy-card--full,
body[data-theme="dark"] .risk-policy-card--full {
  grid-column: 1 / -1;
}

html[data-theme="dark"] .risk-policy-card__head,
body[data-theme="dark"] .risk-policy-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

html[data-theme="dark"] .risk-policy-field--compact .risk-policy-input-shell,
body[data-theme="dark"] .risk-policy-field--compact .risk-policy-input-shell {
  border-radius: 16px;
  padding: 10px 12px;
}

html[data-theme="dark"] .risk-policy-field--compact .risk-policy-input-shell input,
body[data-theme="dark"] .risk-policy-field--compact .risk-policy-input-shell input {
  font-size: 26px;
}

html[data-theme="dark"] .risk-policy-confirmation,
body[data-theme="dark"] .risk-policy-confirmation {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

html[data-theme="dark"] .risk-policy-confirmation strong,
body[data-theme="dark"] .risk-policy-confirmation strong {
  font-size: 14px;
  color: var(--text-0);
}

html[data-theme="dark"] .risk-policy-confirmation span,
body[data-theme="dark"] .risk-policy-confirmation span {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-policy-footer,
body[data-theme="dark"] .risk-policy-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 8px;
}

html[data-theme="dark"] .risk-limits-surface,
body[data-theme="dark"] .risk-limits-surface {
  display: grid;
  gap: 18px;
}

html[data-theme="dark"] .risk-config-card,
body[data-theme="dark"] .risk-config-card {
  background: color-mix(in srgb, var(--layer-1-subtle) 98%, rgba(255,255,255,0.008)) !important;
  border-color: rgba(255,255,255,0.035) !important;
  box-shadow: none !important;
  border-radius: 20px !important;
}

html[data-theme="dark"] .risk-config-card .risk-config-title,
body[data-theme="dark"] .risk-config-card .risk-config-title,
html[data-theme="dark"] .risk-config-card .risk-config-value,
body[data-theme="dark"] .risk-config-card .risk-config-value {
  color: color-mix(in srgb, var(--text-0) 90%, var(--text-2));
}

html[data-theme="dark"] .risk-config-card .risk-config-meta,
body[data-theme="dark"] .risk-config-card .risk-config-meta,
html[data-theme="dark"] .risk-limit-note,
body[data-theme="dark"] .risk-limit-note {
  color: var(--text-2);
}

html[data-theme="dark"] .risk-secondary-grid,
body[data-theme="dark"] .risk-secondary-grid,
html[data-theme="dark"] .risk-config-grid,
body[data-theme="dark"] .risk-config-grid,
html[data-theme="dark"] .risk-config-card--editable,
body[data-theme="dark"] .risk-config-card--editable,
html[data-theme="dark"] .risk-config-control,
body[data-theme="dark"] .risk-config-control,
html[data-theme="dark"] .risk-select,
body[data-theme="dark"] .risk-select {
  overflow: visible !important;
}

html[data-theme="dark"] .risk-config-grid,
body[data-theme="dark"] .risk-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

html[data-theme="dark"] .risk-config-card--editable,
body[data-theme="dark"] .risk-config-card--editable {
  gap: 14px;
  padding: 18px;
  min-height: 100%;
  align-content: start;
}

html[data-theme="dark"] .risk-config-card--menu-open,
body[data-theme="dark"] .risk-config-card--menu-open {
  z-index: 200;
}

html[data-theme="dark"] .risk-config-card-head,
body[data-theme="dark"] .risk-config-card-head {
  align-items: flex-start;
  gap: 14px;
}

html[data-theme="dark"] .risk-config-title,
body[data-theme="dark"] .risk-config-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-0);
}

html[data-theme="dark"] .risk-config-meta,
body[data-theme="dark"] .risk-config-meta {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.55;
}

html[data-theme="dark"] .risk-config-value,
body[data-theme="dark"] .risk-config-value {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-0);
}

html[data-theme="dark"] .risk-config-state-pill--header,
body[data-theme="dark"] .risk-config-state-pill--header {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
  color: var(--text-1);
}

html[data-theme="dark"] .risk-config-control,
body[data-theme="dark"] .risk-config-control {
  gap: 8px;
}

html[data-theme="dark"] .risk-config-control span,
body[data-theme="dark"] .risk-config-control span,
html[data-theme="dark"] .risk-input-field span,
body[data-theme="dark"] .risk-input-field span {
  color: var(--text-2);
}

html[data-theme="dark"] .risk-config-control input,
body[data-theme="dark"] .risk-config-control input,
html[data-theme="dark"] .risk-config-control textarea,
body[data-theme="dark"] .risk-config-control textarea,
html[data-theme="dark"] .risk-input-field input,
body[data-theme="dark"] .risk-input-field input,
html[data-theme="dark"] .risk-select-search input,
body[data-theme="dark"] .risk-select-search input {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: var(--text-0) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .risk-config-control input:hover,
body[data-theme="dark"] .risk-config-control input:hover,
html[data-theme="dark"] .risk-config-control textarea:hover,
body[data-theme="dark"] .risk-config-control textarea:hover,
html[data-theme="dark"] .risk-input-field input:hover,
body[data-theme="dark"] .risk-input-field input:hover,
html[data-theme="dark"] .risk-select-trigger:hover,
body[data-theme="dark"] .risk-select-trigger:hover,
html[data-theme="dark"] .risk-stepper:hover,
body[data-theme="dark"] .risk-stepper:hover,
html[data-theme="dark"] .risk-select-search input:hover,
body[data-theme="dark"] .risk-select-search input:hover {
  background: rgba(255,255,255,0.06) !important;
}

html[data-theme="dark"] .risk-config-control input:focus,
body[data-theme="dark"] .risk-config-control input:focus,
html[data-theme="dark"] .risk-config-control textarea:focus,
body[data-theme="dark"] .risk-config-control textarea:focus,
html[data-theme="dark"] .risk-input-field input:focus,
body[data-theme="dark"] .risk-input-field input:focus,
html[data-theme="dark"] .risk-select-search input:focus,
body[data-theme="dark"] .risk-select-search input:focus {
  border-color: rgba(255,255,255,0.16) !important;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06) !important;
}

html[data-theme="dark"] .risk-stepper,
body[data-theme="dark"] .risk-stepper {
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
}

html[data-theme="dark"] .risk-stepper-btn,
body[data-theme="dark"] .risk-stepper-btn {
  background: transparent;
  color: var(--text-1);
}

html[data-theme="dark"] .risk-stepper-btn:first-child,
body[data-theme="dark"] .risk-stepper-btn:first-child,
html[data-theme="dark"] .risk-stepper-btn:last-child,
body[data-theme="dark"] .risk-stepper-btn:last-child {
  border-color: rgba(255,255,255,0.08);
}

html[data-theme="dark"] .risk-stepper-btn:hover,
body[data-theme="dark"] .risk-stepper-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-0);
}

html[data-theme="dark"] .risk-select-trigger,
body[data-theme="dark"] .risk-select-trigger {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  box-shadow: none;
}

html[data-theme="dark"] .risk-select-trigger--policy,
body[data-theme="dark"] .risk-select-trigger--policy {
  min-height: 50px;
  padding: 13px 14px;
}

html[data-theme="dark"] .risk-select.open .risk-select-trigger,
body[data-theme="dark"] .risk-select.open .risk-select-trigger,
html[data-theme="dark"] .risk-select-trigger:focus-visible,
body[data-theme="dark"] .risk-select-trigger:focus-visible {
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}

html[data-theme="dark"] .risk-select-trigger strong,
body[data-theme="dark"] .risk-select-trigger strong {
  color: var(--text-1);
  font-weight: 700;
}

html[data-theme="dark"] .risk-select-trigger--symbols,
body[data-theme="dark"] .risk-select-trigger--symbols {
  align-items: flex-start;
  gap: 12px;
}

html[data-theme="dark"] .risk-select-trigger--symbols::after,
body[data-theme="dark"] .risk-select-trigger--symbols::after {
  display: none;
}

html[data-theme="dark"] .risk-select-trigger__tags,
body[data-theme="dark"] .risk-select-trigger__tags {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 56px;
  overflow: auto;
  padding-right: 2px;
}

html[data-theme="dark"] .risk-selected-tag,
body[data-theme="dark"] .risk-selected-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-1);
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}

html[data-theme="dark"] .risk-selected-tag--forex,
body[data-theme="dark"] .risk-selected-tag--forex {
  background: rgba(255,255,255,0.055);
}

html[data-theme="dark"] .risk-selected-tag--indice,
body[data-theme="dark"] .risk-selected-tag--indice {
  background: rgba(255,255,255,0.055);
}

html[data-theme="dark"] .risk-selected-tag--commodity,
body[data-theme="dark"] .risk-selected-tag--commodity {
  background: rgba(255,255,255,0.055);
}

html[data-theme="dark"] .risk-selected-tag--crypto,
body[data-theme="dark"] .risk-selected-tag--crypto {
  background: rgba(255,255,255,0.055);
}

html[data-theme="dark"] .risk-selected-tag--more,
body[data-theme="dark"] .risk-selected-tag--more,
html[data-theme="dark"] .risk-selected-tag--empty,
body[data-theme="dark"] .risk-selected-tag--empty {
  color: var(--text-2);
}

html[data-theme="dark"] .risk-select-menu,
body[data-theme="dark"] .risk-select-menu {
  top: calc(100% + 10px);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(20,20,20,0.85);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  transform: translateY(6px);
  transition: opacity 120ms ease-out, transform 120ms ease-out;
}

html[data-theme="dark"] .risk-select-menu--policy,
body[data-theme="dark"] .risk-select-menu--policy {
  min-width: 100%;
  width: 100%;
  padding: 14px;
  border-radius: 16px;
}

html[data-theme="dark"] .risk-policy-card .risk-select-menu--policy,
body[data-theme="dark"] .risk-policy-card .risk-select-menu--policy {
  position: absolute;
  top: auto;
  bottom: calc(100% + 12px);
  left: auto;
  right: 0;
  margin-top: 0;
  width: min(440px, calc(100vw - 88px));
  max-height: min(58vh, 460px);
  overflow: auto;
  transform: translateY(6px) scale(0.985);
  box-shadow: 0 22px 48px rgba(0,0,0,0.44);
  z-index: 120;
}

html[data-theme="dark"] .risk-policy-card--full .risk-select-menu--policy,
body[data-theme="dark"] .risk-policy-card--full .risk-select-menu--policy {
  width: min(620px, calc(100vw - 88px));
  max-width: min(620px, calc(100vw - 88px));
}

html[data-theme="dark"] .risk-inline-editor-head,
body[data-theme="dark"] .risk-inline-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

html[data-theme="dark"] .risk-inline-editor-head strong,
body[data-theme="dark"] .risk-inline-editor-head strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-0);
}

html[data-theme="dark"] .risk-inline-editor-head span,
body[data-theme="dark"] .risk-inline-editor-head span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-inline-editor-link,
body[data-theme="dark"] .risk-inline-editor-link {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-1);
  font-size: 11px;
  font-weight: 600;
}

html[data-theme="dark"] .risk-inline-editor-link:hover,
body[data-theme="dark"] .risk-inline-editor-link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-0);
}

html[data-theme="dark"] .risk-session-group,
body[data-theme="dark"] .risk-session-group {
  gap: 6px;
}

html[data-theme="dark"] .risk-session-group--inline,
body[data-theme="dark"] .risk-session-group--inline {
  display: grid;
  gap: 8px;
}

html[data-theme="dark"] .risk-session-row,
body[data-theme="dark"] .risk-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.022);
  text-align: left;
}

html[data-theme="dark"] .risk-session-row:hover,
body[data-theme="dark"] .risk-session-row:hover {
  background: rgba(255,255,255,0.04);
}

html[data-theme="dark"] .risk-session-copy,
body[data-theme="dark"] .risk-session-copy {
  display: grid;
  gap: 2px;
}

html[data-theme="dark"] .risk-session-name,
body[data-theme="dark"] .risk-session-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-0);
}

html[data-theme="dark"] .risk-session-utc,
body[data-theme="dark"] .risk-session-utc {
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-session-row.checked,
body[data-theme="dark"] .risk-session-row.checked {
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.09);
}

html[data-theme="dark"] .risk-session-toggle,
body[data-theme="dark"] .risk-session-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

html[data-theme="dark"] .risk-session-toggle__track,
body[data-theme="dark"] .risk-session-toggle__track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.09);
  transition: background 0.12s ease, border-color 0.12s ease;
}

html[data-theme="dark"] .risk-session-toggle__thumb,
body[data-theme="dark"] .risk-session-toggle__thumb {
  position: absolute;
  left: 3px;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.88);
  transform: translateY(-50%);
  transition: transform 0.12s ease;
}

html[data-theme="dark"] .risk-session-toggle em,
body[data-theme="dark"] .risk-session-toggle em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

html[data-theme="dark"] .risk-session-toggle.is-on .risk-session-toggle__track,
body[data-theme="dark"] .risk-session-toggle.is-on .risk-session-toggle__track {
  background: var(--layer-3);
  border-color: var(--border-medium);
}

html[data-theme="dark"] .risk-session-toggle.is-on .risk-session-toggle__thumb,
body[data-theme="dark"] .risk-session-toggle.is-on .risk-session-toggle__thumb {
  transform: translate(16px, -50%);
  background: rgba(232, 240, 255, 0.98);
}

html[data-theme="dark"] .risk-session-toggle.is-on em,
body[data-theme="dark"] .risk-session-toggle.is-on em {
  color: color-mix(in srgb, var(--accent) 78%, var(--text-1));
}

html[data-theme="dark"] .risk-symbol-editor,
body[data-theme="dark"] .risk-symbol-editor {
  display: grid;
  gap: 14px;
}

html[data-theme="dark"] .risk-symbol-editor__selected,
body[data-theme="dark"] .risk-symbol-editor__selected,
html[data-theme="dark"] .risk-symbol-editor__results,
body[data-theme="dark"] .risk-symbol-editor__results {
  display: grid;
  gap: 8px;
}

html[data-theme="dark"] .risk-symbol-editor__tags,
body[data-theme="dark"] .risk-symbol-editor__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

html[data-theme="dark"] .risk-symbol-editor-tag,
body[data-theme="dark"] .risk-symbol-editor-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  color: var(--text-1);
  font-size: 11px;
  font-weight: 700;
}

html[data-theme="dark"] .risk-symbol-editor-tag:hover,
body[data-theme="dark"] .risk-symbol-editor-tag:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-0);
}

html[data-theme="dark"] .risk-symbol-editor-tag em,
body[data-theme="dark"] .risk-symbol-editor-tag em {
  font-style: normal;
  font-size: 12px;
  color: var(--text-3);
}

html[data-theme="dark"] .risk-symbol-group--results,
body[data-theme="dark"] .risk-symbol-group--results {
  display: grid;
  gap: 6px;
  min-height: 52px;
}

html[data-theme="dark"] .risk-symbol-search-empty,
body[data-theme="dark"] .risk-symbol-search-empty {
  padding: 12px 2px 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-symbol-action-pill,
body[data-theme="dark"] .risk-symbol-action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-symbol-row,
body[data-theme="dark"] .risk-symbol-row {
  min-height: 52px;
  border-radius: 12px;
}

html[data-theme="dark"] .risk-symbol-main,
body[data-theme="dark"] .risk-symbol-main {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
}

html[data-theme="dark"] .risk-symbol-row:hover,
body[data-theme="dark"] .risk-symbol-row:hover {
  background: rgba(255,255,255,0.04);
}

html[data-theme="dark"] .risk-symbol-row[data-risk-symbol-row],
body[data-theme="dark"] .risk-symbol-row[data-risk-symbol-row] {
  padding-inline: 14px 10px;
}

html[data-theme="dark"] .risk-symbol-summary,
body[data-theme="dark"] .risk-symbol-summary {
  align-items: flex-start;
}

html[data-theme="dark"] .risk-symbol-summary-pills,
body[data-theme="dark"] .risk-symbol-summary-pills {
  max-width: 72%;
}

html[data-theme="dark"] .risk-select.open .risk-select-menu,
body[data-theme="dark"] .risk-select.open .risk-select-menu {
  transform: translateY(0) scale(1);
}

html[data-theme="dark"] .risk-select.open,
body[data-theme="dark"] .risk-select.open {
  z-index: 60;
}

html[data-theme="dark"] .risk-session-row,
body[data-theme="dark"] .risk-session-row,
html[data-theme="dark"] .risk-symbol-row,
body[data-theme="dark"] .risk-symbol-row {
  border-radius: 10px;
}

html[data-theme="dark"] .risk-session-row:hover,
body[data-theme="dark"] .risk-session-row:hover,
html[data-theme="dark"] .risk-symbol-row:hover,
body[data-theme="dark"] .risk-symbol-row:hover {
  background: rgba(255,255,255,0.045);
}

html[data-theme="dark"] .risk-symbol-favorite,
body[data-theme="dark"] .risk-symbol-favorite {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

html[data-theme="dark"] .risk-limit-form,
body[data-theme="dark"] .risk-limit-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

html[data-theme="dark"] .risk-input-field,
body[data-theme="dark"] .risk-input-field {
  gap: 10px;
  padding: 16px 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)),
    rgba(255,255,255,0.02);
}

html[data-theme="dark"] .risk-input-field span,
body[data-theme="dark"] .risk-input-field span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

html[data-theme="dark"] .risk-input-field input,
body[data-theme="dark"] .risk-input-field input {
  min-height: 58px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text-0);
  background: rgba(255,255,255,0.035) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

html[data-theme="dark"] .risk-limit-footer,
body[data-theme="dark"] .risk-limit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 2px;
}

html[data-theme="dark"] .risk-limit-note,
body[data-theme="dark"] .risk-limit-note {
  display: grid;
  gap: 3px;
  margin-top: 0;
}

html[data-theme="dark"] .risk-limit-note strong,
body[data-theme="dark"] .risk-limit-note strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

html[data-theme="dark"] .risk-limit-note span,
body[data-theme="dark"] .risk-limit-note span {
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-limit-actions,
body[data-theme="dark"] .risk-limit-actions {
  margin-top: 0;
  gap: 10px;
}

html[data-theme="dark"] .risk-limit-btn,
body[data-theme="dark"] .risk-limit-btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

html[data-theme="dark"] .risk-limit-btn--secondary,
body[data-theme="dark"] .risk-limit-btn--secondary {
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.07);
  color: var(--text-1);
}

html[data-theme="dark"] .risk-limit-btn--secondary:hover,
body[data-theme="dark"] .risk-limit-btn--secondary:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-0);
}

html[data-theme="dark"] .risk-limit-btn--primary,
body[data-theme="dark"] .risk-limit-btn--primary {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-0);
}

html[data-theme="dark"] .risk-limit-btn--primary:hover,
body[data-theme="dark"] .risk-limit-btn--primary:hover {
  background: rgba(255,255,255,0.13);
}

html[data-theme="dark"] .risk-limit-btn--primary:active,
body[data-theme="dark"] .risk-limit-btn--primary:active,
html[data-theme="dark"] .risk-limit-btn--secondary:active,
body[data-theme="dark"] .risk-limit-btn--secondary:active {
  transform: scale(0.985);
}

html[data-theme="dark"] .risk-ladder-current-pill,
body[data-theme="dark"] .risk-ladder-current-pill {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--warning) 80%, var(--text-1));
  background: rgba(255, 159, 10, 0.12);
}

html[data-theme="dark"] .risk-ladder-table tbody tr.risk-ladder-row--current td,
body[data-theme="dark"] .risk-ladder-table tbody tr.risk-ladder-row--current td {
  background: color-mix(in srgb, var(--layer-1-subtle) 93%, rgba(255, 159, 10, 0.055));
  border-bottom-color: rgba(255, 159, 10, 0.14);
}

html[data-theme="dark"] .risk-ladder-table tbody tr.risk-ladder-row--current td:first-child,
body[data-theme="dark"] .risk-ladder-table tbody tr.risk-ladder-row--current td:first-child {
  box-shadow: inset 2px 0 0 rgba(255, 159, 10, 0.5);
}

@media (max-width: 1080px) {
  html[data-theme="dark"] .risk-command-center,
  body[data-theme="dark"] .risk-command-center,
  html[data-theme="dark"] .risk-core-grid,
  body[data-theme="dark"] .risk-core-grid,
  html[data-theme="dark"] .risk-secondary-grid,
  body[data-theme="dark"] .risk-secondary-grid {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .risk-active-rules__grid,
  body[data-theme="dark"] .risk-active-rules__grid,
  html[data-theme="dark"] .risk-core-metrics__grid,
  body[data-theme="dark"] .risk-core-metrics__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .risk-config-grid,
  body[data-theme="dark"] .risk-config-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  html[data-theme="dark"] .risk-limit-form,
  body[data-theme="dark"] .risk-limit-form {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .risk-policy-header,
  body[data-theme="dark"] .risk-policy-header,
  html[data-theme="dark"] .risk-policy-footer,
  body[data-theme="dark"] .risk-policy-footer {
    flex-direction: column;
    align-items: stretch;
  }

  html[data-theme="dark"] .risk-policy-numeric-grid,
  body[data-theme="dark"] .risk-policy-numeric-grid {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .risk-policy-card,
  body[data-theme="dark"] .risk-policy-card,
  html[data-theme="dark"] .risk-policy-card--full,
  body[data-theme="dark"] .risk-policy-card--full {
    grid-column: span 12;
  }

  html[data-theme="dark"] .risk-select-options--symbols,
  body[data-theme="dark"] .risk-select-options--symbols {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .risk-limit-footer,
  body[data-theme="dark"] .risk-limit-footer {
    flex-direction: column;
    align-items: stretch;
  }

  html[data-theme="dark"] .risk-limit-actions,
  body[data-theme="dark"] .risk-limit-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 720px) {
  html[data-theme="dark"] .risk-active-rules__grid,
  body[data-theme="dark"] .risk-active-rules__grid,
  html[data-theme="dark"] .risk-core-metrics__grid,
  body[data-theme="dark"] .risk-core-metrics__grid {
    grid-template-columns: 1fr;
  }
}

/* Hero F — compact hero composition */
html[data-theme="dark"] .account-banner--hero-refined,
body[data-theme="dark"] .account-banner--hero-refined {
  gap: 10px !important;
  padding: 18px 22px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-hero,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-hero {
  gap: 6px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-hero-row,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.9fr);
  align-items: end;
  gap: 18px;
}

html[data-theme="dark"] .account-banner-metric,
body[data-theme="dark"] .account-banner-metric {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  margin-top: 0 !important;
  line-height: 0.92 !important;
}

html[data-theme="dark"] .account-banner-currency,
body[data-theme="dark"] .account-banner-currency {
  font-size: 0.42em;
  font-weight: 650;
  line-height: 1;
  opacity: 0.9;
  transform: translateY(0.18em);
}

html[data-theme="dark"] .account-banner-metric-value,
body[data-theme="dark"] .account-banner-metric-value {
  display: inline-block;
}

html[data-theme="dark"] .account-banner-metrics-block,
body[data-theme="dark"] .account-banner-metrics-block {
  gap: 4px !important;
  margin-top: 0 !important;
  align-self: center;
}

html[data-theme="dark"] .metric-line,
body[data-theme="dark"] .metric-line {
  gap: 6px !important;
}

html[data-theme="dark"] .metric-line-label,
body[data-theme="dark"] .metric-line-label {
  font-size: 10px !important;
  letter-spacing: 0.035em !important;
}

html[data-theme="dark"] .metric-line strong,
body[data-theme="dark"] .metric-line strong {
  font-size: 13px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-badges,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-badges {
  margin-top: 2px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-chart,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-chart {
  margin-top: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz {
  min-height: 200px !important;
}

@media (max-width: 900px) {
  html[data-theme="dark"] .account-banner--hero-refined .account-banner-hero-row,
  body[data-theme="dark"] .account-banner--hero-refined .account-banner-hero-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Phase Hero A — flagship treatment for dashboard performance hero */
html[data-theme="dark"] .account-banner--premium,
body[data-theme="dark"] .account-banner--premium {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.008)),
    var(--card-surface) !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
  border-radius: 20px !important;
  box-shadow: none !important;
  padding: 24px 26px !important;
  gap: 30px !important;
}

html[data-theme="dark"] .account-banner-copy,
body[data-theme="dark"] .account-banner-copy {
  gap: 14px !important;
}

html[data-theme="dark"] .banner-kicker,
body[data-theme="dark"] .banner-kicker {
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.18em !important;
  color: var(--text-2) !important;
  margin-bottom: 10px !important;
}

html[data-theme="dark"] .banner-title,
body[data-theme="dark"] .banner-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
}

html[data-theme="dark"] .banner-sub,
body[data-theme="dark"] .banner-sub {
  font-size: 12px !important;
  color: var(--text-2) !important;
  margin-top: 6px !important;
}

html[data-theme="dark"] .account-banner-side,
body[data-theme="dark"] .account-banner-side {
  gap: 10px !important;
  padding-right: 10px !important;
}

html[data-theme="dark"] .account-banner-metric,
body[data-theme="dark"] .account-banner-metric {
  font-size: clamp(44px, 4.8vw, 64px) !important;
  line-height: 0.94 !important;
  letter-spacing: -0.06em !important;
  font-weight: 700 !important;
  color: var(--text-0) !important;
}

html[data-theme="dark"] .account-banner-meta,
body[data-theme="dark"] .account-banner-meta {
  margin-top: 2px !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  letter-spacing: -0.015em !important;
}

html[data-theme="dark"] .account-banner-context,
body[data-theme="dark"] .account-banner-context {
  margin-top: 2px !important;
  gap: 8px 12px !important;
  font-size: 11px !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] .account-banner-context strong,
body[data-theme="dark"] .account-banner-context strong {
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: -0.015em !important;
}

html[data-theme="dark"] .account-banner-badges,
body[data-theme="dark"] .account-banner-badges {
  margin-top: 8px !important;
  gap: 6px !important;
}

html[data-theme="dark"] .account-banner-chart,
body[data-theme="dark"] .account-banner-chart {
  padding-left: 22px !important;
}

html[data-theme="dark"] .account-banner-chart::before,
body[data-theme="dark"] .account-banner-chart::before {
  left: 0 !important;
  top: 8px !important;
  bottom: 8px !important;
  background: rgba(255,255,255,0.06) !important;
}

html[data-theme="dark"] .account-banner-viz,
body[data-theme="dark"] .account-banner-viz {
  border-radius: 18px !important;
  background: rgba(255,255,255,0.025) !important;
  border: 1px solid rgba(255,255,255,0.05) !important;
  padding: 12px 14px 10px !important;
  min-height: 190px !important;
}

html[data-theme="dark"] .account-banner-viz .kmfx-chart-shell--hero,
body[data-theme="dark"] .account-banner-viz .kmfx-chart-shell--hero {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .widget-segmented,
body[data-theme="dark"] .widget-segmented {
  padding: 3px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,0.035) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
}

html[data-theme="dark"] .widget-segmented-btn,
body[data-theme="dark"] .widget-segmented-btn {
  min-height: 32px !important;
  padding: 6px 10px !important;
  font-size: 10px !important;
  font-weight: 650 !important;
  letter-spacing: 0.08em !important;
}

html[data-theme="dark"] .widget-segmented-btn.active,
body[data-theme="dark"] .widget-segmented-btn.active {
  background: rgba(255,255,255,0.08) !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

/* Phase Hero C — semantic metrics + tighter flagship spacing */
html[data-theme="dark"] .account-banner--hero-refined,

body[data-theme="dark"] .account-banner--hero-refined {
  gap: 16px !important;
  padding: 20px 24px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-head,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-head {
  gap: 14px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-hero,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-hero {
  gap: 8px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-metric,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-metric {
  margin-top: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .banner-sub,
body[data-theme="dark"] .account-banner--hero-refined .banner-sub {
  margin-top: 4px !important;
}

html[data-theme="dark"] .account-banner-metrics-block,
body[data-theme="dark"] .account-banner-metrics-block {
  display: flex;
  flex-direction: column;
  gap: 6px !important;
  margin-top: 4px !important;
}

html[data-theme="dark"] .metric-line,
body[data-theme="dark"] .metric-line {
  display: flex;
  align-items: baseline;
  gap: 8px !important;
  flex-wrap: wrap;
}

html[data-theme="dark"] .metric-line-label,
body[data-theme="dark"] .metric-line-label {
  font-size: 11px !important;
  font-weight: 500 !important;
  color: var(--text-2) !important;
  letter-spacing: 0.04em !important;
}

html[data-theme="dark"] .metric-line strong,
body[data-theme="dark"] .metric-line strong {
  font-size: 14px !important;
  font-weight: 650 !important;
  letter-spacing: -0.015em !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-badges,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-badges {
  margin-top: 6px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-chart,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-chart {
  margin-top: 4px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz {
  min-height: 200px !important;
}

/* Hero D — chart atmosphere */
html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz {
  min-height: 220px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz .kmfx-chart-shell--hero,
html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz canvas,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz .kmfx-chart-shell--hero,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz canvas {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined,
body[data-theme="dark"] .account-banner--hero-refined {
  gap: 12px !important;
  padding: 18px 22px !important;
}

html[data-theme="dark"] .account-banner-chart,
body[data-theme="dark"] .account-banner-chart {
  margin-top: 0 !important;
}

html[data-theme="dark"] .account-banner-metric,
body[data-theme="dark"] .account-banner-metric {
  text-shadow: 0 2px 12px rgba(255,255,255,0.06);
  letter-spacing: -0.045em;
}

/* Phase Hero B — structural flagship layout for dashboard hero */
html[data-theme="dark"] .account-banner--hero-refined,
body[data-theme="dark"] .account-banner--hero-refined {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 20px !important;
  align-items: stretch !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-head,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-heading,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-heading {
  min-width: 0;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-controls,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-controls {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-hero,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-hero {
  display: grid;
  gap: 10px;
  align-content: start;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-metric,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-metric {
  margin-top: 2px;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-meta,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-meta {
  margin-top: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-context,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-context {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-context strong,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-context strong {
  order: 0;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-context span,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-context span {
  order: 1;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-badges,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-badges {
  margin-top: 4px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-chart,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-chart {
  min-width: 0;
  display: block;
  padding-left: 0 !important;
  border-left: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-chart::before,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-chart::before {
  content: none !important;
  display: none !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz {
  margin-top: 0 !important;
  min-height: 220px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz .kmfx-chart-shell--hero,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz .kmfx-chart-shell--hero {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

@media (max-width: 900px) {
  html[data-theme="dark"] .account-banner--hero-refined .account-banner-head,
  body[data-theme="dark"] .account-banner--hero-refined .account-banner-head {
    flex-direction: column;
    align-items: stretch;
  }

  html[data-theme="dark"] .account-banner--hero-refined .account-banner-controls,
  body[data-theme="dark"] .account-banner--hero-refined .account-banner-controls {
    justify-content: flex-start;
  }
}


/* Phase 5.2 — global visible surface unification */

/* Hero G — compact premium polish */
html[data-theme="dark"] .account-banner--hero-refined,
body[data-theme="dark"] .account-banner--hero-refined {
  gap: 10px !important;
  padding: 16px 20px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-head,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-head {
  gap: 12px !important;
  margin-bottom: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .banner-kicker,
body[data-theme="dark"] .account-banner--hero-refined .banner-kicker {
  margin-bottom: 6px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .banner-title,
body[data-theme="dark"] .account-banner--hero-refined .banner-title {
  font-size: 18px !important;
  line-height: 1.08 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .banner-sub,
body[data-theme="dark"] .account-banner--hero-refined .banner-sub {
  margin-top: 3px !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-hero,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-hero {
  gap: 6px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-hero-row,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-hero-row {
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.95fr) !important;
  align-items: center !important;
  gap: 14px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-metric,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-metric {
  display: inline-flex !important;
  align-items: flex-start !important;
  gap: 3px !important;
  margin-top: 0 !important;
  font-size: clamp(40px, 4.2vw, 52px) !important;
  font-weight: 700 !important;
  line-height: 0.9 !important;
  letter-spacing: -0.055em !important;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.05) !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-currency,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-currency {
  font-size: 0.34em !important;
  font-weight: 600 !important;
  opacity: 0.82 !important;
  transform: translateY(0.28em) !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-metric-value,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-metric-value {
  display: inline-block !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-metrics-block,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-metrics-block {
  display: grid !important;
  gap: 5px !important;
  margin-top: 0 !important;
  align-self: center !important;
}

html[data-theme="dark"] .account-banner--hero-refined .metric-line,
body[data-theme="dark"] .account-banner--hero-refined .metric-line {
  display: grid !important;
  grid-template-columns: 92px minmax(0, 1fr) !important;
  align-items: baseline !important;
  gap: 8px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .metric-line-label,
body[data-theme="dark"] .account-banner--hero-refined .metric-line-label {
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
  color: var(--text-2) !important;
  letter-spacing: 0.035em !important;
}

html[data-theme="dark"] .account-banner--hero-refined .metric-line strong,
body[data-theme="dark"] .account-banner--hero-refined .metric-line strong {
  font-size: 16px !important;
  font-weight: 650 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.02em !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-badges,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-badges {
  margin-top: 0 !important;
  gap: 5px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-chart,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-chart {
  margin-top: -2px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz {
  min-height: 184px !important;
  padding-top: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz canvas,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz canvas {
  background: transparent !important;
}

@media (max-width: 900px) {
  html[data-theme="dark"] .account-banner--hero-refined .account-banner-hero-row,
  body[data-theme="dark"] .account-banner--hero-refined .account-banner-hero-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  html[data-theme="dark"] .account-banner--hero-refined .metric-line,
  body[data-theme="dark"] .account-banner--hero-refined .metric-line {
    grid-template-columns: 1fr !important;
    gap: 2px !important;
  }
}

/* 1. Large wrappers must stay in the canonical base family */
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .analytics-card,
html[data-theme="dark"] .performance-card,
html[data-theme="dark"] .distribution-card,
html[data-theme="dark"] .table-card,
body[data-theme="dark"] .chart-card,
body[data-theme="dark"] .analytics-card,
body[data-theme="dark"] .performance-card,
body[data-theme="dark"] .distribution-card,
body[data-theme="dark"] .table-card {
  background: var(--card-surface) !important;
  background-image: none !important;
  border: 1px solid var(--card-border) !important;
  box-shadow: none !important;
}

/* 2. Kill accidental elevated repainting on generic chart/distribution descendants */
html[data-theme="dark"] .widget-card [class*="chart"],
html[data-theme="dark"] .widget-card [class*="distribution"],
body[data-theme="dark"] .widget-card [class*="chart"],
body[data-theme="dark"] .widget-card [class*="distribution"] {
  background: transparent !important;
}

/* 3. Real inner sub-widgets should use the subtle internal surface */
html[data-theme="dark"] .analytics-winloss-summary,
html[data-theme="dark"] .analytics-winloss-stat,
html[data-theme="dark"] .analytics-top-metric,
html[data-theme="dark"] .analytics-ratio-minimal-card,
html[data-theme="dark"] .analytics-submetric,
html[data-theme="dark"] .weekday-inline-card,
html[data-theme="dark"] .hhc-card,
body[data-theme="dark"] .analytics-winloss-summary,
body[data-theme="dark"] .analytics-winloss-stat,
body[data-theme="dark"] .analytics-top-metric,
body[data-theme="dark"] .analytics-ratio-minimal-card,
body[data-theme="dark"] .analytics-submetric,
body[data-theme="dark"] .weekday-inline-card,
body[data-theme="dark"] .hhc-card {
  background: var(--layer-1-subtle) !important;
  background-image: none !important;
  border: 1px solid var(--border-0) !important;
  box-shadow: none !important;
}

/* 4. Structural wrappers must stop acting like visible cards */
html[data-theme="dark"] .analytics-panel .table-wrap,
html[data-theme="dark"] .analytics-panel .list-row,
html[data-theme="dark"] .analytics-panel .heat-cell,
html[data-theme="dark"] .kmfx-chart-shell--feature,
html[data-theme="dark"] .analytics-panel .kmfx-chart-shell--feature,
body[data-theme="dark"] .analytics-panel .table-wrap,
body[data-theme="dark"] .analytics-panel .list-row,
body[data-theme="dark"] .analytics-panel .heat-cell,
body[data-theme="dark"] .kmfx-chart-shell--feature,
body[data-theme="dark"] .analytics-panel .kmfx-chart-shell--feature {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .analytics-overview-shell,
body[data-theme="dark"] .analytics-overview-shell {
  display: grid;
  gap: 28px;
}

html[data-theme="dark"] .insights-patterns,
body[data-theme="dark"] .insights-patterns {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card, var(--radius));
  background: color-mix(in srgb, var(--card) 94%, var(--foreground) 3%);
}

html[data-theme="dark"] .insights-patterns__header,
body[data-theme="dark"] .insights-patterns__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

html[data-theme="dark"] .insights-patterns__eyebrow,
body[data-theme="dark"] .insights-patterns__eyebrow {
  margin: 0 0 6px;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-patterns__title,
body[data-theme="dark"] .insights-patterns__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.08;
  font-weight: 780;
  letter-spacing: -0.035em;
  color: var(--foreground);
}

html[data-theme="dark"] .insights-patterns__description,
body[data-theme="dark"] .insights-patterns__description {
  margin: 7px 0 0;
  max-width: 620px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-patterns__grid,
body[data-theme="dark"] .insights-patterns__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

html[data-theme="dark"] .insights-pattern-kpi,
body[data-theme="dark"] .insights-pattern-kpi {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: calc(var(--radius-card, var(--radius)) - 5px);
  background: color-mix(in srgb, var(--card) 91%, var(--foreground) 3%);
}

html[data-theme="dark"] .insights-pattern-kpi__label,
body[data-theme="dark"] .insights-pattern-kpi__label {
  display: block;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-pattern-kpi__value,
body[data-theme="dark"] .insights-pattern-kpi__value {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.12;
  font-weight: 780;
  letter-spacing: -0.035em;
  color: var(--foreground);
}

html[data-theme="dark"] .insights-pattern-kpi__meta,
body[data-theme="dark"] .insights-pattern-kpi__meta {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 720;
  color: color-mix(in srgb, var(--foreground) 84%, var(--muted-foreground));
}

html[data-theme="dark"] .insights-pattern-kpi__secondary,
body[data-theme="dark"] .insights-pattern-kpi__secondary {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-pattern-kpi__meta--positive,
body[data-theme="dark"] .insights-pattern-kpi__meta--positive,
html[data-theme="dark"] .insights-pattern-kpi__secondary--positive,
body[data-theme="dark"] .insights-pattern-kpi__secondary--positive {
  color: color-mix(in srgb, var(--profit) 82%, var(--foreground));
}

html[data-theme="dark"] .insights-pattern-kpi__meta--negative,
body[data-theme="dark"] .insights-pattern-kpi__meta--negative,
html[data-theme="dark"] .insights-pattern-kpi__secondary--negative,
body[data-theme="dark"] .insights-pattern-kpi__secondary--negative {
  color: color-mix(in srgb, var(--loss) 78%, var(--foreground));
}

html[data-theme="dark"] .insights-pattern-kpi--positive .insights-pattern-kpi__label,
body[data-theme="dark"] .insights-pattern-kpi--positive .insights-pattern-kpi__label {
  color: color-mix(in srgb, var(--profit) 76%, var(--muted-foreground));
}

html[data-theme="dark"] .insights-pattern-kpi--negative .insights-pattern-kpi__label,
body[data-theme="dark"] .insights-pattern-kpi--negative .insights-pattern-kpi__label {
  color: color-mix(in srgb, var(--loss) 72%, var(--muted-foreground));
}

html[data-theme="dark"] .insights-pattern-kpi--warning .insights-pattern-kpi__label,
body[data-theme="dark"] .insights-pattern-kpi--warning .insights-pattern-kpi__label {
  color: color-mix(in srgb, var(--risk) 72%, var(--muted-foreground));
}

html[data-theme="dark"] .analytics-page-flow,
body[data-theme="dark"] .analytics-page-flow {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

html[data-theme="dark"] .analytics-screen__header,
body[data-theme="dark"] .analytics-screen__header {
  align-items: flex-start;
}

html[data-theme="dark"] .analytics-screen__tabs,
body[data-theme="dark"] .analytics-screen__tabs {
  width: fit-content;
}

html[data-theme="dark"] .analytics-screen__header .calendar-screen__title,
html[data-theme="dark"] .analytics-screen__header .calendar-screen__title::before,
html[data-theme="dark"] .analytics-screen__header .calendar-screen__title::after,
body[data-theme="dark"] .analytics-screen__header .calendar-screen__title,
body[data-theme="dark"] .analytics-screen__header .calendar-screen__title::before,
body[data-theme="dark"] .analytics-screen__header .calendar-screen__title::after {
  margin: 6px 0 0;
}

html[data-theme="dark"] .analytics-screen__header .calendar-screen__title::before,
html[data-theme="dark"] .analytics-screen__header .calendar-screen__title::after,
body[data-theme="dark"] .analytics-screen__header .calendar-screen__title::before,
body[data-theme="dark"] .analytics-screen__header .calendar-screen__title::after {
  display: none !important;
  content: none !important;
}

html[data-theme="dark"] .analytics-screen__header .calendar-screen__subtitle,
body[data-theme="dark"] .analytics-screen__header .calendar-screen__subtitle {
  margin-top: 8px;
}

html[data-theme="dark"] .analytics-overview-hero,
body[data-theme="dark"] .analytics-overview-hero,
html[data-theme="dark"] .analytics-pattern-card,
body[data-theme="dark"] .analytics-pattern-card {
  padding: 18px !important;
}

html[data-theme="dark"] .analytics-overview-hero__stack,
body[data-theme="dark"] .analytics-overview-hero__stack {
  display: grid;
  gap: 12px;
}

html[data-theme="dark"] .analytics-overview-hero__grid,
body[data-theme="dark"] .analytics-overview-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(300px, 0.94fr);
  gap: 16px;
  align-items: start;
}

html[data-theme="dark"] .analytics-overview-primary,
body[data-theme="dark"] .analytics-overview-primary {
  display: grid;
  gap: 16px;
  align-content: start;
}

html[data-theme="dark"] .analytics-overview-kicker,
body[data-theme="dark"] .analytics-overview-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-overview-title,
body[data-theme="dark"] .analytics-overview-title {
  margin: 8px 0 0;
  max-width: 560px;
  font-size: 25px;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-overview-subtitle,
body[data-theme="dark"] .analytics-overview-subtitle {
  margin: 10px 0 0;
  max-width: 720px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-overview-copy .risk-alert-grid,
body[data-theme="dark"] .analytics-overview-copy .risk-alert-grid {
  margin-top: 14px;
}

html[data-theme="dark"] .analytics-insight-grid,
body[data-theme="dark"] .analytics-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

html[data-theme="dark"] .analytics-insight-card,
body[data-theme="dark"] .analytics-insight-card {
  min-width: 0;
  padding: 13px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.042);
  background: color-mix(in srgb, var(--layer-1-subtle) 96%, rgba(255,255,255,0.008));
}

html[data-theme="dark"] .analytics-insight-card span,
body[data-theme="dark"] .analytics-insight-card span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-insight-card strong,
body[data-theme="dark"] .analytics-insight-card strong {
  display: block;
  margin-top: 9px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-insight-card small,
body[data-theme="dark"] .analytics-insight-card small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-value-positive,
body[data-theme="dark"] .analytics-value-positive {
  color: color-mix(in srgb, var(--positive) 72%, var(--text-1));
}

html[data-theme="dark"] .analytics-value-negative,
body[data-theme="dark"] .analytics-value-negative {
  color: color-mix(in srgb, var(--negative) 70%, var(--text-1));
}

html[data-theme="dark"] .analytics-insight-card small .analytics-value-positive,
body[data-theme="dark"] .analytics-insight-card small .analytics-value-positive,
html[data-theme="dark"] .analytics-pattern-footer__item small.analytics-value-positive,
body[data-theme="dark"] .analytics-pattern-footer__item small.analytics-value-positive,
html[data-theme="dark"] .analytics-overview-subtitle .analytics-value-positive,
body[data-theme="dark"] .analytics-overview-subtitle .analytics-value-positive,
html[data-theme="dark"] .insights-hour-stat small.analytics-value-positive,
body[data-theme="dark"] .insights-hour-stat small.analytics-value-positive {
  color: color-mix(in srgb, var(--positive) 76%, var(--text-1));
}

html[data-theme="dark"] .analytics-insight-card small .analytics-value-negative,
body[data-theme="dark"] .analytics-insight-card small .analytics-value-negative,
html[data-theme="dark"] .analytics-pattern-footer__item small.analytics-value-negative,
body[data-theme="dark"] .analytics-pattern-footer__item small.analytics-value-negative,
html[data-theme="dark"] .analytics-overview-subtitle .analytics-value-negative,
body[data-theme="dark"] .analytics-overview-subtitle .analytics-value-negative,
html[data-theme="dark"] .insights-hour-stat small.analytics-value-negative,
body[data-theme="dark"] .insights-hour-stat small.analytics-value-negative {
  color: color-mix(in srgb, var(--negative) 74%, var(--text-1));
}

html[data-theme="dark"] .analytics-focus-stack,
body[data-theme="dark"] .analytics-focus-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

html[data-theme="dark"] .analytics-focus-stack--single,
body[data-theme="dark"] .analytics-focus-stack--single {
  max-width: none;
  width: 100%;
}

html[data-theme="dark"] .analytics-quick-read,
body[data-theme="dark"] .analytics-quick-read {
  padding: 4px 2px 0;
}

html[data-theme="dark"] .analytics-quick-read__label,
body[data-theme="dark"] .analytics-quick-read__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-quick-read__list,
body[data-theme="dark"] .analytics-quick-read__list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

html[data-theme="dark"] .analytics-quick-read__list li,
body[data-theme="dark"] .analytics-quick-read__list li {
  position: relative;
  padding-left: 14px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-1);
}

html[data-theme="dark"] .analytics-quick-read__list li::before,
body[data-theme="dark"] .analytics-quick-read__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.28);
}

html[data-theme="dark"] .analytics-focus-item,
body[data-theme="dark"] .analytics-focus-item {
  padding: 13px 16px 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.026);
  border: 1px solid rgba(255, 255, 255, 0.054);
}

html[data-theme="dark"] .analytics-focus-item span,
body[data-theme="dark"] .analytics-focus-item span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-focus-item strong,
body[data-theme="dark"] .analytics-focus-item strong {
  display: block;
  margin-top: 6px;
  font-size: 21px;
  line-height: 1.18;
  letter-spacing: -0.032em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-focus-item small,
body[data-theme="dark"] .analytics-focus-item small {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-focus-item--warn,
body[data-theme="dark"] .analytics-focus-item--warn {
  background: color-mix(in srgb, var(--layer-1-subtle) 91%, rgba(255,255,255,0.03));
  border-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .analytics-focus-item--positive,
body[data-theme="dark"] .analytics-focus-item--positive {
  background: color-mix(in srgb, var(--layer-1-subtle) 92%, var(--positive) 8%);
}

html[data-theme="dark"] .analytics-overview-profile,
body[data-theme="dark"] .analytics-overview-profile {
  display: grid;
  gap: 10px;
  align-content: start;
  align-self: start;
  margin-top: 18px;
}

html[data-theme="dark"] .analytics-overview-profile__head,
body[data-theme="dark"] .analytics-overview-profile__head {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 106px;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.045);
}

html[data-theme="dark"] .analytics-overview-profile__head span,
body[data-theme="dark"] .analytics-overview-profile__head span {
  display: block;
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-overview-profile__head strong,
body[data-theme="dark"] .analytics-overview-profile__head strong {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-profile-highlights,
body[data-theme="dark"] .analytics-profile-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

html[data-theme="dark"] .analytics-profile-row,
body[data-theme="dark"] .analytics-profile-row {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--layer-1-subtle);
  border: 1px solid rgba(255, 255, 255, 0.045);
}

html[data-theme="dark"] .analytics-profile-row--primary,
body[data-theme="dark"] .analytics-profile-row--primary {
  background: rgba(255, 255, 255, 0.024);
}

html[data-theme="dark"] .analytics-profile-row__meta,
body[data-theme="dark"] .analytics-profile-row__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  gap: 12px;
}

html[data-theme="dark"] .analytics-profile-row__meta span,
body[data-theme="dark"] .analytics-profile-row__meta span {
  font-size: 11px;
  line-height: 1.25;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-profile-row__meta strong,
body[data-theme="dark"] .analytics-profile-row__meta strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-profile-row__track,
body[data-theme="dark"] .analytics-profile-row__track {
  display: none;
}

html[data-theme="dark"] .analytics-profile-row__fill,
body[data-theme="dark"] .analytics-profile-row__fill {
  display: none;
}

html[data-theme="dark"] .insights-summary,
body[data-theme="dark"] .insights-summary {
  overflow: hidden;
}

html[data-theme="dark"] .insights-summary__stack,
body[data-theme="dark"] .insights-summary__stack {
  gap: 16px;
}

html[data-theme="dark"] .insights-summary__header,
body[data-theme="dark"] .insights-summary__header {
  padding-bottom: 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}

html[data-theme="dark"] .insights-summary__title,
body[data-theme="dark"] .insights-summary__title {
  margin-top: 6px;
  max-width: 720px;
  font-size: 23px;
  line-height: 1.08;
}

html[data-theme="dark"] .insights-summary__description,
body[data-theme="dark"] .insights-summary__description {
  margin-top: 8px;
  max-width: 680px;
}

html[data-theme="dark"] .insights-summary__grid,
body[data-theme="dark"] .insights-summary__grid {
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 18px;
}

html[data-theme="dark"] .insights-summary__evidence,
body[data-theme="dark"] .insights-summary__evidence {
  gap: 10px;
}

html[data-theme="dark"] .insights-evidence__grid,
body[data-theme="dark"] .insights-evidence__grid {
  gap: 10px;
  margin-top: 0;
  padding-top: 8px;
  border-top: 0;
  border-bottom: 0;
}

html[data-theme="dark"] .insights-evidence__card,
body[data-theme="dark"] .insights-evidence__card {
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: calc(var(--radius-card, var(--radius)) - 5px);
  background: color-mix(in srgb, var(--card) 91%, var(--foreground) 3%);
}

html[data-theme="dark"] .insights-evidence__card strong,
body[data-theme="dark"] .insights-evidence__card strong {
  font-size: 18px;
}

html[data-theme="dark"] .insights-summary__review,
body[data-theme="dark"] .insights-summary__review {
  margin-top: 0;
}

html[data-theme="dark"] .insights-evidence__review,
body[data-theme="dark"] .insights-evidence__review {
  padding: 12px 15px;
  border-color: color-mix(in srgb, var(--border) 88%, transparent);
  background: color-mix(in srgb, var(--card) 91%, var(--foreground) 3%);
}

html[data-theme="dark"] .insights-evidence__review strong,
body[data-theme="dark"] .insights-evidence__review strong {
  font-size: 17px;
  line-height: 1.25;
}

html[data-theme="dark"] .insights-summary__profile,
body[data-theme="dark"] .insights-summary__profile {
  margin-top: 0;
}

html[data-theme="dark"] .insights-summary__profile .analytics-overview-profile__head,
body[data-theme="dark"] .insights-summary__profile .analytics-overview-profile__head {
  min-height: auto;
  padding: 13px 14px;
  background: transparent;
}

html[data-theme="dark"] .insights-summary__profile .analytics-profile-row,
body[data-theme="dark"] .insights-summary__profile .analytics-profile-row {
  min-height: 54px;
  padding: 9px 11px;
  background: transparent;
}

html[data-theme="dark"] .insights-concentration__grid,
body[data-theme="dark"] .insights-concentration__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

html[data-theme="dark"] .insights-variable-card,
body[data-theme="dark"] .insights-variable-card {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: calc(var(--radius-card, var(--radius)) - 5px);
  background: color-mix(in srgb, var(--card) 91%, var(--foreground) 3%);
}

html[data-theme="dark"] .insights-variable-card__label,
body[data-theme="dark"] .insights-variable-card__label {
  display: block;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-variable-card__value,
body[data-theme="dark"] .insights-variable-card__value {
  display: block;
  margin-top: 9px;
  font-size: 20px;
  line-height: 1.12;
  font-weight: 780;
  letter-spacing: -0.04em;
  color: var(--foreground);
}

html[data-theme="dark"] .insights-variable-card__meta,
body[data-theme="dark"] .insights-variable-card__meta {
  display: block;
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 720;
  color: color-mix(in srgb, var(--foreground) 84%, var(--muted-foreground));
}

html[data-theme="dark"] .insights-variable-card__secondary,
body[data-theme="dark"] .insights-variable-card__secondary {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-variable-card__meta--positive,
body[data-theme="dark"] .insights-variable-card__meta--positive {
  color: color-mix(in srgb, var(--profit) 82%, var(--foreground));
}

html[data-theme="dark"] .insights-variable-card__meta--negative,
body[data-theme="dark"] .insights-variable-card__meta--negative {
  color: color-mix(in srgb, var(--loss) 78%, var(--foreground));
}

html[data-theme="dark"] .insights-concentration__review,
body[data-theme="dark"] .insights-concentration__review {
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: calc(var(--radius-card, var(--radius)) - 5px);
  background: color-mix(in srgb, var(--card) 91%, var(--foreground) 3%);
}

html[data-theme="dark"] .insights-concentration__review-label,
body[data-theme="dark"] .insights-concentration__review-label {
  display: block;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-concentration__review strong,
body[data-theme="dark"] .insights-concentration__review strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 760;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

html[data-theme="dark"] .insights-concentration__review small,
body[data-theme="dark"] .insights-concentration__review small {
  display: grid;
  gap: 2px;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-concentration__review small span,
body[data-theme="dark"] .insights-concentration__review small span {
  display: block;
}

html[data-theme="dark"] .analytics-pattern-card .tl-section-title::before,
body[data-theme="dark"] .analytics-pattern-card .tl-section-title::before {
  display: none;
  content: none;
}

html[data-theme="dark"] .insights-evidence__header,
body[data-theme="dark"] .insights-evidence__header {
  padding-bottom: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

html[data-theme="dark"] .insights-session .analytics-session-chart,
body[data-theme="dark"] .insights-session .analytics-session-chart,
html[data-theme="dark"] .insights-symbol .analytics-symbol-stack,
body[data-theme="dark"] .insights-symbol .analytics-symbol-stack,
html[data-theme="dark"] .insights-timing .analytics-timing-list,
body[data-theme="dark"] .insights-timing .analytics-timing-list {
  gap: 8px;
}

html[data-theme="dark"] .insights-session-row,
body[data-theme="dark"] .insights-session-row {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .insights-session-row:first-child,
body[data-theme="dark"] .insights-session-row:first-child {
  padding-top: 0;
}

html[data-theme="dark"] .insights-session-row:last-child,
body[data-theme="dark"] .insights-session-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

html[data-theme="dark"] .insights-session-row__main,
body[data-theme="dark"] .insights-session-row__main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

html[data-theme="dark"] .insights-session-row__copy,
body[data-theme="dark"] .insights-session-row__copy {
  min-width: 0;
}

html[data-theme="dark"] .insights-session-row__copy strong,
body[data-theme="dark"] .insights-session-row__copy strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: -0.018em;
  color: var(--foreground);
}

html[data-theme="dark"] .insights-session-row__copy span,
body[data-theme="dark"] .insights-session-row__copy span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-session-row__value,
body[data-theme="dark"] .insights-session-row__value {
  flex: 0 0 auto;
  min-width: 92px;
  text-align: right;
  font-size: 14px;
  line-height: 1.18;
  font-weight: 760;
  letter-spacing: -0.025em;
}

html[data-theme="dark"] .insights-session-row__line,
body[data-theme="dark"] .insights-session-row__line {
  position: relative;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 52%, transparent);
}

html[data-theme="dark"] .insights-session-row__line span,
body[data-theme="dark"] .insights-session-row__line span {
  display: block;
  width: min(var(--session-contribution, 0%), 100%);
  height: 100%;
  border-radius: inherit;
}

html[data-theme="dark"] .insights-session-row--positive .insights-session-row__line span,
body[data-theme="dark"] .insights-session-row--positive .insights-session-row__line span {
  background: color-mix(in srgb, var(--profit) 76%, var(--foreground));
}

html[data-theme="dark"] .insights-session-row--negative .insights-session-row__line span,
body[data-theme="dark"] .insights-session-row--negative .insights-session-row__line span {
  background: color-mix(in srgb, var(--loss) 74%, var(--foreground));
}

html[data-theme="dark"] .insights-session .analytics-session-bar-row,
body[data-theme="dark"] .insights-session .analytics-session-bar-row,
html[data-theme="dark"] .insights-symbol .analytics-symbol-row,
body[data-theme="dark"] .insights-symbol .analytics-symbol-row,
html[data-theme="dark"] .insights-timing .analytics-timing-row,
body[data-theme="dark"] .insights-timing .analytics-timing-row {
  background: transparent;
  border-color: color-mix(in srgb, var(--border) 66%, transparent);
}

html[data-theme="dark"] .insights-session .analytics-pattern-footer,
body[data-theme="dark"] .insights-session .analytics-pattern-footer,
html[data-theme="dark"] .insights-timing .analytics-pattern-footer,
body[data-theme="dark"] .insights-timing .analytics-pattern-footer {
  gap: 0;
  margin-top: 9px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}

html[data-theme="dark"] .insights-session .analytics-pattern-footer__item,
body[data-theme="dark"] .insights-session .analytics-pattern-footer__item,
html[data-theme="dark"] .insights-timing .analytics-pattern-footer__item,
body[data-theme="dark"] .insights-timing .analytics-pattern-footer__item {
  padding: 9px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

html[data-theme="dark"] .insights-session .analytics-pattern-footer__item strong,
body[data-theme="dark"] .insights-session .analytics-pattern-footer__item strong,
html[data-theme="dark"] .insights-timing .analytics-pattern-footer__item strong,
body[data-theme="dark"] .insights-timing .analytics-pattern-footer__item strong {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 680;
  letter-spacing: -0.012em;
}

html[data-theme="dark"] .insights-session .analytics-pattern-footer__item small,
body[data-theme="dark"] .insights-session .analytics-pattern-footer__item small,
html[data-theme="dark"] .insights-timing .analytics-pattern-footer__item small,
body[data-theme="dark"] .insights-timing .analytics-pattern-footer__item small {
  margin-top: 4px;
  line-height: 1.3;
}

html[data-theme="dark"] .insights-session .analytics-pattern-footer__item + .analytics-pattern-footer__item,
body[data-theme="dark"] .insights-session .analytics-pattern-footer__item + .analytics-pattern-footer__item {
  border-left: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

html[data-theme="dark"] .insights-distribution__body,
body[data-theme="dark"] .insights-distribution__body {
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] .insights-distribution__layout,
body[data-theme="dark"] .insights-distribution__layout {
  display: grid;
  grid-template-columns: minmax(116px, 0.42fr) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

html[data-theme="dark"] .insights-distribution-gauge,
body[data-theme="dark"] .insights-distribution-gauge {
  --distribution-score: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: min(132px, 100%);
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 999px;
  background:
    conic-gradient(
      from 210deg,
      color-mix(in srgb, var(--profit) 78%, var(--foreground)) 0 calc(var(--distribution-score) * 0.75%),
      color-mix(in srgb, var(--border) 72%, transparent) calc(var(--distribution-score) * 0.75%) 75%,
      transparent 75% 100%
    );
}

html[data-theme="dark"] .insights-distribution-gauge::before,
body[data-theme="dark"] .insights-distribution-gauge::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: inherit;
  background: color-mix(in srgb, var(--card) 94%, var(--foreground) 2%);
}

html[data-theme="dark"] .insights-distribution-gauge__inner,
body[data-theme="dark"] .insights-distribution-gauge__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  place-items: center;
  text-align: center;
}

html[data-theme="dark"] .insights-distribution-gauge__inner strong,
body[data-theme="dark"] .insights-distribution-gauge__inner strong {
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.045em;
  color: var(--foreground);
}

html[data-theme="dark"] .insights-distribution-gauge__inner span,
body[data-theme="dark"] .insights-distribution-gauge__inner span {
  font-size: 9px;
  line-height: 1.1;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-distribution__read,
body[data-theme="dark"] .insights-distribution__read {
  min-width: 0;
}

html[data-theme="dark"] .insights-distribution__headline,
body[data-theme="dark"] .insights-distribution__headline {
  font-size: 18px;
  line-height: 1.14;
  font-weight: 780;
  letter-spacing: -0.035em;
  color: var(--foreground);
}

html[data-theme="dark"] .insights-distribution__read p,
body[data-theme="dark"] .insights-distribution__read p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-distribution__metrics,
body[data-theme="dark"] .insights-distribution__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 11px;
  border-block: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .insights-distribution__metric,
body[data-theme="dark"] .insights-distribution__metric {
  min-width: 0;
  padding: 8px 9px;
}

html[data-theme="dark"] .insights-distribution__metric + .insights-distribution__metric,
body[data-theme="dark"] .insights-distribution__metric + .insights-distribution__metric {
  border-left: 1px solid color-mix(in srgb, var(--border) 56%, transparent);
}

html[data-theme="dark"] .insights-distribution__metric span,
body[data-theme="dark"] .insights-distribution__metric span {
  display: block;
  font-size: 9px;
  line-height: 1.1;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-distribution__metric strong,
body[data-theme="dark"] .insights-distribution__metric strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 740;
  color: var(--foreground);
}

html[data-theme="dark"] .insights-distribution__note,
body[data-theme="dark"] .insights-distribution__note {
  padding-top: 2px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .analytics-pattern-grid,
body[data-theme="dark"] .analytics-pattern-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

html[data-theme="dark"] .insights-daily-review,
body[data-theme="dark"] .insights-daily-review {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

html[data-theme="dark"] .insights-daily-review__header,
body[data-theme="dark"] .insights-daily-review__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

html[data-theme="dark"] .insights-daily-review__eyebrow,
body[data-theme="dark"] .insights-daily-review__eyebrow {
  margin: 0 0 6px;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-daily-review__title,
body[data-theme="dark"] .insights-daily-review__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.08;
  font-weight: 780;
  letter-spacing: -0.035em;
  color: var(--foreground);
}

html[data-theme="dark"] .insights-daily-review__description,
body[data-theme="dark"] .insights-daily-review__description {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-daily-review__grid,
body[data-theme="dark"] .insights-daily-review__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

html[data-theme="dark"] .insights-daily-kpi,
body[data-theme="dark"] .insights-daily-kpi {
  min-width: 0;
  padding: 11px 13px 12px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: calc(var(--radius-card, var(--radius)) - 5px);
  background: color-mix(in srgb, var(--card) 91%, var(--foreground) 3%);
}

html[data-theme="dark"] .insights-daily-kpi__label,
body[data-theme="dark"] .insights-daily-kpi__label {
  display: block;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-daily-kpi__value,
body[data-theme="dark"] .insights-daily-kpi__value {
  display: block;
  margin-top: 7px;
  font-size: 18px;
  line-height: 1.12;
  font-weight: 780;
  letter-spacing: -0.035em;
  color: var(--foreground);
}

html[data-theme="dark"] .insights-daily-kpi__details,
body[data-theme="dark"] .insights-daily-kpi__details {
  display: grid;
  gap: 4px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
}

html[data-theme="dark"] .insights-daily-kpi__meta,
body[data-theme="dark"] .insights-daily-kpi__meta {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 720;
  color: color-mix(in srgb, var(--foreground) 84%, var(--muted-foreground));
}

html[data-theme="dark"] .insights-daily-kpi__secondary,
body[data-theme="dark"] .insights-daily-kpi__secondary {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .insights-daily-kpi__meta--positive,
body[data-theme="dark"] .insights-daily-kpi__meta--positive {
  color: color-mix(in srgb, var(--profit) 82%, var(--foreground));
}

html[data-theme="dark"] .insights-daily-kpi__meta--negative,
body[data-theme="dark"] .insights-daily-kpi__meta--negative {
  color: color-mix(in srgb, var(--loss) 78%, var(--foreground));
}

html[data-theme="dark"] .insights-daily-kpi--positive .insights-daily-kpi__label,
body[data-theme="dark"] .insights-daily-kpi--positive .insights-daily-kpi__label {
  color: color-mix(in srgb, var(--profit) 76%, var(--muted-foreground));
}

html[data-theme="dark"] .insights-daily-kpi--negative .insights-daily-kpi__label,
body[data-theme="dark"] .insights-daily-kpi--negative .insights-daily-kpi__label {
  color: color-mix(in srgb, var(--loss) 72%, var(--muted-foreground));
}

html[data-theme="dark"] .insights-daily-kpi--warning .insights-daily-kpi__label,
body[data-theme="dark"] .insights-daily-kpi--warning .insights-daily-kpi__label {
  color: color-mix(in srgb, var(--risk) 74%, var(--muted-foreground));
}

html[data-theme="dark"] .insights-daily-review__empty,
body[data-theme="dark"] .insights-daily-review__empty {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .analytics-daily-layout,
body[data-theme="dark"] .analytics-daily-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

html[data-theme="dark"] .insights-daily-map,
body[data-theme="dark"] .insights-daily-map {
  display: grid;
  gap: 14px;
  min-width: 0;
}

html[data-theme="dark"] .analytics-daily-calendar,
body[data-theme="dark"] .analytics-daily-calendar {
  min-width: 0;
  padding: 16px !important;
}

html[data-theme="dark"] .analytics-daily-calendar__head,
body[data-theme="dark"] .analytics-daily-calendar__head {
  margin-bottom: 14px;
}

html[data-theme="dark"] .analytics-daily-side,
body[data-theme="dark"] .analytics-daily-side {
  display: grid;
  gap: 12px;
  min-width: 0;
  align-content: start;
}

html[data-theme="dark"] .insights-daily-side__stack,
body[data-theme="dark"] .insights-daily-side__stack {
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] .analytics-daily-card,
body[data-theme="dark"] .analytics-daily-card {
  padding: 14px 15px !important;
  border-color: color-mix(in srgb, var(--border) 74%, transparent);
  background: color-mix(in srgb, var(--card) 93%, var(--foreground) 2%);
}

html[data-theme="dark"] .analytics-daily-card--detail,
body[data-theme="dark"] .analytics-daily-card--detail {
  padding: 14px 15px !important;
}

html[data-theme="dark"] .insights-daily-detail,
body[data-theme="dark"] .insights-daily-detail {
  margin-top: 0;
}

html[data-theme="dark"] .analytics-daily-calendar .tl-section-title::before,
body[data-theme="dark"] .analytics-daily-calendar .tl-section-title::before,
html[data-theme="dark"] .analytics-daily-card .tl-section-title::before,
body[data-theme="dark"] .analytics-daily-card .tl-section-title::before {
  display: none;
  content: none;
}

html[data-theme="dark"] .analytics-daily-calendar .tl-section-header,
body[data-theme="dark"] .analytics-daily-calendar .tl-section-header,
html[data-theme="dark"] .analytics-daily-card .tl-section-header,
body[data-theme="dark"] .analytics-daily-card .tl-section-header {
  padding-bottom: 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 64%, transparent);
}

html[data-theme="dark"] .analytics-daily-card .row-sub,
body[data-theme="dark"] .analytics-daily-card .row-sub,
html[data-theme="dark"] .analytics-daily-calendar .row-sub,
body[data-theme="dark"] .analytics-daily-calendar .row-sub {
  margin-top: 4px;
  max-width: 42ch;
}

html[data-theme="dark"] .analytics-key-days,
body[data-theme="dark"] .analytics-key-days {
  display: grid;
  gap: 8px;
}

html[data-theme="dark"] .analytics-key-day,
body[data-theme="dark"] .analytics-key-day {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: 8px 10px;
  width: 100%;
  padding: 10px 11px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.045);
  background: var(--layer-1-subtle);
  text-align: left;
  transition: transform 120ms ease-out, border-color 120ms ease-out, background-color 120ms ease-out, box-shadow 120ms ease-out;
}

html[data-theme="dark"] .analytics-key-day.is-active,
body[data-theme="dark"] .analytics-key-day.is-active {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.07);
}

html[data-theme="dark"] .analytics-key-day--lead,
body[data-theme="dark"] .analytics-key-day--lead {
  padding: 14px 14px 13px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.034), rgba(255,255,255,0.016)),
    rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.075);
}

html[data-theme="dark"] .analytics-key-day__date,
body[data-theme="dark"] .analytics-key-day__date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  min-width: 52px;
}

html[data-theme="dark"] .analytics-key-day strong,
body[data-theme="dark"] .analytics-key-day strong {
  font-size: 15px;
  line-height: 1.1;
}

html[data-theme="dark"] .analytics-key-day--lead strong,
body[data-theme="dark"] .analytics-key-day--lead strong {
  font-size: 18px;
}

html[data-theme="dark"] .analytics-key-day small,
body[data-theme="dark"] .analytics-key-day small {
  grid-column: 1 / -1;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-key-day__reason,
body[data-theme="dark"] .analytics-key-day__reason {
  align-self: center;
  justify-self: start;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  background: color-mix(in srgb, var(--border) 62%, transparent);
}

html[data-theme="dark"] .analytics-key-day:hover,
body[data-theme="dark"] .analytics-key-day:hover {
  transform: translateX(2px);
  border-color: rgba(255,255,255,0.072);
  box-shadow: 0 6px 18px rgba(0,0,0,0.14);
}

html[data-theme="dark"] .insights-daily-reading,
body[data-theme="dark"] .insights-daily-reading {
  display: grid;
  gap: 6px;
}

html[data-theme="dark"] .insights-daily-reading__row,
body[data-theme="dark"] .insights-daily-reading__row {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 56%, transparent);
}

html[data-theme="dark"] .insights-daily-reading__row:first-child,
body[data-theme="dark"] .insights-daily-reading__row:first-child {
  padding-top: 0;
  border-top: 0;
}

html[data-theme="dark"] .insights-daily-reading__row strong,
body[data-theme="dark"] .insights-daily-reading__row strong {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 720;
  color: var(--text-0);
}

html[data-theme="dark"] .insights-daily-reading__row span,
body[data-theme="dark"] .insights-daily-reading__row span {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-daily-card--confidence,
body[data-theme="dark"] .analytics-daily-card--confidence {
  gap: 10px;
}

html[data-theme="dark"] .analytics-daily-confidence,
body[data-theme="dark"] .analytics-daily-confidence {
  display: grid;
  gap: 5px;
  padding: 12px 13px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.024), rgba(255,255,255,0.01)),
    rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.055);
}

html[data-theme="dark"] .analytics-daily-confidence__level,
body[data-theme="dark"] .analytics-daily-confidence__level {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-1);
  background: rgba(255,255,255,0.06);
}

html[data-theme="dark"] .analytics-daily-confidence strong,
body[data-theme="dark"] .analytics-daily-confidence strong {
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-daily-confidence p,
body[data-theme="dark"] .analytics-daily-confidence p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-daily-confidence--high .analytics-daily-confidence__level,
body[data-theme="dark"] .analytics-daily-confidence--high .analytics-daily-confidence__level {
  color: rgba(168, 222, 190, 0.96);
  background: rgba(42, 103, 73, 0.22);
}

html[data-theme="dark"] .analytics-daily-confidence--medium .analytics-daily-confidence__level,
body[data-theme="dark"] .analytics-daily-confidence--medium .analytics-daily-confidence__level {
  color: rgba(225, 229, 234, 0.92);
  background: rgba(255,255,255,0.065);
}

html[data-theme="dark"] .analytics-daily-confidence--low .analytics-daily-confidence__level,
body[data-theme="dark"] .analytics-daily-confidence--low .analytics-daily-confidence__level {
  color: rgba(244, 194, 194, 0.94);
  background: rgba(116, 41, 41, 0.22);
}

html[data-theme="dark"] .analytics-daily-detail,
body[data-theme="dark"] .analytics-daily-detail {
  display: grid;
  gap: 8px;
  animation: analytics-detail-in 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] .analytics-daily-detail__stats,
body[data-theme="dark"] .analytics-daily-detail__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-block: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .analytics-daily-detail__stat,
body[data-theme="dark"] .analytics-daily-detail__stat {
  min-width: 0;
  padding: 8px 9px;
}

html[data-theme="dark"] .analytics-daily-detail__stat + .analytics-daily-detail__stat,
body[data-theme="dark"] .analytics-daily-detail__stat + .analytics-daily-detail__stat {
  border-left: 1px solid color-mix(in srgb, var(--border) 56%, transparent);
}

html[data-theme="dark"] .analytics-daily-detail__stat span,
body[data-theme="dark"] .analytics-daily-detail__stat span {
  display: block;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-daily-detail__stat strong,
body[data-theme="dark"] .analytics-daily-detail__stat strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.2;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-daily-detail__stat--pnl strong,
body[data-theme="dark"] .analytics-daily-detail__stat--pnl strong {
  font-size: 18px;
  letter-spacing: -0.03em;
}

html[data-theme="dark"] .analytics-daily-detail__note,
body[data-theme="dark"] .analytics-daily-detail__note,
html[data-theme="dark"] .analytics-daily-detail__empty,
body[data-theme="dark"] .analytics-daily-detail__empty {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-daily-card--detail.is-active,
body[data-theme="dark"] .analytics-daily-card--detail.is-active {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.012)),
    var(--card-surface);
  border-color: rgba(255,255,255,0.065);
  box-shadow: 0 8px 18px rgba(0,0,0,0.1);
}

html[data-theme="dark"] .analytics-pattern-grid--timing,
body[data-theme="dark"] .analytics-pattern-grid--timing {
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
}

html[data-theme="dark"] .analytics-session-stack--focused,
body[data-theme="dark"] .analytics-session-stack--focused,
html[data-theme="dark"] .analytics-symbol-stack,
body[data-theme="dark"] .analytics-symbol-stack {
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] .analytics-session-chart,
body[data-theme="dark"] .analytics-session-chart {
  display: grid;
  gap: 12px;
}

html[data-theme="dark"] .analytics-session-bar-row,
body[data-theme="dark"] .analytics-session-bar-row {
  display: grid;
  grid-template-columns: minmax(118px, 0.8fr) minmax(180px, 1.4fr) max-content;
  align-items: center;
  gap: 14px;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.014);
  border: 1px solid rgba(255, 255, 255, 0.042);
}

html[data-theme="dark"] .analytics-session-bar-row--best,
body[data-theme="dark"] .analytics-session-bar-row--best,
html[data-theme="dark"] .analytics-session-bar-row--worst,
body[data-theme="dark"] .analytics-session-bar-row--worst {
  background: rgba(255, 255, 255, 0.018);
  border-color: rgba(255, 255, 255, 0.052);
}

html[data-theme="dark"] .analytics-session-bar-row__meta,
body[data-theme="dark"] .analytics-session-bar-row__meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

html[data-theme="dark"] .analytics-session-bar-row__meta strong,
body[data-theme="dark"] .analytics-session-bar-row__meta strong {
  font-size: 14px;
  line-height: 1.1;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-session-bar-row__meta span,
body[data-theme="dark"] .analytics-session-bar-row__meta span {
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-session-bar-row__track,
body[data-theme="dark"] .analytics-session-bar-row__track {
  position: relative;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.016);
  border: 1px solid rgba(255, 255, 255, 0.032);
  overflow: hidden;
}

html[data-theme="dark"] .analytics-session-bar-row__axis,
body[data-theme="dark"] .analytics-session-bar-row__axis {
  position: absolute;
  inset: 4px auto 4px 50%;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.11);
}

html[data-theme="dark"] .analytics-session-bar-row__fill,
body[data-theme="dark"] .analytics-session-bar-row__fill {
  position: absolute;
  top: 4px;
  left: var(--session-bar-left, 50%);
  width: var(--session-bar-width, 0%);
  height: calc(100% - 8px);
  border-radius: 999px;
}

html[data-theme="dark"] .analytics-session-bar-row--positive .analytics-session-bar-row__fill,
body[data-theme="dark"] .analytics-session-bar-row--positive .analytics-session-bar-row__fill {
  background: rgba(78, 183, 120, 0.78);
}

html[data-theme="dark"] .analytics-session-bar-row--negative .analytics-session-bar-row__fill,
body[data-theme="dark"] .analytics-session-bar-row--negative .analytics-session-bar-row__fill {
  background: rgba(205, 108, 120, 0.68);
}

html[data-theme="dark"] .analytics-session-bar-row__value,
body[data-theme="dark"] .analytics-session-bar-row__value {
  min-width: 72px;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
}

html[data-theme="dark"] .analytics-session-row--elevated,
body[data-theme="dark"] .analytics-session-row--elevated,
html[data-theme="dark"] .analytics-symbol-row,
body[data-theme="dark"] .analytics-symbol-row {
  padding: 12px 13px;
  border-radius: 14px;
  background: var(--layer-1-subtle);
  border: 1px solid rgba(255, 255, 255, 0.045);
}

html[data-theme="dark"] .analytics-session-row--strongest,
body[data-theme="dark"] .analytics-session-row--strongest {
  background: color-mix(in srgb, var(--layer-1-subtle) 92%, rgba(255,255,255,0.02));
  border-color: rgba(255, 255, 255, 0.058);
}

html[data-theme="dark"] .analytics-symbol-row,
body[data-theme="dark"] .analytics-symbol-row {
  display: grid;
  gap: 8px;
}

html[data-theme="dark"] .analytics-symbol-row--best,
body[data-theme="dark"] .analytics-symbol-row--best,
html[data-theme="dark"] .analytics-symbol-row--worst,
body[data-theme="dark"] .analytics-symbol-row--worst {
  padding: 13px 14px 12px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--layer-1-subtle) 93%, rgba(255,255,255,0.018));
  border-color: rgba(255, 255, 255, 0.055);
}

html[data-theme="dark"] .analytics-symbol-row__main,
body[data-theme="dark"] .analytics-symbol-row__main,
html[data-theme="dark"] .analytics-symbol-row__aux,
body[data-theme="dark"] .analytics-symbol-row__aux {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

html[data-theme="dark"] .analytics-symbol-row__copy,
body[data-theme="dark"] .analytics-symbol-row__copy,
html[data-theme="dark"] .analytics-symbol-row__meta,
body[data-theme="dark"] .analytics-symbol-row__meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

html[data-theme="dark"] .analytics-symbol-row__copy strong,
body[data-theme="dark"] .analytics-symbol-row__copy strong,
html[data-theme="dark"] .analytics-symbol-row__meta strong,
body[data-theme="dark"] .analytics-symbol-row__meta strong {
  font-size: 15px;
  line-height: 1.1;
}

html[data-theme="dark"] .analytics-symbol-row--best .analytics-symbol-row__copy strong,
body[data-theme="dark"] .analytics-symbol-row--best .analytics-symbol-row__copy strong,
html[data-theme="dark"] .analytics-symbol-row--worst .analytics-symbol-row__copy strong,
body[data-theme="dark"] .analytics-symbol-row--worst .analytics-symbol-row__copy strong,
html[data-theme="dark"] .analytics-symbol-row--best .analytics-symbol-row__meta strong,
body[data-theme="dark"] .analytics-symbol-row--best .analytics-symbol-row__meta strong,
html[data-theme="dark"] .analytics-symbol-row--worst .analytics-symbol-row__meta strong,
body[data-theme="dark"] .analytics-symbol-row--worst .analytics-symbol-row__meta strong {
  font-size: 18px;
}

html[data-theme="dark"] .analytics-symbol-row__copy span,
body[data-theme="dark"] .analytics-symbol-row__copy span,
html[data-theme="dark"] .analytics-symbol-row__meta span,
body[data-theme="dark"] .analytics-symbol-row__meta span,
html[data-theme="dark"] .analytics-symbol-row__aux span,
body[data-theme="dark"] .analytics-symbol-row__aux span {
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-pattern-footer,
body[data-theme="dark"] .analytics-pattern-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

html[data-theme="dark"] .analytics-pattern-footer--three,
body[data-theme="dark"] .analytics-pattern-footer--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

html[data-theme="dark"] .analytics-pattern-footer--single,
body[data-theme="dark"] .analytics-pattern-footer--single {
  grid-template-columns: 1fr;
}

html[data-theme="dark"] .analytics-pattern-footer__item,
body[data-theme="dark"] .analytics-pattern-footer__item {
  padding: 12px 12px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.045);
}

html[data-theme="dark"] .analytics-pattern-footer__item span,
body[data-theme="dark"] .analytics-pattern-footer__item span {
  display: block;
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-pattern-footer__item strong,
body[data-theme="dark"] .analytics-pattern-footer__item strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-pattern-footer__item small,
body[data-theme="dark"] .analytics-pattern-footer__item small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-2);
}

@media (max-width: 860px) {
  html[data-theme="dark"] .analytics-session-bar-row,
  body[data-theme="dark"] .analytics-session-bar-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  html[data-theme="dark"] .analytics-session-bar-row__value,
  body[data-theme="dark"] .analytics-session-bar-row__value {
    text-align: left;
    min-width: 0;
  }
}

html[data-theme="dark"] .analytics-winloss-card--compact,
body[data-theme="dark"] .analytics-winloss-card--compact {
  display: grid;
  gap: 12px;
}

html[data-theme="dark"] .analytics-winloss-card--compact .analytics-winloss-summary,
body[data-theme="dark"] .analytics-winloss-card--compact .analytics-winloss-summary {
  padding: 14px 15px;
}

html[data-theme="dark"] .analytics-winloss-total,
body[data-theme="dark"] .analytics-winloss-total {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-winloss-sub,
body[data-theme="dark"] .analytics-winloss-sub {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-distribution-metrics--tight,
body[data-theme="dark"] .analytics-distribution-metrics--tight {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

html[data-theme="dark"] .analytics-distribution-metric,
body[data-theme="dark"] .analytics-distribution-metric {
  padding: 11px 12px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.045);
}

html[data-theme="dark"] .analytics-distribution-metric span,
body[data-theme="dark"] .analytics-distribution-metric span {
  display: block;
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-distribution-metric strong,
body[data-theme="dark"] .analytics-distribution-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-hour-layout,
body[data-theme="dark"] .analytics-hour-layout {
  display: grid;
  gap: 18px;
}

html[data-theme="dark"] .insights-hour-header,
body[data-theme="dark"] .insights-hour-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 16px;
  align-items: center;
}

html[data-theme="dark"] .insights-hour-header__copy,
body[data-theme="dark"] .insights-hour-header__copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

html[data-theme="dark"] .insights-hour-header__stats,
body[data-theme="dark"] .insights-hour-header__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-left: 16px;
  border-left: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

html[data-theme="dark"] .insights-hour-stat,
body[data-theme="dark"] .insights-hour-stat {
  display: grid;
  gap: 5px;
}

html[data-theme="dark"] .insights-hour-stat span,
body[data-theme="dark"] .insights-hour-stat span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .insights-hour-stat strong,
body[data-theme="dark"] .insights-hour-stat strong {
  display: block;
  font-size: 20px;
  line-height: 1.05;
  color: var(--text-0);
}

html[data-theme="dark"] .insights-hour-stat small,
body[data-theme="dark"] .insights-hour-stat small {
  display: block;
  font-size: 11px;
  color: var(--text-2);
  opacity: 0.84;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .insights-hour-stat small.analytics-value-positive,
body[data-theme="dark"] .insights-hour-stat small.analytics-value-positive,
html[data-theme="dark"] .insights-hour-stat small.analytics-value-negative,
body[data-theme="dark"] .insights-hour-stat small.analytics-value-negative {
  opacity: 0.94;
}

html[data-theme="dark"] .analytics-hour-timeline-card,
body[data-theme="dark"] .analytics-hour-timeline-card {
  overflow: hidden;
  display: grid;
  gap: 14px;
}

html[data-theme="dark"] .analytics-hour-toggle,
body[data-theme="dark"] .analytics-hour-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.018);
  border: 1px solid rgba(255,255,255,0.038);
}

html[data-theme="dark"] .analytics-hour-toggle__btn,
body[data-theme="dark"] .analytics-hour-toggle__btn {
  min-width: 28px;
  height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}

html[data-theme="dark"] .analytics-hour-toggle__btn:hover,
body[data-theme="dark"] .analytics-hour-toggle__btn:hover {
  background: rgba(255,255,255,0.035);
  color: var(--text-1);
}

html[data-theme="dark"] .analytics-hour-toggle__btn.is-active,
body[data-theme="dark"] .analytics-hour-toggle__btn.is-active {
  background: rgba(255,255,255,0.08);
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-hour-overview,
body[data-theme="dark"] .analytics-hour-overview {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  border-radius: 18px;
  background: rgba(255,255,255,0.028);
}

html[data-theme="dark"] .analytics-hour-segment,
body[data-theme="dark"] .analytics-hour-segment {
  display: grid;
  align-content: end;
  min-height: 112px;
  gap: 6px;
  padding: 12px 3px 10px;
  border-radius: 0;
  text-align: center;
  background: color-mix(in srgb, var(--layer-1-subtle) 97%, rgba(255,255,255,0.018));
  border: 0;
  box-shadow: none;
  transition: background-color 120ms ease-out;
}

html[data-theme="dark"] .analytics-hour-segment.is-positive,
body[data-theme="dark"] .analytics-hour-segment.is-positive {
  background: color-mix(in srgb, var(--layer-1-subtle) calc(100% - (var(--hour-intensity) * 34%)), rgba(43, 112, 77, 0.74) calc(var(--hour-intensity) * 34%));
}

html[data-theme="dark"] .analytics-hour-segment.is-negative,
body[data-theme="dark"] .analytics-hour-segment.is-negative {
  background: color-mix(in srgb, var(--layer-1-subtle) calc(100% - (var(--hour-intensity) * 32%)), rgba(163, 76, 88, 0.58) calc(var(--hour-intensity) * 32%));
}

html[data-theme="dark"] .analytics-hour-segment.is-empty,
body[data-theme="dark"] .analytics-hour-segment.is-empty {
  color: var(--text-2);
  background: color-mix(in srgb, var(--layer-1-subtle) 99.5%, rgba(255,255,255,0.005));
  opacity: 0.28;
}

html[data-theme="dark"] .analytics-hour-segment:hover,
body[data-theme="dark"] .analytics-hour-segment:hover {
  background-color: rgba(255,255,255,0.025);
}

html[data-theme="dark"] .analytics-hour-segment__time,
body[data-theme="dark"] .analytics-hour-segment__time {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-2);
  opacity: 0.9;
}

html[data-theme="dark"] .analytics-hour-segment strong,
body[data-theme="dark"] .analytics-hour-segment strong {
  display: block;
  font-size: 11px;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

html[data-theme="dark"] .analytics-hour-insight-grid,
body[data-theme="dark"] .analytics-hour-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 18px;
}

html[data-theme="dark"] .analytics-hour-insight-grid--reading,
body[data-theme="dark"] .analytics-hour-insight-grid--reading {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

html[data-theme="dark"] .analytics-hour-copy-card,
body[data-theme="dark"] .analytics-hour-copy-card {
  display: grid;
  gap: 8px;
}

html[data-theme="dark"] .analytics-hour-copy-card .tl-section-title,
body[data-theme="dark"] .analytics-hour-copy-card .tl-section-title {
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-hour-copy-card--reading .tl-section-title,
body[data-theme="dark"] .analytics-hour-copy-card--reading .tl-section-title {
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-hour-copy-card--reading,
body[data-theme="dark"] .analytics-hour-copy-card--reading {
  grid-template-columns: minmax(112px, 0.22fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  background: color-mix(in srgb, var(--card-surface) 82%, transparent);
  border-color: rgba(255,255,255,0.035);
}

html[data-theme="dark"] .insights-hour-reading__label,
body[data-theme="dark"] .insights-hour-reading__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-hour-copy-card--decision .tl-section-title,
body[data-theme="dark"] .analytics-hour-copy-card--decision .tl-section-title {
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-hour-insights,
body[data-theme="dark"] .analytics-hour-insights {
  display: grid;
  gap: 8px;
}

html[data-theme="dark"] .analytics-hour-copy-card--reading .analytics-hour-insights,
body[data-theme="dark"] .analytics-hour-copy-card--reading .analytics-hour-insights {
  gap: 4px;
}

html[data-theme="dark"] .analytics-hour-insights p,
body[data-theme="dark"] .analytics-hour-insights p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-hour-insights p.is-lead,
body[data-theme="dark"] .analytics-hour-insights p.is-lead {
  color: var(--text-0);
  font-weight: 550;
}

html[data-theme="dark"] .analytics-hour-copy-card--reading .analytics-hour-insights p,
body[data-theme="dark"] .analytics-hour-copy-card--reading .analytics-hour-insights p {
  font-size: 12px;
  line-height: 1.4;
}

html[data-theme="dark"] .analytics-hour-copy-card--decision,
body[data-theme="dark"] .analytics-hour-copy-card--decision {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.012)),
    var(--card-surface);
}

html[data-theme="dark"] .analytics-hour-decision,
body[data-theme="dark"] .analytics-hour-decision {
  display: grid;
  align-content: center;
  min-height: 100%;
}

html[data-theme="dark"] .analytics-hour-decision strong,
body[data-theme="dark"] .analytics-hour-decision strong {
  font-size: 20px;
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-hour-segment.is-window-start,
body[data-theme="dark"] .analytics-hour-segment.is-window-start,
html[data-theme="dark"] .analytics-hour-segment.is-window-mid,
body[data-theme="dark"] .analytics-hour-segment.is-window-mid,
html[data-theme="dark"] .analytics-hour-segment.is-window-end,
body[data-theme="dark"] .analytics-hour-segment.is-window-end {
  position: relative;
  z-index: 1;
}

html[data-theme="dark"] .analytics-hour-segment.is-window-start::after,
body[data-theme="dark"] .analytics-hour-segment.is-window-start::after,
html[data-theme="dark"] .analytics-hour-segment.is-window-mid::after,
body[data-theme="dark"] .analytics-hour-segment.is-window-mid::after,
html[data-theme="dark"] .analytics-hour-segment.is-window-end::after,
body[data-theme="dark"] .analytics-hour-segment.is-window-end::after {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.042);
  pointer-events: none;
}

html[data-theme="dark"] .analytics-hour-segment.is-window-start::after,
body[data-theme="dark"] .analytics-hour-segment.is-window-start::after {
  left: 2px;
  right: -1px;
  border-right: 0;
  border-radius: 12px 0 0 12px;
}

html[data-theme="dark"] .analytics-hour-segment.is-window-mid::after,
body[data-theme="dark"] .analytics-hour-segment.is-window-mid::after {
  left: -1px;
  right: -1px;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

html[data-theme="dark"] .analytics-hour-segment.is-window-end::after,
body[data-theme="dark"] .analytics-hour-segment.is-window-end::after {
  left: -1px;
  right: 2px;
  border-left: 0;
  border-radius: 0 12px 12px 0;
}

html[data-theme="dark"] .analytics-hour-segment.is-worst,
body[data-theme="dark"] .analytics-hour-segment.is-worst {
  box-shadow:
    inset 0 -3px 0 rgba(199, 100, 112, 0.38),
    inset 0 0 0 1px rgba(199, 100, 112, 0.06);
}

html[data-theme="dark"] .analytics-hour-segment.is-best,
body[data-theme="dark"] .analytics-hour-segment.is-best {
  background: color-mix(in srgb, var(--layer-1-subtle) calc(100% - (var(--hour-intensity) * 42%)), rgba(43, 112, 77, 0.86) calc(var(--hour-intensity) * 42%));
}

html[data-theme="dark"] .analytics-hour-segment.is-best strong,
body[data-theme="dark"] .analytics-hour-segment.is-best strong {
  font-size: 12px;
  font-weight: 700;
  opacity: 1;
}

html[data-theme="dark"] .analytics-hour-segment.is-worst strong,
body[data-theme="dark"] .analytics-hour-segment.is-worst strong {
  opacity: 1;
}

html[data-theme="dark"] .analytics-hour-detail-shell,
body[data-theme="dark"] .analytics-hour-detail-shell {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.038);
}

html[data-theme="dark"] .analytics-hour-timeline-card .tl-section-title::before,
body[data-theme="dark"] .analytics-hour-timeline-card .tl-section-title::before,
html[data-theme="dark"] .analytics-hour-copy-card--reading .tl-section-title::before,
body[data-theme="dark"] .analytics-hour-copy-card--reading .tl-section-title::before {
  display: none;
  content: none;
}

html[data-theme="dark"] .analytics-hour-detail-shell__head,
body[data-theme="dark"] .analytics-hour-detail-shell__head {
  display: grid;
  gap: 4px;
}

html[data-theme="dark"] .analytics-hour-detail-list,
body[data-theme="dark"] .analytics-hour-detail-list {
  display: grid;
  gap: 5px;
}

html[data-theme="dark"] .analytics-hour-detail-row,
body[data-theme="dark"] .analytics-hour-detail-row {
  display: grid;
  grid-template-columns: 64px minmax(86px, 108px) 1fr;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--layer-1-subtle) 96%, rgba(255,255,255,0.014));
}

html[data-theme="dark"] .analytics-hour-detail-row--leader,
body[data-theme="dark"] .analytics-hour-detail-row--leader {
  padding-top: 9px;
  padding-bottom: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.012)),
    color-mix(in srgb, var(--layer-1-subtle) 92%, rgba(43, 112, 77, 0.06));
  border: 1px solid rgba(255,255,255,0.05);
}

html[data-theme="dark"] .analytics-hour-detail-row--leader .analytics-hour-detail-row__time,
body[data-theme="dark"] .analytics-hour-detail-row--leader .analytics-hour-detail-row__time,
html[data-theme="dark"] .analytics-hour-detail-row--leader .analytics-hour-detail-row__value,
body[data-theme="dark"] .analytics-hour-detail-row--leader .analytics-hour-detail-row__value {
  font-size: 14px;
}

html[data-theme="dark"] .analytics-hour-detail-row--support,
body[data-theme="dark"] .analytics-hour-detail-row--support {
  opacity: 0.88;
}

html[data-theme="dark"] .analytics-hour-detail-row--weak,
body[data-theme="dark"] .analytics-hour-detail-row--weak {
  margin-top: 5px;
  padding-top: 9px;
  padding-bottom: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0.008)),
    color-mix(in srgb, var(--layer-1-subtle) 93%, rgba(154, 46, 60, 0.07));
  border: 1px solid rgba(214, 86, 102, 0.12);
}

html[data-theme="dark"] .analytics-hour-detail-row__time,
body[data-theme="dark"] .analytics-hour-detail-row__time {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-hour-detail-row__value,
body[data-theme="dark"] .analytics-hour-detail-row__value {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .analytics-hour-detail-row__metric,
body[data-theme="dark"] .analytics-hour-detail-row__metric {
  display: grid;
  gap: 3px;
}

html[data-theme="dark"] .analytics-hour-detail-row__metric small,
body[data-theme="dark"] .analytics-hour-detail-row__metric small {
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .analytics-hour-detail-row__label,
body[data-theme="dark"] .analytics-hour-detail-row__label {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-hour-copy-card .tl-section-header .row-sub,
body[data-theme="dark"] .analytics-hour-copy-card .tl-section-header .row-sub {
  display: none;
}

html[data-theme="dark"] .analytics-risk-layout,
body[data-theme="dark"] .analytics-risk-layout {
  display: grid;
  gap: 14px;
}

html[data-theme="dark"] .analytics-risk-hero,
body[data-theme="dark"] .analytics-risk-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.26fr) minmax(300px, 0.62fr);
  gap: 18px;
  align-items: start;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.012)),
    var(--card-surface);
}

html[data-theme="dark"] .analytics-risk-hero--safe,
body[data-theme="dark"] .analytics-risk-hero--safe {
  background:
    radial-gradient(circle at top right, rgba(48, 110, 82, 0.12), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.012)),
    var(--card-surface);
}

html[data-theme="dark"] .analytics-risk-hero--warning,
body[data-theme="dark"] .analytics-risk-hero--warning {
  background:
    radial-gradient(circle at top right, rgba(255, 159, 10, 0.10), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.012)),
    var(--card-surface);
}

html[data-theme="dark"] .analytics-risk-hero--critical,
body[data-theme="dark"] .analytics-risk-hero--critical {
  background:
    radial-gradient(circle at top right, rgba(154, 46, 60, 0.16), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.012)),
    var(--card-surface);
}

html[data-theme="dark"] .analytics-risk-hero__copy,
body[data-theme="dark"] .analytics-risk-hero__copy {
  display: grid;
  gap: 10px;
  align-content: start;
}

html[data-theme="dark"] .analytics-risk-hero__copy h3,
body[data-theme="dark"] .analytics-risk-hero__copy h3 {
  margin: 0;
  font-size: 34px;
  line-height: 0.98;
  letter-spacing: -0.045em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-risk-hero__copy p,
body[data-theme="dark"] .analytics-risk-hero__copy p {
  margin: 0;
  max-width: 52ch;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-risk-hero__alerts,
body[data-theme="dark"] .analytics-risk-hero__alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

html[data-theme="dark"] .analytics-risk-hero__signal,
body[data-theme="dark"] .analytics-risk-hero__signal {
  display: grid;
  align-content: start;
  align-self: center;
  gap: 4px;
  min-height: 0;
  max-width: 460px;
  padding: 14px 16px 13px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.024), rgba(255,255,255,0.008)),
    rgba(255,255,255,0.018);
  border: 1px solid rgba(255,255,255,0.045);
}

html[data-theme="dark"] .analytics-risk-hero__signal.is-loss-streak,
body[data-theme="dark"] .analytics-risk-hero__signal.is-loss-streak {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.022), rgba(255,255,255,0.008)),
    color-mix(in srgb, var(--layer-1-subtle) 92%, rgba(154, 46, 60, 0.08));
  border-color: rgba(214, 86, 102, 0.14);
}

html[data-theme="dark"] .analytics-risk-hero__signal-label,
body[data-theme="dark"] .analytics-risk-hero__signal-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-risk-hero__signal strong,
body[data-theme="dark"] .analytics-risk-hero__signal strong {
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-risk-hero__signal small,
body[data-theme="dark"] .analytics-risk-hero__signal small {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-risk-kpis,
body[data-theme="dark"] .analytics-risk-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

html[data-theme="dark"] .analytics-risk-kpi,
body[data-theme="dark"] .analytics-risk-kpi {
  display: grid;
  gap: 8px;
  min-height: 118px;
}

html[data-theme="dark"] .analytics-risk-kpi__label,
body[data-theme="dark"] .analytics-risk-kpi__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-risk-kpi__value,
body[data-theme="dark"] .analytics-risk-kpi__value {
  font-size: 30px;
  line-height: 0.96;
  letter-spacing: -0.05em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-risk-kpi small,
body[data-theme="dark"] .analytics-risk-kpi small {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-risk-kpi__note-value,
body[data-theme="dark"] .analytics-risk-kpi__note-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .analytics-risk-kpi__note-value--positive,
body[data-theme="dark"] .analytics-risk-kpi__note-value--positive {
  color: color-mix(in srgb, var(--positive) 78%, var(--text-1));
}

html[data-theme="dark"] .analytics-risk-kpi__note-value--warning,
body[data-theme="dark"] .analytics-risk-kpi__note-value--warning {
  color: color-mix(in srgb, var(--warning) 78%, var(--text-1));
}

html[data-theme="dark"] .analytics-risk-kpi__note-value--negative,
body[data-theme="dark"] .analytics-risk-kpi__note-value--negative {
  color: color-mix(in srgb, var(--negative) 78%, var(--text-1));
}

html[data-theme="dark"] .analytics-risk-grid,
body[data-theme="dark"] .analytics-risk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
  gap: 14px;
  align-items: start;
}

html[data-theme="dark"] .analytics-risk-behavior,
body[data-theme="dark"] .analytics-risk-behavior {
  display: grid;
  gap: 14px;
}

html[data-theme="dark"] .analytics-risk-behavior__list,
body[data-theme="dark"] .analytics-risk-behavior__list {
  display: grid;
  gap: 12px;
}

html[data-theme="dark"] .analytics-risk-behavior-row,
body[data-theme="dark"] .analytics-risk-behavior-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  padding: 14px 15px 13px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--layer-1-subtle) 96%, rgba(255,255,255,0.016));
  border: 1px solid rgba(255,255,255,0.035);
  opacity: 0.84;
}

html[data-theme="dark"] .analytics-risk-behavior-row.is-dominant,
body[data-theme="dark"] .analytics-risk-behavior-row.is-dominant {
  padding-top: 16px;
  padding-bottom: 15px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.024), rgba(255,255,255,0.01)),
    color-mix(in srgb, var(--layer-1-subtle) 94%, rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.052);
  opacity: 1;
}

html[data-theme="dark"] .analytics-risk-behavior-row__copy,
body[data-theme="dark"] .analytics-risk-behavior-row__copy {
  display: grid;
  gap: 4px;
}

html[data-theme="dark"] .analytics-risk-behavior-row__copy strong,
body[data-theme="dark"] .analytics-risk-behavior-row__copy strong {
  font-size: 14px;
  line-height: 1.2;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-risk-behavior-row__copy span,
body[data-theme="dark"] .analytics-risk-behavior-row__copy span {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-risk-behavior-row__metric,
body[data-theme="dark"] .analytics-risk-behavior-row__metric {
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
}

html[data-theme="dark"] .analytics-risk-behavior-row__metric strong,
body[data-theme="dark"] .analytics-risk-behavior-row__metric strong {
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .analytics-risk-behavior-row__metric strong span,
body[data-theme="dark"] .analytics-risk-behavior-row__metric strong span {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-risk-behavior-row__metric small,
body[data-theme="dark"] .analytics-risk-behavior-row__metric small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-risk-behavior-row--warning .analytics-risk-behavior-row__metric small,
body[data-theme="dark"] .analytics-risk-behavior-row--warning .analytics-risk-behavior-row__metric small {
  color: color-mix(in srgb, var(--warning) 76%, var(--text-1));
}

html[data-theme="dark"] .analytics-risk-behavior-row--critical .analytics-risk-behavior-row__metric small,
body[data-theme="dark"] .analytics-risk-behavior-row--critical .analytics-risk-behavior-row__metric small {
  color: color-mix(in srgb, var(--negative) 78%, var(--text-1));
}

html[data-theme="dark"] .analytics-risk-behavior-row__track,
body[data-theme="dark"] .analytics-risk-behavior-row__track {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.035);
}

html[data-theme="dark"] .analytics-risk-behavior-row__track span,
body[data-theme="dark"] .analytics-risk-behavior-row__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgba(255,255,255,0.11);
}

html[data-theme="dark"] .analytics-risk-behavior-row--stable .analytics-risk-behavior-row__track span,
body[data-theme="dark"] .analytics-risk-behavior-row--stable .analytics-risk-behavior-row__track span {
  background: color-mix(in srgb, var(--positive) 44%, rgba(255,255,255,0.16));
}

html[data-theme="dark"] .analytics-risk-behavior-row--warning .analytics-risk-behavior-row__track span,
body[data-theme="dark"] .analytics-risk-behavior-row--warning .analytics-risk-behavior-row__track span {
  background: color-mix(in srgb, var(--warning) 48%, rgba(255,255,255,0.16));
}

html[data-theme="dark"] .analytics-risk-behavior-row--critical,
body[data-theme="dark"] .analytics-risk-behavior-row--critical {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.008)),
    color-mix(in srgb, var(--layer-1-subtle) 93%, rgba(154, 46, 60, 0.06));
}

html[data-theme="dark"] .analytics-risk-behavior-row--critical .analytics-risk-behavior-row__track span,
body[data-theme="dark"] .analytics-risk-behavior-row--critical .analytics-risk-behavior-row__track span {
  background: color-mix(in srgb, var(--negative) 54%, rgba(255,255,255,0.18));
}

html[data-theme="dark"] .analytics-risk-behavior-row.is-dominant .analytics-risk-behavior-row__track,
body[data-theme="dark"] .analytics-risk-behavior-row.is-dominant .analytics-risk-behavior-row__track {
  background: rgba(255,255,255,0.048);
}

html[data-theme="dark"] .analytics-risk-behavior-row.is-dominant .analytics-risk-behavior-row__track span,
body[data-theme="dark"] .analytics-risk-behavior-row.is-dominant .analytics-risk-behavior-row__track span {
  filter: none;
}

html[data-theme="dark"] .analytics-risk-side,
body[data-theme="dark"] .analytics-risk-side {
  display: grid;
  gap: 14px;
}

html[data-theme="dark"] .analytics-risk-copy-card,
body[data-theme="dark"] .analytics-risk-copy-card {
  display: grid;
  gap: 8px;
  border-color: rgba(255,255,255,0.035);
}

html[data-theme="dark"] .analytics-risk-copy-card p,
body[data-theme="dark"] .analytics-risk-copy-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.48;
  color: color-mix(in srgb, var(--text-2) 94%, var(--text-1));
}

html[data-theme="dark"] .analytics-risk-copy-card--decision,
body[data-theme="dark"] .analytics-risk-copy-card--decision {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.012)),
    var(--card-surface);
  border-color: rgba(255,255,255,0.05);
}

html[data-theme="dark"] .analytics-risk-copy-card .tl-section-title,
body[data-theme="dark"] .analytics-risk-copy-card .tl-section-title {
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-risk-copy-card--decision .tl-section-title,
body[data-theme="dark"] .analytics-risk-copy-card--decision .tl-section-title {
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-risk-decision,
body[data-theme="dark"] .analytics-risk-decision {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 100%;
}

html[data-theme="dark"] .analytics-risk-decision strong,
body[data-theme="dark"] .analytics-risk-decision strong {
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -0.04em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-risk-engine,
body[data-theme="dark"] .analytics-risk-engine {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

html[data-theme="dark"] .analytics-risk-engine__meta,
body[data-theme="dark"] .analytics-risk-engine__meta {
  display: grid;
  gap: 8px;
}

html[data-theme="dark"] .analytics-risk-engine__state,
body[data-theme="dark"] .analytics-risk-engine__state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-1);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme="dark"] .analytics-risk-engine__state--positive,
body[data-theme="dark"] .analytics-risk-engine__state--positive {
  color: color-mix(in srgb, var(--positive) 78%, var(--text-1));
  border-color: rgba(52, 217, 123, 0.22);
  background: rgba(52, 217, 123, 0.10);
}

html[data-theme="dark"] .analytics-risk-engine__state--warning,
body[data-theme="dark"] .analytics-risk-engine__state--warning {
  color: color-mix(in srgb, var(--warning) 78%, var(--text-1));
  border-color: rgba(255, 176, 32, 0.18);
  background: rgba(255, 176, 32, 0.09);
}

html[data-theme="dark"] .analytics-risk-engine__state--neutral,
body[data-theme="dark"] .analytics-risk-engine__state--neutral,
html[data-theme="dark"] .analytics-risk-engine__state--info,
body[data-theme="dark"] .analytics-risk-engine__state--info {
  color: var(--text-1);
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
}

html[data-theme="dark"] .analytics-risk-engine__meta small,
body[data-theme="dark"] .analytics-risk-engine__meta small {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-risk-engine__rules-header,
body[data-theme="dark"] .analytics-risk-engine__rules-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

html[data-theme="dark"] .analytics-risk-engine__rules-header span,
body[data-theme="dark"] .analytics-risk-engine__rules-header span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-risk-engine__rules-header em,
body[data-theme="dark"] .analytics-risk-engine__rules-header em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-risk-engine__rules,
body[data-theme="dark"] .analytics-risk-engine__rules {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

html[data-theme="dark"] .analytics-risk-engine__rules li,
body[data-theme="dark"] .analytics-risk-engine__rules li {
  display: grid;
  gap: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.018);
}

html[data-theme="dark"] .analytics-risk-engine__rules li strong,
body[data-theme="dark"] .analytics-risk-engine__rules li strong {
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-risk-engine__footer,
body[data-theme="dark"] .analytics-risk-engine__footer {
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] .analytics-risk-engine__footer small,
body[data-theme="dark"] .analytics-risk-engine__footer small {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-risk-engine__action,
body[data-theme="dark"] .analytics-risk-engine__action {
  width: fit-content;
}

html[data-theme="dark"] .insights-control .tl-section-title::before,
body[data-theme="dark"] .insights-control .tl-section-title::before {
  display: none;
  content: none;
}

html[data-theme="dark"] .insights-control__status,
body[data-theme="dark"] .insights-control__status,
html[data-theme="dark"] .insights-control__status.analytics-risk-hero--safe,
body[data-theme="dark"] .insights-control__status.analytics-risk-hero--safe,
html[data-theme="dark"] .insights-control__status.analytics-risk-hero--warning,
body[data-theme="dark"] .insights-control__status.analytics-risk-hero--warning,
html[data-theme="dark"] .insights-control__status.analytics-risk-hero--critical,
body[data-theme="dark"] .insights-control__status.analytics-risk-hero--critical {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.024), rgba(255,255,255,0.01)),
    var(--card-surface);
}

html[data-theme="dark"] .insights-control__status .analytics-risk-hero__copy,
body[data-theme="dark"] .insights-control__status .analytics-risk-hero__copy {
  gap: 9px;
}

html[data-theme="dark"] .insights-control__status .analytics-risk-hero__copy h3,
body[data-theme="dark"] .insights-control__status .analytics-risk-hero__copy h3 {
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0;
}

html[data-theme="dark"] .insights-control__evidence,
body[data-theme="dark"] .insights-control__evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

html[data-theme="dark"] .insights-control__badge,
body[data-theme="dark"] .insights-control__badge {
  display: inline-grid;
  gap: 2px;
  min-width: 104px;
  padding: 7px 9px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: rgba(255,255,255,0.018);
}

html[data-theme="dark"] .insights-control__badge small,
body[data-theme="dark"] .insights-control__badge small {
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-2);
}

html[data-theme="dark"] .insights-control__badge strong,
body[data-theme="dark"] .insights-control__badge strong {
  font-size: 13px;
  line-height: 1.15;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .insights-control__badge--positive strong,
body[data-theme="dark"] .insights-control__badge--positive strong {
  color: color-mix(in srgb, var(--positive) 78%, var(--text-1));
}

html[data-theme="dark"] .insights-control__badge--warning strong,
body[data-theme="dark"] .insights-control__badge--warning strong {
  color: color-mix(in srgb, var(--warning) 78%, var(--text-1));
}

html[data-theme="dark"] .insights-control__badge--negative strong,
body[data-theme="dark"] .insights-control__badge--negative strong {
  color: color-mix(in srgb, var(--negative) 78%, var(--text-1));
}

html[data-theme="dark"] .insights-control__status .analytics-risk-hero__signal,
body[data-theme="dark"] .insights-control__status .analytics-risk-hero__signal {
  max-width: none;
  border-radius: 14px;
}

html[data-theme="dark"] .insights-control__status .analytics-risk-hero__signal strong,
body[data-theme="dark"] .insights-control__status .analytics-risk-hero__signal strong {
  font-size: 20px;
  letter-spacing: 0;
}

html[data-theme="dark"] .insights-control-metrics,
body[data-theme="dark"] .insights-control-metrics {
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] .insights-control-metrics__grid,
body[data-theme="dark"] .insights-control-metrics__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

html[data-theme="dark"] .insights-control-metrics__group,
body[data-theme="dark"] .insights-control-metrics__group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 10px 11px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
  background: color-mix(in srgb, var(--layer-1-subtle) 94%, rgba(255,255,255,0.018));
}

html[data-theme="dark"] .insights-control-metrics__group h4,
body[data-theme="dark"] .insights-control-metrics__group h4 {
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .insights-control-metrics__list,
body[data-theme="dark"] .insights-control-metrics__list {
  display: grid;
  gap: 0;
}

html[data-theme="dark"] .insights-control-metric,
body[data-theme="dark"] .insights-control-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

html[data-theme="dark"] .insights-control-metric + .insights-control-metric,
body[data-theme="dark"] .insights-control-metric + .insights-control-metric {
  border-top: 1px solid color-mix(in srgb, var(--border) 48%, transparent);
}

html[data-theme="dark"] .insights-control-metric span,
body[data-theme="dark"] .insights-control-metric span,
html[data-theme="dark"] .insights-control-metric small,
body[data-theme="dark"] .insights-control-metric small {
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-2);
}

html[data-theme="dark"] .insights-control-metric__value,
body[data-theme="dark"] .insights-control-metric__value {
  display: grid;
  gap: 1px;
  justify-items: end;
  text-align: right;
  min-width: max-content;
}

html[data-theme="dark"] .insights-control-metric strong,
body[data-theme="dark"] .insights-control-metric strong {
  font-size: 14px;
  line-height: 1.18;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .insights-control-metric strong.metric-positive,
body[data-theme="dark"] .insights-control-metric strong.metric-positive {
  color: color-mix(in srgb, var(--positive) 80%, var(--text-1));
}

html[data-theme="dark"] .insights-control-metric strong.metric-negative,
body[data-theme="dark"] .insights-control-metric strong.metric-negative {
  color: color-mix(in srgb, var(--negative) 82%, var(--text-1));
}

html[data-theme="dark"] .insights-control-metric__text--warning,
body[data-theme="dark"] .insights-control-metric__text--warning {
  color: color-mix(in srgb, var(--warning) 80%, var(--text-1));
}

html[data-theme="dark"] .insights-control-signals .tl-section-header,
body[data-theme="dark"] .insights-control-signals .tl-section-header {
  margin-bottom: 8px;
}

html[data-theme="dark"] .insights-control-signals,
body[data-theme="dark"] .insights-control-signals {
  align-content: start;
  gap: 10px;
  padding-bottom: 14px;
}

html[data-theme="dark"] .insights-control-signals .analytics-risk-behavior__list,
body[data-theme="dark"] .insights-control-signals .analytics-risk-behavior__list {
  gap: 7px;
}

html[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row,
body[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row {
  gap: 6px 14px;
  padding: 9px 12px;
  border-radius: 14px;
}

html[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row.is-dominant,
body[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row.is-dominant {
  padding-top: 10px;
  padding-bottom: 10px;
}

html[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row__copy strong,
body[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row__copy strong {
  font-size: 13px;
}

html[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row__copy span,
body[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row__copy span {
  font-size: 11px;
  line-height: 1.38;
}

html[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row__metric strong,
body[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row__metric strong {
  font-size: 14px;
}

html[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row__metric small,
body[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row__metric small {
  font-size: 10px;
}

html[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row__track,
body[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row__track {
  height: 3px;
  background: rgba(255,255,255,0.026);
}

html[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row--warning .analytics-risk-behavior-row__track span,
body[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row--warning .analytics-risk-behavior-row__track span {
  background: color-mix(in srgb, var(--warning) 38%, rgba(255,255,255,0.16));
}

html[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row--critical .analytics-risk-behavior-row__track span,
body[data-theme="dark"] .insights-control-signals .analytics-risk-behavior-row--critical .analytics-risk-behavior-row__track span {
  background: color-mix(in srgb, var(--negative) 40%, rgba(255,255,255,0.18));
}

html[data-theme="dark"] .insights-control-reading,
body[data-theme="dark"] .insights-control-reading {
  align-content: start;
  gap: 9px;
}

html[data-theme="dark"] .insights-control-reading__evidence,
body[data-theme="dark"] .insights-control-reading__evidence {
  display: grid;
  gap: 0;
  margin-top: 2px;
  border-top: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .insights-control-reading__evidence div,
body[data-theme="dark"] .insights-control-reading__evidence div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
}

html[data-theme="dark"] .insights-control-reading__evidence div + div,
body[data-theme="dark"] .insights-control-reading__evidence div + div {
  border-top: 1px solid color-mix(in srgb, var(--border) 46%, transparent);
}

html[data-theme="dark"] .insights-control-reading__evidence span,
body[data-theme="dark"] .insights-control-reading__evidence span {
  font-size: 11px;
  line-height: 1.25;
  color: var(--text-2);
}

html[data-theme="dark"] .insights-control-reading__evidence strong,
body[data-theme="dark"] .insights-control-reading__evidence strong {
  font-size: 12px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .insights-control-risk-engine,
body[data-theme="dark"] .insights-control-risk-engine {
  gap: 10px;
}

html[data-theme="dark"] .insights-control-risk-engine .analytics-risk-engine,
body[data-theme="dark"] .insights-control-risk-engine .analytics-risk-engine {
  padding-top: 0;
  border-top: 0;
}

html[data-theme="dark"] .insights-control-risk-engine__evidence,
body[data-theme="dark"] .insights-control-risk-engine__evidence {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

html[data-theme="dark"] .insights-control-risk-engine__evidence div,
body[data-theme="dark"] .insights-control-risk-engine__evidence div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 64%, transparent);
  background: rgba(255,255,255,0.018);
}

html[data-theme="dark"] .insights-control-risk-engine__evidence span,
body[data-theme="dark"] .insights-control-risk-engine__evidence span {
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-2);
}

html[data-theme="dark"] .insights-control-risk-engine__evidence strong,
body[data-theme="dark"] .insights-control-risk-engine__evidence strong {
  font-size: 12px;
  line-height: 1.25;
  color: var(--text-0);
}

html[data-theme="dark"] .insights-control-risk-engine .analytics-risk-engine__footer,
body[data-theme="dark"] .insights-control-risk-engine .analytics-risk-engine__footer {
  gap: 8px;
}

html[data-theme="dark"] .insights-control-risk-engine .analytics-risk-engine__action,
body[data-theme="dark"] .insights-control-risk-engine .analytics-risk-engine__action {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  background: var(--accent);
  color: #ffffff;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
}

html[data-theme="dark"] .insights-control-risk-engine .analytics-risk-engine__action:hover,
body[data-theme="dark"] .insights-control-risk-engine .analytics-risk-engine__action:hover {
  filter: brightness(1.08);
  color: #ffffff;
}

html[data-theme="dark"] .analytics-timing-hero,
body[data-theme="dark"] .analytics-timing-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

html[data-theme="dark"] .analytics-timing-list,
body[data-theme="dark"] .analytics-timing-list {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

html[data-theme="dark"] .analytics-timing-row,
body[data-theme="dark"] .analytics-timing-row {
  padding: 12px 13px;
  border-radius: 14px;
  background: var(--layer-1-subtle);
  border: 1px solid rgba(255, 255, 255, 0.045);
}

html[data-theme="dark"] .analytics-timing-row--best,
body[data-theme="dark"] .analytics-timing-row--best,
html[data-theme="dark"] .analytics-timing-row--worst,
body[data-theme="dark"] .analytics-timing-row--worst {
  background: color-mix(in srgb, var(--layer-1-subtle) 92%, rgba(255,255,255,0.018));
  border-color: rgba(255, 255, 255, 0.055);
}

html[data-theme="dark"] .analytics-timing-row__main,
body[data-theme="dark"] .analytics-timing-row__main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

html[data-theme="dark"] .analytics-timing-row__copy,
body[data-theme="dark"] .analytics-timing-row__copy,
html[data-theme="dark"] .analytics-timing-row__meta,
body[data-theme="dark"] .analytics-timing-row__meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

html[data-theme="dark"] .analytics-timing-row__copy strong,
body[data-theme="dark"] .analytics-timing-row__copy strong,
html[data-theme="dark"] .analytics-timing-row__meta strong,
body[data-theme="dark"] .analytics-timing-row__meta strong {
  font-size: 16px;
  line-height: 1.1;
}

html[data-theme="dark"] .analytics-timing-row__copy span,
body[data-theme="dark"] .analytics-timing-row__copy span,
html[data-theme="dark"] .analytics-timing-row__meta span,
body[data-theme="dark"] .analytics-timing-row__meta span {
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-timing-row__copy span:empty,
body[data-theme="dark"] .analytics-timing-row__copy span:empty {
  display: none;
}

html[data-theme="dark"] .analytics-session-rail--timing,
body[data-theme="dark"] .analytics-session-rail--timing {
  margin-top: 10px;
}

html[data-theme="dark"] .analytics-timing-stat--insight,
body[data-theme="dark"] .analytics-timing-stat--insight {
  background: rgba(255, 255, 255, 0.022);
}

html[data-theme="dark"] .analytics-timing-stat,
body[data-theme="dark"] .analytics-timing-stat,
html[data-theme="dark"] .analytics-distribution-metric,
body[data-theme="dark"] .analytics-distribution-metric {
  padding: 12px 12px 11px;
  border-radius: 14px;
  background: var(--layer-1-subtle);
  border: 1px solid rgba(255, 255, 255, 0.045);
}

html[data-theme="dark"] .analytics-timing-stat span,
body[data-theme="dark"] .analytics-timing-stat span,
html[data-theme="dark"] .analytics-distribution-metric span,
body[data-theme="dark"] .analytics-distribution-metric span {
  display: block;
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-timing-stat strong,
body[data-theme="dark"] .analytics-timing-stat strong,
html[data-theme="dark"] .analytics-distribution-metric strong,
body[data-theme="dark"] .analytics-distribution-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

html[data-theme="dark"] .analytics-timing-stat small,
body[data-theme="dark"] .analytics-timing-stat small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .analytics-timing-chart,
body[data-theme="dark"] .analytics-timing-chart,
html[data-theme="dark"] .analytics-distribution-chart,
body[data-theme="dark"] .analytics-distribution-chart {
  min-width: 0;
  margin-top: 4px;
}

html[data-theme="dark"] .analytics-timing-chart .kmfx-chart-shell,
body[data-theme="dark"] .analytics-timing-chart .kmfx-chart-shell,
html[data-theme="dark"] .analytics-distribution-chart .kmfx-chart-shell,
body[data-theme="dark"] .analytics-distribution-chart .kmfx-chart-shell,
html[data-theme="dark"] #page-analytics [data-tab="hourly"] .kmfx-chart-shell,
body[data-theme="dark"] #page-analytics [data-tab="hourly"] .kmfx-chart-shell {
  padding: 2px 0 0;
}

html[data-theme="dark"] .analytics-distribution-metrics,
body[data-theme="dark"] .analytics-distribution-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

html[data-theme="dark"] .analytics-distribution-metrics--tight,
body[data-theme="dark"] .analytics-distribution-metrics--tight {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

html[data-theme="dark"] .analytics-symbol-row--secondary,
body[data-theme="dark"] .analytics-symbol-row--secondary {
  opacity: 0.7;
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day {
  min-height: 102px;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, box-shadow 120ms ease-out;
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades:hover,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades:hover {
  border-color: rgba(255,255,255,0.085);
  background-color: rgba(255,255,255,0.026);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-key-day,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-key-day {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.045);
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-key-day.is-selected,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-key-day.is-selected {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-selected,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-selected {
  border-color: rgba(255,255,255,0.12);
  background-color: rgba(255,255,255,0.032);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 0 0 1px rgba(255,255,255,0.02);
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-selected:hover,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-selected:hover {
  background-color: rgba(255,255,255,0.034);
}

html[data-theme="dark"] .main-panel,
body[data-theme="dark"] .main-panel,
html[data-theme="dark"] .content,
body[data-theme="dark"] .content {
  overflow-x: hidden !important;
}

html,
body {
  overflow-x: hidden;
}

@keyframes analytics-detail-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes analytics-detail-value-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


html[data-theme="dark"] #page-analytics .tl-tab-bar,
body[data-theme="dark"] #page-analytics .tl-tab-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.045);
}

html[data-theme="dark"] #page-analytics .tl-tab,
body[data-theme="dark"] #page-analytics .tl-tab {
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

html[data-theme="dark"] #page-analytics .tl-tab:hover,
body[data-theme="dark"] #page-analytics .tl-tab:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-1);
}

html[data-theme="dark"] #page-analytics .tl-tab.active,
body[data-theme="dark"] #page-analytics .tl-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

@media (max-width: 1080px) {
  html[data-theme="dark"] .analytics-overview-hero__grid,
  body[data-theme="dark"] .analytics-overview-hero__grid,
  html[data-theme="dark"] .analytics-daily-layout,
  body[data-theme="dark"] .analytics-daily-layout,
  html[data-theme="dark"] .insights-hour-header,
  body[data-theme="dark"] .insights-hour-header,
  html[data-theme="dark"] .analytics-hour-insight-grid,
  body[data-theme="dark"] .analytics-hour-insight-grid,
  html[data-theme="dark"] .analytics-risk-hero,
  body[data-theme="dark"] .analytics-risk-hero,
  html[data-theme="dark"] .analytics-risk-grid,
  body[data-theme="dark"] .analytics-risk-grid,
  html[data-theme="dark"] .analytics-pattern-grid,
  body[data-theme="dark"] .analytics-pattern-grid,
  html[data-theme="dark"] .analytics-pattern-grid--timing,
  body[data-theme="dark"] .analytics-pattern-grid--timing {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .insights-patterns__grid,
  body[data-theme="dark"] .insights-patterns__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .insights-daily-review__grid,
  body[data-theme="dark"] .insights-daily-review__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .insights-hour-header__stats,
  body[data-theme="dark"] .insights-hour-header__stats {
    padding-left: 0;
    padding-top: 14px;
    border-left: 0;
    border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  }

  html[data-theme="dark"] .insights-concentration__grid,
  body[data-theme="dark"] .insights-concentration__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .analytics-risk-kpis,
  body[data-theme="dark"] .analytics-risk-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .insights-control-metrics__grid,
  body[data-theme="dark"] .insights-control-metrics__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .analytics-hour-overview,
  body[data-theme="dark"] .analytics-hour-overview {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  html[data-theme="dark"] .analytics-insight-grid,
  body[data-theme="dark"] .analytics-insight-grid,
  html[data-theme="dark"] .analytics-profile-highlights,
  body[data-theme="dark"] .analytics-profile-highlights,
  html[data-theme="dark"] .insights-hour-header__stats,
  body[data-theme="dark"] .insights-hour-header__stats,
  html[data-theme="dark"] .analytics-hour-copy-card--reading,
  body[data-theme="dark"] .analytics-hour-copy-card--reading,
  html[data-theme="dark"] .analytics-risk-kpis,
  body[data-theme="dark"] .analytics-risk-kpis,
  html[data-theme="dark"] .analytics-timing-list,
  body[data-theme="dark"] .analytics-timing-list,
  html[data-theme="dark"] .analytics-pattern-footer,
  body[data-theme="dark"] .analytics-pattern-footer,
  html[data-theme="dark"] .analytics-pattern-footer--three,
  body[data-theme="dark"] .analytics-pattern-footer--three,
  html[data-theme="dark"] .analytics-timing-hero,
  body[data-theme="dark"] .analytics-timing-hero,
  html[data-theme="dark"] .insights-daily-review__grid,
  body[data-theme="dark"] .insights-daily-review__grid,
  html[data-theme="dark"] .insights-patterns__grid,
  body[data-theme="dark"] .insights-patterns__grid,
  html[data-theme="dark"] .insights-concentration__grid,
  body[data-theme="dark"] .insights-concentration__grid,
  html[data-theme="dark"] .analytics-distribution-metrics,
  body[data-theme="dark"] .analytics-distribution-metrics {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .insights-control-metrics__grid,
  body[data-theme="dark"] .insights-control-metrics__grid,
  html[data-theme="dark"] .insights-control-risk-engine__evidence,
  body[data-theme="dark"] .insights-control-risk-engine__evidence {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .insights-evidence__card,
  body[data-theme="dark"] .insights-evidence__card {
    border-right: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  }

  html[data-theme="dark"] .analytics-symbol-row__main,
  body[data-theme="dark"] .analytics-symbol-row__main,
  html[data-theme="dark"] .analytics-symbol-row__aux,
  body[data-theme="dark"] .analytics-symbol-row__aux,
  html[data-theme="dark"] .analytics-timing-row__main,
  body[data-theme="dark"] .analytics-timing-row__main {
    flex-direction: column;
    align-items: flex-start;
  }

  html[data-theme="dark"] .insights-distribution__layout,
  body[data-theme="dark"] .insights-distribution__layout {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  html[data-theme="dark"] .insights-distribution-gauge,
  body[data-theme="dark"] .insights-distribution-gauge {
    width: 120px;
  }

  html[data-theme="dark"] .insights-distribution__metrics,
  body[data-theme="dark"] .insights-distribution__metrics {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .insights-distribution__metric + .insights-distribution__metric,
  body[data-theme="dark"] .insights-distribution__metric + .insights-distribution__metric {
    border-left: 0;
    border-top: 1px solid color-mix(in srgb, var(--border) 56%, transparent);
  }

  html[data-theme="dark"] .insights-session .analytics-pattern-footer__item + .analytics-pattern-footer__item,
  body[data-theme="dark"] .insights-session .analytics-pattern-footer__item + .analytics-pattern-footer__item,
  html[data-theme="dark"] .insights-distribution .analytics-distribution-metric + .analytics-distribution-metric,
  body[data-theme="dark"] .insights-distribution .analytics-distribution-metric + .analytics-distribution-metric {
    border-left: 0;
    border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  }

  html[data-theme="dark"] .analytics-hour-overview,
  body[data-theme="dark"] .analytics-hour-overview {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  html[data-theme="dark"] .analytics-hour-toggle,
  body[data-theme="dark"] .analytics-hour-toggle {
    margin-top: 2px;
  }

  html[data-theme="dark"] .analytics-hour-segment,
  body[data-theme="dark"] .analytics-hour-segment {
    min-height: 96px;
  }

  html[data-theme="dark"] .analytics-hour-segment strong,
  body[data-theme="dark"] .analytics-hour-segment strong {
    font-size: 10px;
  }

  html[data-theme="dark"] .analytics-hour-detail-row,
  body[data-theme="dark"] .analytics-hour-detail-row {
    grid-template-columns: 64px minmax(80px, 100px) 1fr;
    gap: 10px;
  }

  html[data-theme="dark"] .analytics-key-day,
  body[data-theme="dark"] .analytics-key-day,
  html[data-theme="dark"] .analytics-daily-detail__grid,
  body[data-theme="dark"] .analytics-daily-detail__grid,
  html[data-theme="dark"] .analytics-risk-behavior-row,
  body[data-theme="dark"] .analytics-risk-behavior-row {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .analytics-risk-hero__signal,
  body[data-theme="dark"] .analytics-risk-hero__signal,
  html[data-theme="dark"] .analytics-risk-behavior-row__metric,
  body[data-theme="dark"] .analytics-risk-behavior-row__metric {
    justify-items: start;
    text-align: left;
  }
}

/* Dashboard accounts rail — dynamic count */
html[data-theme="dark"] .account-cards-rail,
body[data-theme="dark"] .account-cards-rail {
  min-width: 0;
}

html[data-theme="dark"] .account-cards-grid,
body[data-theme="dark"] .account-cards-grid {
  display: grid;
  gap: 12px;
  min-width: 0;
}

html[data-theme="dark"] .account-cards-grid[data-count="1"],
body[data-theme="dark"] .account-cards-grid[data-count="1"] {
  grid-template-columns: minmax(0, 1fr);
}

html[data-theme="dark"] .account-cards-grid[data-count="2"],
body[data-theme="dark"] .account-cards-grid[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[data-theme="dark"] .account-cards-rail.is-scrollable,
body[data-theme="dark"] .account-cards-rail.is-scrollable {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

html[data-theme="dark"] .account-cards-rail.is-scrollable::-webkit-scrollbar,
body[data-theme="dark"] .account-cards-rail.is-scrollable::-webkit-scrollbar {
  display: none;
}

html[data-theme="dark"] .account-cards-grid[data-scrollable="true"],
body[data-theme="dark"] .account-cards-grid[data-scrollable="true"] {
  grid-auto-flow: column;
  grid-auto-columns: minmax(320px, 36vw);
  width: max-content;
}

html[data-theme="dark"] .account-cards-grid[data-scrollable="true"] > .account-hero-card,
body[data-theme="dark"] .account-cards-grid[data-scrollable="true"] > .account-hero-card {
  scroll-snap-align: start;
}

html[data-theme="dark"] .account-cards-grid .account-hero-card,
body[data-theme="dark"] .account-cards-grid .account-hero-card {
  min-width: 0;
}

/* Dashboard risk card */
html[data-theme="dark"] .dashboard-risk-card,
body[data-theme="dark"] .dashboard-risk-card {
  padding: 18px 20px !important;
}

html[data-theme="dark"] .dashboard-risk-card__head,
body[data-theme="dark"] .dashboard-risk-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

html[data-theme="dark"] .dashboard-risk-card__sub,
body[data-theme="dark"] .dashboard-risk-card__sub {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-risk-card__state,
body[data-theme="dark"] .dashboard-risk-card__state {
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--text-0);
  opacity: 0.82;
}

html[data-theme="dark"] .dashboard-risk-card__state--safe,
body[data-theme="dark"] .dashboard-risk-card__state--safe {
  color: var(--positive) !important;
}

html[data-theme="dark"] .dashboard-risk-card__state--watch,
body[data-theme="dark"] .dashboard-risk-card__state--watch {
  color: var(--gold) !important;
}

html[data-theme="dark"] .dashboard-risk-card__state--danger,
body[data-theme="dark"] .dashboard-risk-card__state--danger {
  color: var(--negative) !important;
}

/* Calendar screen — monthly consistency overview */
html[data-theme="dark"] .calendar-screen,
body[data-theme="dark"] .calendar-screen {
  display: grid;
  gap: 18px;
}

html[data-theme="dark"] .calendar-screen__header,
body[data-theme="dark"] .calendar-screen__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

html[data-theme="dark"] .calendar-screen__copy,
body[data-theme="dark"] .calendar-screen__copy {
  min-width: 0;
}

html[data-theme="dark"] .calendar-screen__eyebrow,
body[data-theme="dark"] .calendar-screen__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-screen__title,
body[data-theme="dark"] .calendar-screen__title {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-0);
}

html[data-theme="dark"] .calendar-screen__subtitle,
body[data-theme="dark"] .calendar-screen__subtitle {
  margin: 8px 0 0;
  max-width: 620px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-inline-note,
body[data-theme="dark"] .calendar-inline-note {
  margin: 10px 0 0;
  max-width: 640px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-inline-note--error,
body[data-theme="dark"] .calendar-inline-note--error {
  color: color-mix(in srgb, var(--negative) 68%, white 32%);
}

html[data-theme="dark"] .calendar-month-nav,
body[data-theme="dark"] .calendar-month-nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--border-0);
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .calendar-month-nav__btn,
body[data-theme="dark"] .calendar-month-nav__btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-1);
  font-size: 18px;
  cursor: pointer;
}

html[data-theme="dark"] .calendar-month-nav__btn:disabled,
body[data-theme="dark"] .calendar-month-nav__btn:disabled {
  opacity: 0.32;
  cursor: default;
}

html[data-theme="dark"] .calendar-month-nav__label,
body[data-theme="dark"] .calendar-month-nav__label {
  display: grid;
  gap: 2px;
  min-width: 148px;
  padding: 0 8px 0 2px;
}

html[data-theme="dark"] .calendar-month-nav__label strong,
body[data-theme="dark"] .calendar-month-nav__label strong {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-0);
  text-transform: capitalize;
}

html[data-theme="dark"] .calendar-month-nav__label span,
body[data-theme="dark"] .calendar-month-nav__label span {
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-value-toggle,
body[data-theme="dark"] .calendar-value-toggle {
  margin-left: 4px;
  flex-shrink: 0;
  padding: 2px !important;
  background: rgba(255, 255, 255, 0.028) !important;
  border-color: rgba(255, 255, 255, 0.055) !important;
}

html[data-theme="dark"] .calendar-value-toggle .widget-segmented-btn,
body[data-theme="dark"] .calendar-value-toggle .widget-segmented-btn {
  min-height: 28px !important;
  padding: 5px 9px !important;
  font-size: 10px !important;
  letter-spacing: 0.06em !important;
  border-radius: 999px !important;
}

html[data-theme="dark"] .calendar-view-toggle,
body[data-theme="dark"] .calendar-view-toggle {
  flex-shrink: 0;
  padding: 2px !important;
  background: rgba(255, 255, 255, 0.028) !important;
  border-color: rgba(255, 255, 255, 0.055) !important;
}

html[data-theme="dark"] .calendar-view-toggle .widget-segmented-btn,
body[data-theme="dark"] .calendar-view-toggle .widget-segmented-btn {
  min-height: 28px !important;
  padding: 5px 11px !important;
  font-size: 10px !important;
  letter-spacing: 0.06em !important;
  border-radius: 999px !important;
}

html[data-theme="dark"] .calendar-view-toggle .widget-segmented-btn.active,
html[data-theme="dark"] .calendar-value-toggle .widget-segmented-btn.active,
body[data-theme="dark"] .calendar-view-toggle .widget-segmented-btn.active,
body[data-theme="dark"] .calendar-value-toggle .widget-segmented-btn.active {
  border-radius: 999px !important;
}

html[data-theme="dark"] .calendar-summary-strip,
body[data-theme="dark"] .calendar-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

html[data-theme="dark"] .calendar-summary-card,
body[data-theme="dark"] .calendar-summary-card {
  min-width: 0;
  padding: 16px 16px 14px;
  border-radius: 16px;
  border: 1px solid var(--border-0);
  background: var(--card-surface);
}

html[data-theme="dark"] .calendar-summary-card--primary,
body[data-theme="dark"] .calendar-summary-card--primary {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.008)),
    var(--card-surface);
}

html[data-theme="dark"] .calendar-summary-card__label,
body[data-theme="dark"] .calendar-summary-card__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-summary-card__value,
body[data-theme="dark"] .calendar-summary-card__value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--text-0);
}

html[data-theme="dark"] .calendar-summary-card--primary .calendar-summary-card__value,
body[data-theme="dark"] .calendar-summary-card--primary .calendar-summary-card__value {
  font-size: 28px;
}

html[data-theme="dark"] .calendar-summary-card__meta,
body[data-theme="dark"] .calendar-summary-card__meta {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-month-panel,
body[data-theme="dark"] .calendar-month-panel {
  padding: 18px !important;
}

html[data-theme="dark"] .calendar-month-panel__head,
body[data-theme="dark"] .calendar-month-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

html[data-theme="dark"] .calendar-month-panel__title,
body[data-theme="dark"] .calendar-month-panel__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-0);
  text-transform: capitalize;
}

html[data-theme="dark"] .calendar-month-panel__sub,
body[data-theme="dark"] .calendar-month-panel__sub {
  margin-top: 6px;
  max-width: 560px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-month-panel__legend,
body[data-theme="dark"] .calendar-month-panel__legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-legend-dot,
body[data-theme="dark"] .calendar-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 999px;
  vertical-align: middle;
}

html[data-theme="dark"] .calendar-legend-dot--win,
body[data-theme="dark"] .calendar-legend-dot--win {
  background: color-mix(in srgb, var(--positive) 88%, white 12%);
}

html[data-theme="dark"] .calendar-legend-dot--loss,
body[data-theme="dark"] .calendar-legend-dot--loss {
  background: color-mix(in srgb, var(--negative) 88%, white 12%);
}

html[data-theme="dark"] .calendar-legend-dot--idle,
body[data-theme="dark"] .calendar-legend-dot--idle {
  background: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .calendar-legend-dot--today,
body[data-theme="dark"] .calendar-legend-dot--today {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .calendar-month-grid,
body[data-theme="dark"] .calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

html[data-theme="dark"] .calendar-month-grid__head,
body[data-theme="dark"] .calendar-month-grid__head {
  padding: 0 4px 2px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-day,
body[data-theme="dark"] .calendar-day {
  position: relative;
  min-height: 110px;
  padding: 11px 11px 12px;
  border: 1px solid var(--border-0);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--text-0);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

html[data-theme="dark"] .calendar-day::after,
body[data-theme="dark"] .calendar-day::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  opacity: 0;
}

html[data-theme="dark"] .calendar-day.has-trades.is-win,
body[data-theme="dark"] .calendar-day.has-trades.is-win {
  background: color-mix(in srgb, var(--positive) 5%, rgba(255,255,255,0.015));
}

html[data-theme="dark"] .calendar-day.has-trades.is-loss,
body[data-theme="dark"] .calendar-day.has-trades.is-loss {
  background: color-mix(in srgb, var(--negative) 5%, rgba(255,255,255,0.015));
}

html[data-theme="dark"] .calendar-day.has-trades.is-heat-1,
body[data-theme="dark"] .calendar-day.has-trades.is-heat-1 {
  background: color-mix(in srgb, currentColor 3%, rgba(255,255,255,0.015));
}

html[data-theme="dark"] .calendar-day.has-trades.is-heat-2.is-win,
body[data-theme="dark"] .calendar-day.has-trades.is-heat-2.is-win {
  background: color-mix(in srgb, var(--positive) 8%, rgba(255,255,255,0.015));
}

html[data-theme="dark"] .calendar-day.has-trades.is-heat-2.is-loss,
body[data-theme="dark"] .calendar-day.has-trades.is-heat-2.is-loss {
  background: color-mix(in srgb, var(--negative) 8%, rgba(255,255,255,0.015));
}

html[data-theme="dark"] .calendar-day.has-trades.is-heat-3.is-win,
body[data-theme="dark"] .calendar-day.has-trades.is-heat-3.is-win {
  background: color-mix(in srgb, var(--positive) 12%, rgba(255,255,255,0.015));
}

html[data-theme="dark"] .calendar-day.has-trades.is-heat-3.is-loss,
body[data-theme="dark"] .calendar-day.has-trades.is-heat-3.is-loss {
  background: color-mix(in srgb, var(--negative) 12%, rgba(255,255,255,0.015));
}

html[data-theme="dark"] .calendar-day.has-trades.is-win::after,
body[data-theme="dark"] .calendar-day.has-trades.is-win::after {
  background: color-mix(in srgb, var(--positive) 90%, white 10%);
  opacity: 1;
}

html[data-theme="dark"] .calendar-day.has-trades.is-loss::after,
body[data-theme="dark"] .calendar-day.has-trades.is-loss::after {
  background: color-mix(in srgb, var(--negative) 90%, white 10%);
  opacity: 1;
}

html[data-theme="dark"] .calendar-day:disabled,
body[data-theme="dark"] .calendar-day:disabled {
  cursor: default;
}

html[data-theme="dark"] .calendar-day.is-outside-month,
body[data-theme="dark"] .calendar-day.is-outside-month {
  opacity: 0.46;
}

html[data-theme="dark"] .calendar-day.is-today,
body[data-theme="dark"] .calendar-day.is-today {
  border-color: rgba(255,255,255,0.18);
}

html[data-theme="dark"] .calendar-day.is-selected,
body[data-theme="dark"] .calendar-day.is-selected {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.03);
}

html[data-theme="dark"] .calendar-day__top,
body[data-theme="dark"] .calendar-day__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

html[data-theme="dark"] .calendar-day__date,
body[data-theme="dark"] .calendar-day__date {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-0);
}

html[data-theme="dark"] .calendar-day__count,
body[data-theme="dark"] .calendar-day__count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-1);
  font-size: 10px;
  line-height: 20px;
  text-align: center;
}

html[data-theme="dark"] .calendar-day__body,
body[data-theme="dark"] .calendar-day__body {
  display: grid;
  align-content: end;
  gap: 5px;
  min-height: 66px;
  margin-top: 10px;
}

html[data-theme="dark"] .calendar-day__pnl,
body[data-theme="dark"] .calendar-day__pnl {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

html[data-theme="dark"] .calendar-day__meta,
body[data-theme="dark"] .calendar-day__meta {
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-week-strip,
body[data-theme="dark"] .calendar-week-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

html[data-theme="dark"] .calendar-analytics-stack,
body[data-theme="dark"] .calendar-analytics-stack {
  display: grid;
  gap: 14px;
}

html[data-theme="dark"] .calendar-year-grid,
body[data-theme="dark"] .calendar-year-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

html[data-theme="dark"] .calendar-year-card,
body[data-theme="dark"] .calendar-year-card {
  min-width: 0;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border-0);
  background: rgba(255, 255, 255, 0.015);
}

html[data-theme="dark"] .calendar-year-card.is-selected-month,
body[data-theme="dark"] .calendar-year-card.is-selected-month {
  border-color: rgba(255,255,255,0.12);
}

html[data-theme="dark"] .calendar-year-card__head,
body[data-theme="dark"] .calendar-year-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

html[data-theme="dark"] .calendar-year-card__month,
body[data-theme="dark"] .calendar-year-card__month {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-0);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: capitalize;
  cursor: pointer;
}

html[data-theme="dark"] .calendar-year-card__badge,
body[data-theme="dark"] .calendar-year-card__badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  font-size: 12px;
  font-weight: 650;
  color: var(--text-1);
}

html[data-theme="dark"] .calendar-year-card__weekdays,
body[data-theme="dark"] .calendar-year-card__weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}

html[data-theme="dark"] .calendar-year-card__weekdays span,
body[data-theme="dark"] .calendar-year-card__weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-year-card__grid,
body[data-theme="dark"] .calendar-year-card__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

html[data-theme="dark"] .calendar-year-day,
body[data-theme="dark"] .calendar-year-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text-1);
  font-size: 13px;
  font-weight: 600;
}

html[data-theme="dark"] .calendar-year-day--empty,
body[data-theme="dark"] .calendar-year-day--empty {
  opacity: 0;
  pointer-events: none;
}

html[data-theme="dark"] .calendar-year-day.has-trades.is-win,
body[data-theme="dark"] .calendar-year-day.has-trades.is-win {
  background: color-mix(in srgb, var(--positive) 13%, rgba(255,255,255,0.02));
  color: color-mix(in srgb, var(--positive) 70%, white 30%);
}

html[data-theme="dark"] .calendar-year-day.has-trades.is-loss,
body[data-theme="dark"] .calendar-year-day.has-trades.is-loss {
  background: color-mix(in srgb, var(--negative) 13%, rgba(255,255,255,0.02));
  color: color-mix(in srgb, var(--negative) 70%, white 30%);
}

html[data-theme="dark"] .calendar-year-day.is-idle,
body[data-theme="dark"] .calendar-year-day.is-idle {
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-year-day.is-today,
body[data-theme="dark"] .calendar-year-day.is-today {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}

html[data-theme="dark"] .calendar-year-day.has-trades,
body[data-theme="dark"] .calendar-year-day.has-trades {
  cursor: pointer;
}

html[data-theme="dark"] .calendar-year-card__footer,
body[data-theme="dark"] .calendar-year-card__footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-0);
  font-size: 11px;
  color: var(--text-2);
  text-align: center;
}

html[data-theme="dark"] .calendar-chart-panel,
html[data-theme="dark"] .calendar-returns-panel,
body[data-theme="dark"] .calendar-chart-panel,
body[data-theme="dark"] .calendar-returns-panel {
  padding: 18px !important;
}

html[data-theme="dark"] .calendar-panel-head,
body[data-theme="dark"] .calendar-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

html[data-theme="dark"] .calendar-panel-title,
body[data-theme="dark"] .calendar-panel-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

html[data-theme="dark"] .calendar-panel-sub,
body[data-theme="dark"] .calendar-panel-sub {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-chart-wrap,
body[data-theme="dark"] .calendar-chart-wrap {
  min-width: 0;
}

html[data-theme="dark"] .calendar-returns-panel .table-wrap,
body[data-theme="dark"] .calendar-returns-panel .table-wrap {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .calendar-table-placeholder,
body[data-theme="dark"] .calendar-table-placeholder {
  height: 16px;
  border-radius: 999px;
}

html[data-theme="dark"] .calendar-table-empty td,
body[data-theme="dark"] .calendar-table-empty td {
  padding: 18px 12px !important;
  font-size: 12px;
  color: var(--text-2);
  text-align: left;
}

html[data-theme="dark"] .calendar-matrix-cell--active,
body[data-theme="dark"] .calendar-matrix-cell--active {
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

html[data-theme="dark"] .calendar-week-chip,
body[data-theme="dark"] .calendar-week-chip {
  padding: 12px 12px 11px;
  border-radius: 14px;
  border: 1px solid var(--border-0);
  background: rgba(255,255,255,0.016);
}

html[data-theme="dark"] .calendar-week-chip__label,
body[data-theme="dark"] .calendar-week-chip__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-week-chip__value,
body[data-theme="dark"] .calendar-week-chip__value {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-0);
}

html[data-theme="dark"] .calendar-week-chip__meta,
body[data-theme="dark"] .calendar-week-chip__meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-state,
body[data-theme="dark"] .calendar-state {
  padding: 22px !important;
}

html[data-theme="dark"] .calendar-state__title,
body[data-theme="dark"] .calendar-state__title {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

html[data-theme="dark"] .calendar-state__message,
body[data-theme="dark"] .calendar-state__message {
  margin: 8px 0 0;
  max-width: 520px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] .calendar-month-grid--loading .calendar-day--skeleton,
body[data-theme="dark"] .calendar-month-grid--loading .calendar-day--skeleton {
  min-height: 110px;
  border-radius: 16px;
}

@media (max-width: 980px) {
  html[data-theme="dark"] .calendar-screen__header,
  body[data-theme="dark"] .calendar-screen__header,
  html[data-theme="dark"] .calendar-month-panel__head,
  body[data-theme="dark"] .calendar-month-panel__head {
    flex-direction: column;
    align-items: stretch;
  }

  html[data-theme="dark"] .calendar-summary-strip,
  body[data-theme="dark"] .calendar-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .calendar-year-grid,
  body[data-theme="dark"] .calendar-year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 720px) {
  html[data-theme="dark"] .calendar-screen,
  body[data-theme="dark"] .calendar-screen {
    gap: 14px;
  }

  html[data-theme="dark"] .calendar-summary-strip,
  body[data-theme="dark"] .calendar-summary-strip,
  html[data-theme="dark"] .calendar-week-strip,
  body[data-theme="dark"] .calendar-week-strip {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .calendar-year-grid,
  body[data-theme="dark"] .calendar-year-grid {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .calendar-month-panel,
  body[data-theme="dark"] .calendar-month-panel {
    padding: 14px !important;
  }

  html[data-theme="dark"] .calendar-month-grid,
  body[data-theme="dark"] .calendar-month-grid {
    gap: 6px;
  }

  html[data-theme="dark"] .calendar-month-grid__head,
  body[data-theme="dark"] .calendar-month-grid__head {
    font-size: 10px;
    padding-bottom: 0;
  }

  html[data-theme="dark"] .calendar-day,
  body[data-theme="dark"] .calendar-day {
    min-height: 82px;
    padding: 8px 8px 10px;
    border-radius: 12px;
  }

  html[data-theme="dark"] .calendar-day__body,
  body[data-theme="dark"] .calendar-day__body {
    min-height: 42px;
    margin-top: 8px;
  }

  html[data-theme="dark"] .calendar-day__count,
  body[data-theme="dark"] .calendar-day__count {
    min-width: 18px;
    height: 18px;
    font-size: 9px;
    line-height: 18px;
  }

  html[data-theme="dark"] .calendar-day__pnl,
  body[data-theme="dark"] .calendar-day__pnl {
    font-size: 12px;
  }

  html[data-theme="dark"] .calendar-day__meta,
  body[data-theme="dark"] .calendar-day__meta {
    font-size: 10px;
  }

  html[data-theme="dark"] .calendar-value-toggle,
  body[data-theme="dark"] .calendar-value-toggle {
    order: 3;
    margin-left: 0;
  }
}

html[data-theme="dark"] .dashboard-risk-card__metrics,
body[data-theme="dark"] .dashboard-risk-card__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

html[data-theme="dark"] .dashboard-risk-metric,
body[data-theme="dark"] .dashboard-risk-metric {
  min-width: 0;
  padding: 12px 12px 10px;
  border-radius: 14px;
  background: var(--layer-1-subtle);
  border: 1px solid var(--border-0);
}

html[data-theme="dark"] .dashboard-risk-metric__label,
body[data-theme="dark"] .dashboard-risk-metric__label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-risk-metric__value,
body[data-theme="dark"] .dashboard-risk-metric__value {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-0);
}

html[data-theme="dark"] .dashboard-risk-metric__meta,
body[data-theme="dark"] .dashboard-risk-metric__meta {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-risk-card__alert,
body[data-theme="dark"] .dashboard-risk-card__alert {
  margin-top: 14px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-1);
}

html[data-theme="dark"] .dashboard-risk-card__alert--safe,
body[data-theme="dark"] .dashboard-risk-card__alert--safe {
  color: var(--text-1) !important;
}

html[data-theme="dark"] .dashboard-risk-card__alert--watch,
body[data-theme="dark"] .dashboard-risk-card__alert--watch {
  color: var(--gold) !important;
}

html[data-theme="dark"] .dashboard-risk-card__alert--danger,
body[data-theme="dark"] .dashboard-risk-card__alert--danger {
  color: var(--negative) !important;
}

html[data-theme="dark"] .dashboard-risk-inline,
body[data-theme="dark"] .dashboard-risk-inline {
  margin-top: 6px;
  max-width: 460px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-1);
}

html[data-theme="dark"] .dashboard-risk-panel,
body[data-theme="dark"] .dashboard-risk-panel {
  display: grid;
  gap: 16px;
}

/* INICIO BLOQUE: connections-runtime */
html[data-theme="dark"] .connections-shell,
body[data-theme="dark"] .connections-shell {
  gap: 32px;
  min-height: calc(100dvh - 300px);
  align-content: start;
}

html[data-theme="dark"] #page-connections,
body[data-theme="dark"] #page-connections,
html[data-theme="dark"] #connectionsRoot,
body[data-theme="dark"] #connectionsRoot {
  min-height: calc(100dvh - 210px);
}

html[data-theme="dark"] #connectionsRoot,
body[data-theme="dark"] #connectionsRoot {
  display: flex;
  flex-direction: column;
}

html[data-theme="dark"] .connections-shell__header,
body[data-theme="dark"] .connections-shell__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

html[data-theme="dark"] .connections-shell__copy,
body[data-theme="dark"] .connections-shell__copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

html[data-theme="dark"] .connections-shell__title,
body[data-theme="dark"] .connections-shell__title {
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.4px;
  font-weight: 700;
  color: var(--text-primary);
}

html[data-theme="dark"] .connections-shell__subtitle,
body[data-theme="dark"] .connections-shell__subtitle {
  margin-top: 0;
  max-width: 58ch;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

html[data-theme="dark"] .connections-shell__actions,
body[data-theme="dark"] .connections-shell__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

html[data-theme="dark"] .connections-shell__utility-btn,
body[data-theme="dark"] .connections-shell__utility-btn {
  background: var(--layer-2);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
  min-height: 44px;
  border-radius: 12px;
}

html[data-theme="dark"] .connections-shell__utility-btn:hover,
body[data-theme="dark"] .connections-shell__utility-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-0);
}

html[data-theme="dark"] .connections-shell__kpis,
body[data-theme="dark"] .connections-shell__kpis {
  margin-bottom: 0;
}

html[data-theme="dark"] .connections-shell__main,
body[data-theme="dark"] .connections-shell__main {
  display: grid;
  gap: 16px;
  align-content: start;
}

html[data-theme="dark"] .connections-shell__main--single,
body[data-theme="dark"] .connections-shell__main--single {
  gap: 16px;
}

html[data-theme="dark"] .connections-account-list,
body[data-theme="dark"] .connections-account-list {
  display: grid;
  gap: 16px;
  align-content: start;
}

html[data-theme="dark"] .connections-account-list--single,
body[data-theme="dark"] .connections-account-list--single {
  gap: 16px;
}

html[data-theme="dark"] .connections-empty-card,
body[data-theme="dark"] .connections-empty-card,
html[data-theme="dark"] .connections-account-card,
body[data-theme="dark"] .connections-account-card {
  padding: 20px;
}

html[data-theme="dark"] .connections-account-list--single .connections-account-card,
body[data-theme="dark"] .connections-account-list--single .connections-account-card {
  width: 100%;
}

html[data-theme="dark"] .connections-empty-card,
body[data-theme="dark"] .connections-empty-card {
  min-height: 208px;
  align-content: center;
  transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"] .connections-empty-card .dashboard-risk-block__head,
body[data-theme="dark"] .connections-empty-card .dashboard-risk-block__head {
  margin-bottom: 20px;
}

html[data-theme="dark"] .connections-empty-card__actions,
body[data-theme="dark"] .connections-empty-card__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

html[data-theme="dark"] .connections-account-card,
body[data-theme="dark"] .connections-account-card {
  width: 100%;
  justify-self: stretch;
  gap: 16px;
  overflow: visible;
  transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"] .connections-account-card__layout,
body[data-theme="dark"] .connections-account-card__layout {
  display: grid;
  grid-template-columns:
    minmax(170px, 1.15fr)
    minmax(78px, 0.68fr)
    minmax(108px, 0.82fr)
    minmax(136px, 0.94fr)
    minmax(148px, 1fr)
    minmax(132px, 0.95fr)
    auto;
  column-gap: 18px;
  row-gap: 0;
  align-items: start;
}

html[data-theme="dark"] .connections-account-card__identity,
body[data-theme="dark"] .connections-account-card__identity,
html[data-theme="dark"] .connections-account-card__metric,
body[data-theme="dark"] .connections-account-card__metric {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
}

html[data-theme="dark"] .connections-account-card__identity .calendar-panel-title,
body[data-theme="dark"] .connections-account-card__identity .calendar-panel-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

html[data-theme="dark"] .connections-account-card__tag-text,
body[data-theme="dark"] .connections-account-card__tag-text {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

html[data-theme="dark"] .connections-account-card__metric .metric-label,
body[data-theme="dark"] .connections-account-card__metric .metric-label {
  margin: 0;
  line-height: 1.2;
}

html[data-theme="dark"] .connections-account-card__metric-value,
body[data-theme="dark"] .connections-account-card__metric-value {
  margin: 0;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -0.2px;
  line-height: 1.2;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .connections-account-card__metric .row-sub,
body[data-theme="dark"] .connections-account-card__metric .row-sub,
html[data-theme="dark"] .connections-account-card__identity .row-sub,
body[data-theme="dark"] .connections-account-card__identity .row-sub {
  margin: 0;
  line-height: 1.35;
}

html[data-theme="dark"] .connections-account-card__metric--tag,
body[data-theme="dark"] .connections-account-card__metric--tag {
  min-width: 0;
}

html[data-theme="dark"] .connections-account-card__pnl--positive,
body[data-theme="dark"] .connections-account-card__pnl--positive {
  color: var(--positive) !important;
}

html[data-theme="dark"] .connections-account-card__pnl--negative,
body[data-theme="dark"] .connections-account-card__pnl--negative {
  color: var(--negative) !important;
}

html[data-theme="dark"] .connections-account-card__pnl--neutral,
body[data-theme="dark"] .connections-account-card__pnl--neutral {
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .connections-account-card__actions,
body[data-theme="dark"] .connections-account-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  min-width: 40px;
}

html[data-theme="dark"] .connections-account-card__menu-trigger,
body[data-theme="dark"] .connections-account-card__menu-trigger {
  appearance: none;
  box-shadow: none;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border-subtle) !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 1px;
  transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"] .connections-account-card__menu-trigger:hover,
body[data-theme="dark"] .connections-account-card__menu-trigger:hover,
html[data-theme="dark"] .connections-account-card__menu-trigger:focus-visible,
body[data-theme="dark"] .connections-account-card__menu-trigger:focus-visible {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: var(--border-medium);
  color: var(--text-primary) !important;
  outline: none;
}

html[data-theme="dark"] .connections-account-card__menu,
body[data-theme="dark"] .connections-account-card__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 184px;
  padding: 10px;
  display: grid;
  gap: 6px;
  background: var(--layer-1);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  z-index: 3;
}

html[data-theme="dark"] .connections-account-card__menu-item,
body[data-theme="dark"] .connections-account-card__menu-item {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}

html[data-theme="dark"] .connections-account-card__menu-item:hover:not(:disabled),
body[data-theme="dark"] .connections-account-card__menu-item:hover:not(:disabled),
html[data-theme="dark"] .connections-account-card__menu-item:focus-visible,
body[data-theme="dark"] .connections-account-card__menu-item:focus-visible {
  background: var(--layer-2);
  outline: none;
}

html[data-theme="dark"] .connections-account-card__menu-item:disabled,
body[data-theme="dark"] .connections-account-card__menu-item:disabled {
  color: var(--text-muted);
  cursor: default;
}

html[data-theme="dark"] .connections-account-card__menu-item--danger,
body[data-theme="dark"] .connections-account-card__menu-item--danger {
  color: var(--negative);
}

html[data-theme="dark"] .connections-account-card__danger,
body[data-theme="dark"] .connections-account-card__danger {
  color: var(--negative);
}

html[data-theme="dark"] .connections-account-modal,
body[data-theme="dark"] .connections-account-modal {
  background: var(--layer-1);
  border: 1px solid var(--border-subtle);
  box-shadow: none;
}

html[data-theme="dark"] .connections-account-modal .modal-head,
body[data-theme="dark"] .connections-account-modal .modal-head {
  padding: 28px 32px 24px !important;
}

html[data-theme="dark"] .connections-account-modal .modal-head > div,
body[data-theme="dark"] .connections-account-modal .modal-head > div {
  display: grid;
  gap: 4px;
}

html[data-theme="dark"] .connections-account-modal .modal-body,
body[data-theme="dark"] .connections-account-modal .modal-body {
  padding: 28px 32px 28px;
}

html[data-theme="dark"] .connections-account-modal__form,
body[data-theme="dark"] .connections-account-modal__form,
html[data-theme="dark"] .connections-account-modal__info,
body[data-theme="dark"] .connections-account-modal__info {
  display: grid;
  gap: 20px;
}

html[data-theme="dark"] .connections-account-modal__stack,
body[data-theme="dark"] .connections-account-modal__stack {
  display: grid;
  gap: 16px;
}

html[data-theme="dark"] .connections-account-modal__field,
body[data-theme="dark"] .connections-account-modal__field {
  gap: 12px;
}

html[data-theme="dark"] .connections-account-modal__field > span,
body[data-theme="dark"] .connections-account-modal__field > span,
html[data-theme="dark"] .connections-account-modal__label,
body[data-theme="dark"] .connections-account-modal__label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

html[data-theme="dark"] .connections-account-modal input:not([type="checkbox"]):not([type="radio"]),
body[data-theme="dark"] .connections-account-modal input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] .connections-account-modal select,
body[data-theme="dark"] .connections-account-modal select {
  background: var(--layer-1);
  border: 1px solid var(--border-medium);
}

html[data-theme="dark"] .connections-account-modal input:not([type="checkbox"]):not([type="radio"]):focus,
body[data-theme="dark"] .connections-account-modal input:not([type="checkbox"]):not([type="radio"]):focus,
html[data-theme="dark"] .connections-account-modal select:focus,
body[data-theme="dark"] .connections-account-modal select:focus {
  border-color: var(--border-medium);
  box-shadow: none;
}

html[data-theme="dark"] .connections-account-modal__actions,
body[data-theme="dark"] .connections-account-modal__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

html[data-theme="dark"] .connections-account-modal__actions > *,
body[data-theme="dark"] .connections-account-modal__actions > * {
  min-width: 0;
}

html[data-theme="dark"] .connections-account-modal__info-grid,
body[data-theme="dark"] .connections-account-modal__info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

html[data-theme="dark"] .connections-account-modal__info-block,
body[data-theme="dark"] .connections-account-modal__info-block {
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] .connections-account-modal__value,
body[data-theme="dark"] .connections-account-modal__value {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

html[data-theme="dark"] .connections-account-modal__value--subtle,
body[data-theme="dark"] .connections-account-modal__value--subtle {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0;
}

html[data-theme="dark"] .connections-account-modal__key-block,
body[data-theme="dark"] .connections-account-modal__key-block {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: 14px;
  background: var(--layer-1);
  border: 1px solid var(--border-subtle);
}

html[data-theme="dark"] .connections-account-modal__key-value,
body[data-theme="dark"] .connections-account-modal__key-value {
  margin-top: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  word-break: break-word;
}

@media (max-width: 1180px) {
  html[data-theme="dark"] .connections-account-card__layout,
  body[data-theme="dark"] .connections-account-card__layout {
    grid-template-columns:
      minmax(170px, 1.15fr)
      minmax(78px, 0.72fr)
      minmax(108px, 0.82fr)
      minmax(136px, 0.94fr);
    column-gap: 18px;
    row-gap: 16px;
    align-items: start;
  }

  html[data-theme="dark"] .connections-account-card__actions,
  body[data-theme="dark"] .connections-account-card__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 4px;
  }

  html[data-theme="dark"] .connections-account-card__menu,
  body[data-theme="dark"] .connections-account-card__menu {
    right: auto;
    left: 0;
  }
}

@media (max-width: 760px) {
  html[data-theme="dark"] .connections-account-card,
  body[data-theme="dark"] .connections-account-card {
    padding: 20px;
  }

  html[data-theme="dark"] .connections-account-card__layout,
  body[data-theme="dark"] .connections-account-card__layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  html[data-theme="dark"] .connections-account-card__metric,
  body[data-theme="dark"] .connections-account-card__metric {
    gap: 8px;
  }

  html[data-theme="dark"] .connections-account-modal .modal-head,
  body[data-theme="dark"] .connections-account-modal .modal-head,
  html[data-theme="dark"] .connections-account-modal .modal-body,
  body[data-theme="dark"] .connections-account-modal .modal-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  html[data-theme="dark"] .connections-account-modal__info-grid,
  body[data-theme="dark"] .connections-account-modal__info-grid {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .connections-account-modal__key-block,
  body[data-theme="dark"] .connections-account-modal__key-block,
  html[data-theme="dark"] .connections-account-modal__actions,
  body[data-theme="dark"] .connections-account-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }
}

html[data-theme="dark"] .connections-shell__download-btn,
body[data-theme="dark"] .connections-shell__download-btn {
  color: var(--text-secondary);
}

html[data-theme="dark"] .connections-shell__download-btn:hover,
body[data-theme="dark"] .connections-shell__download-btn:hover,
html[data-theme="dark"] .connections-shell__download-btn:focus-visible,
body[data-theme="dark"] .connections-shell__download-btn:focus-visible {
  color: var(--text-primary);
}
/* FIN BLOQUE: connections-runtime */

html[data-theme="dark"] .dashboard-header-card,
body[data-theme="dark"] .dashboard-header-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px !important;
}

html[data-theme="dark"] .dashboard-header-card__copy,
body[data-theme="dark"] .dashboard-header-card__copy {
  min-width: 0;
}

html[data-theme="dark"] .dashboard-header-card .banner-kicker,
body[data-theme="dark"] .dashboard-header-card .banner-kicker {
  margin-bottom: 2px !important;
}

html[data-theme="dark"] .dashboard-header-card .banner-title,
body[data-theme="dark"] .dashboard-header-card .banner-title {
  font-size: 16px !important;
  line-height: 1.04 !important;
}

html[data-theme="dark"] .dashboard-header-card .banner-sub,
body[data-theme="dark"] .dashboard-header-card .banner-sub {
  margin-top: 2px !important;
  font-size: 11px !important;
  line-height: 1.18 !important;
}

html[data-theme="dark"] .dashboard-header-card__meta,
body[data-theme="dark"] .dashboard-header-card__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

html[data-theme="dark"] .dashboard-summary-kpis,
body[data-theme="dark"] .dashboard-summary-kpis {
  margin-bottom: 0;
}

html[data-theme="dark"] .dashboard-main-grid--master,
body[data-theme="dark"] .dashboard-main-grid--master {
  align-items: start;
  grid-template-columns: minmax(0, 1.68fr) minmax(320px, 0.82fr);
}

html[data-theme="dark"] .dashboard-side-stack,
body[data-theme="dark"] .dashboard-side-stack {
  display: grid;
  gap: 8px;
}

html[data-theme="dark"] .dashboard-ops-card,
body[data-theme="dark"] .dashboard-ops-card {
  padding: 14px !important;
}

html[data-theme="dark"] .dashboard-ops-card__insight,
body[data-theme="dark"] .dashboard-ops-card__insight {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .dashboard-ops-card__insight-head,
body[data-theme="dark"] .dashboard-ops-card__insight-head {
  margin-bottom: 10px;
}

html[data-theme="dark"] .dashboard-risk-posture-card__limits,
body[data-theme="dark"] .dashboard-risk-posture-card__limits {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .dashboard-risk-overview,
body[data-theme="dark"] .dashboard-risk-overview {
  padding: 18px 20px !important;
  border: 1px solid var(--border-0);
  background: var(--card-surface);
}

html[data-theme="dark"] .dashboard-risk-overview--ok,
body[data-theme="dark"] .dashboard-risk-overview--ok {
  box-shadow: inset 0 0 0 1px rgba(89, 168, 117, 0.18);
}

html[data-theme="dark"] .dashboard-risk-overview--warning,
body[data-theme="dark"] .dashboard-risk-overview--warning {
  box-shadow: inset 0 0 0 1px rgba(215, 176, 72, 0.24);
}

html[data-theme="dark"] .dashboard-risk-overview--breach,
body[data-theme="dark"] .dashboard-risk-overview--breach {
  box-shadow: inset 0 0 0 1px rgba(208, 89, 89, 0.25);
}

html[data-theme="dark"] .dashboard-risk-overview--blocked,
body[data-theme="dark"] .dashboard-risk-overview--blocked {
  box-shadow: inset 0 0 0 1px rgba(255, 76, 76, 0.34);
}

html[data-theme="dark"] .dashboard-risk-overview__head,
body[data-theme="dark"] .dashboard-risk-overview__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

html[data-theme="dark"] .dashboard-risk-overview__sub,
body[data-theme="dark"] .dashboard-risk-overview__sub {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-1);
}

html[data-theme="dark"] .dashboard-risk-overview__grid,
body[data-theme="dark"] .dashboard-risk-overview__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

html[data-theme="dark"] .dashboard-risk-overview__foot,
body[data-theme="dark"] .dashboard-risk-overview__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-2);
  text-transform: uppercase;
}

html[data-theme="dark"] .risk-status-badge,
body[data-theme="dark"] .risk-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme="dark"] .risk-status-badge--ok,
body[data-theme="dark"] .risk-status-badge--ok {
  color: #8ac39a;
  border-color: rgba(138,195,154,0.28);
}

html[data-theme="dark"] .risk-status-badge--warning,
body[data-theme="dark"] .risk-status-badge--warning {
  color: #d6b24f;
  border-color: rgba(214,178,79,0.3);
}

html[data-theme="dark"] .risk-status-badge--breach,
body[data-theme="dark"] .risk-status-badge--breach {
  color: #d76666;
  border-color: rgba(215,102,102,0.32);
}

html[data-theme="dark"] .risk-status-badge--blocked,
body[data-theme="dark"] .risk-status-badge--blocked {
  color: #ff6464;
  border-color: rgba(255,100,100,0.4);
  background: rgba(255,100,100,0.05);
}

html[data-theme="dark"] .dashboard-risk-grid,
body[data-theme="dark"] .dashboard-risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

html[data-theme="dark"] .dashboard-risk-block,
body[data-theme="dark"] .dashboard-risk-block {
  padding: 14px !important;
}

html[data-theme="dark"] .dashboard-risk-posture-card,
body[data-theme="dark"] .dashboard-risk-posture-card {
  padding: 12px !important;
}

html[data-theme="dark"] .dashboard-risk-block--wide,
body[data-theme="dark"] .dashboard-risk-block--wide {
  padding: 14px !important;
  margin-top: 8px;
}

html[data-theme="dark"] .dashboard-risk-block__head,
body[data-theme="dark"] .dashboard-risk-block__head {
  margin-bottom: 10px;
}

html[data-theme="dark"] .dashboard-risk-block__title,
body[data-theme="dark"] .dashboard-risk-block__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-0);
}

html[data-theme="dark"] .dashboard-risk-block__sub,
body[data-theme="dark"] .dashboard-risk-block__sub {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-risk-block__grid,
body[data-theme="dark"] .dashboard-risk-block__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

html[data-theme="dark"] .risk-metric-card,
body[data-theme="dark"] .risk-metric-card {
  min-width: 0;
  padding: 13px 13px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-0);
  background: var(--layer-1-subtle);
}

html[data-theme="dark"] .risk-metric-card--ok,
body[data-theme="dark"] .risk-metric-card--ok {
  border-color: rgba(138,195,154,0.2);
}

html[data-theme="dark"] .risk-metric-card--warning,
body[data-theme="dark"] .risk-metric-card--warning {
  border-color: rgba(214,178,79,0.24);
}

html[data-theme="dark"] .risk-metric-card--breach,
body[data-theme="dark"] .risk-metric-card--breach {
  border-color: rgba(215,102,102,0.28);
}

html[data-theme="dark"] .risk-metric-card--blocked,
body[data-theme="dark"] .risk-metric-card--blocked {
  border-color: rgba(255,100,100,0.34);
}

html[data-theme="dark"] .risk-metric-card__label,
body[data-theme="dark"] .risk-metric-card__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-metric-card__value,
body[data-theme="dark"] .risk-metric-card__value {
  margin-top: 10px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

html[data-theme="dark"] .risk-metric-card__meta,
body[data-theme="dark"] .risk-metric-card__meta {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-risk-limits,
body[data-theme="dark"] .dashboard-risk-limits {
  display: grid;
  gap: 12px;
}

html[data-theme="dark"] .risk-limit-bar,
body[data-theme="dark"] .risk-limit-bar {
  display: grid;
  gap: 7px;
}

html[data-theme="dark"] .risk-limit-bar__top,
body[data-theme="dark"] .risk-limit-bar__top,
html[data-theme="dark"] .risk-limit-bar__meta,
body[data-theme="dark"] .risk-limit-bar__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-limit-bar__top strong,
body[data-theme="dark"] .risk-limit-bar__top strong {
  color: var(--text-1);
  font-weight: 650;
}

html[data-theme="dark"] .risk-limit-bar__track,
body[data-theme="dark"] .risk-limit-bar__track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

html[data-theme="dark"] .risk-limit-bar__fill,
body[data-theme="dark"] .risk-limit-bar__fill {
  height: 100%;
  border-radius: inherit;
}

html[data-theme="dark"] .risk-limit-bar__fill--ok,
body[data-theme="dark"] .risk-limit-bar__fill--ok {
  background: #77b389;
}

html[data-theme="dark"] .risk-limit-bar__fill--warning,
body[data-theme="dark"] .risk-limit-bar__fill--warning {
  background: #d1a83f;
}

html[data-theme="dark"] .risk-limit-bar__fill--breach,
body[data-theme="dark"] .risk-limit-bar__fill--breach {
  background: #cf6262;
}

html[data-theme="dark"] .risk-limit-bar__fill--blocked,
body[data-theme="dark"] .risk-limit-bar__fill--blocked {
  background: #ff5454;
}

html[data-theme="dark"] .risk-enforcement-panel,
body[data-theme="dark"] .risk-enforcement-panel {
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] .risk-enforcement-panel__item,
body[data-theme="dark"] .risk-enforcement-panel__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border-0);
  background: var(--layer-1-subtle);
  font-size: 12px;
  color: var(--text-1);
}

html[data-theme="dark"] .risk-enforcement-panel__item strong,
body[data-theme="dark"] .risk-enforcement-panel__item strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[data-theme="dark"] .risk-enforcement-panel__item .is-on,
body[data-theme="dark"] .risk-enforcement-panel__item .is-on {
  color: #ff6f6f;
}

html[data-theme="dark"] .risk-enforcement-panel__item .is-off,
body[data-theme="dark"] .risk-enforcement-panel__item .is-off {
  color: #89bf97;
}

html[data-theme="dark"] .risk-exposure-table,
body[data-theme="dark"] .risk-exposure-table {
  display: grid;
  gap: 0;
}

html[data-theme="dark"] .risk-exposure-table__head,
body[data-theme="dark"] .risk-exposure-table__head,
html[data-theme="dark"] .risk-exposure-table__row,
body[data-theme="dark"] .risk-exposure-table__row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(80px, 0.8fr) minmax(80px, 0.8fr) minmax(90px, 0.8fr);
  gap: 10px;
  align-items: center;
}

html[data-theme="dark"] .risk-exposure-table__head,
body[data-theme="dark"] .risk-exposure-table__head {
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-exposure-table__row,
body[data-theme="dark"] .risk-exposure-table__row {
  min-height: 42px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
  color: var(--text-1);
}

html[data-theme="dark"] .risk-exposure-table__row strong,
body[data-theme="dark"] .risk-exposure-table__row strong {
  color: var(--text-0);
  font-weight: 650;
}

html[data-theme="dark"] .risk-exposure-table__empty,
body[data-theme="dark"] .risk-exposure-table__empty {
  padding: 12px 0 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] .risk-exposure-table .is-positive,
body[data-theme="dark"] .risk-exposure-table .is-positive {
  color: #89bf97;
}

html[data-theme="dark"] .risk-exposure-table .is-negative,
body[data-theme="dark"] .risk-exposure-table .is-negative {
  color: #d76666;
}

/* Dashboard KPI clusters */
html[data-theme="dark"] .dashboard-kpi-clusters,
body[data-theme="dark"] .dashboard-kpi-clusters {
  grid-template-columns: 1.08fr 1.2fr 1fr !important;
  gap: 18px !important;
}

html[data-theme="dark"] .dashboard-kpi-cluster,
body[data-theme="dark"] .dashboard-kpi-cluster {
  padding: 18px 18px 16px !important;
  min-height: 0 !important;
}

html[data-theme="dark"] .dashboard-kpi-cluster__head,
body[data-theme="dark"] .dashboard-kpi-cluster__head {
  margin-bottom: 14px;
}

html[data-theme="dark"] .dashboard-kpi-cluster__title,
body[data-theme="dark"] .dashboard-kpi-cluster__title {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-0);
}

html[data-theme="dark"] .dashboard-kpi-cluster__sub,
body[data-theme="dark"] .dashboard-kpi-cluster__sub {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.25;
  color: var(--text-2);
  opacity: 0.82;
}

html[data-theme="dark"] .dashboard-kpi-cluster__items,
body[data-theme="dark"] .dashboard-kpi-cluster__items {
  display: grid;
  gap: 12px;
}

html[data-theme="dark"] .dashboard-kpi-cluster--capital .dashboard-kpi-cluster__items,
body[data-theme="dark"] .dashboard-kpi-cluster--capital .dashboard-kpi-cluster__items {
  gap: 12px;
}

html[data-theme="dark"] .dashboard-kpi-cluster--performance .dashboard-kpi-cluster__items,
body[data-theme="dark"] .dashboard-kpi-cluster--performance .dashboard-kpi-cluster__items {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

html[data-theme="dark"] .dashboard-kpi-item,
body[data-theme="dark"] .dashboard-kpi-item {
  min-width: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

html[data-theme="dark"] .dashboard-kpi-cluster__items .dashboard-kpi-item:last-child,
body[data-theme="dark"] .dashboard-kpi-cluster__items .dashboard-kpi-item:last-child,
html[data-theme="dark"] .dashboard-kpi-cluster--performance .dashboard-kpi-item:nth-last-child(-n+2),
body[data-theme="dark"] .dashboard-kpi-cluster--performance .dashboard-kpi-item:nth-last-child(-n+2) {
  padding-bottom: 0;
  border-bottom: 0;
}

html[data-theme="dark"] .dashboard-kpi-item__label,
body[data-theme="dark"] .dashboard-kpi-item__label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-kpi-item__value,
body[data-theme="dark"] .dashboard-kpi-item__value {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

html[data-theme="dark"] .dashboard-kpi-cluster--capital .dashboard-kpi-item__value,
body[data-theme="dark"] .dashboard-kpi-cluster--capital .dashboard-kpi-item__value {
  font-size: 22px;
}

html[data-theme="dark"] .dashboard-kpi-cluster--capital .dashboard-kpi-item:first-child .dashboard-kpi-item__value,
body[data-theme="dark"] .dashboard-kpi-cluster--capital .dashboard-kpi-item:first-child .dashboard-kpi-item__value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

html[data-theme="dark"] .dashboard-kpi-cluster--capital .dashboard-kpi-item:first-child .dashboard-kpi-item__meta,
body[data-theme="dark"] .dashboard-kpi-cluster--capital .dashboard-kpi-item:first-child .dashboard-kpi-item__meta {
  margin-top: 7px;
}

html[data-theme="dark"] .dashboard-kpi-item__meta,
body[data-theme="dark"] .dashboard-kpi-item__meta {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-kpi-cluster--performance .dashboard-kpi-item:nth-child(-n+2) .dashboard-kpi-item__value,
body[data-theme="dark"] .dashboard-kpi-cluster--performance .dashboard-kpi-item:nth-child(-n+2) .dashboard-kpi-item__value {
  font-size: 21px;
  font-weight: 650;
}

html[data-theme="dark"] .dashboard-kpi-cluster--performance .dashboard-kpi-item:nth-child(n+3) .dashboard-kpi-item__value,
body[data-theme="dark"] .dashboard-kpi-cluster--performance .dashboard-kpi-item:nth-child(n+3) .dashboard-kpi-item__value {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

html[data-theme="dark"] .dashboard-kpi-cluster--performance .dashboard-kpi-item:nth-child(n+3) .dashboard-kpi-item__meta,
body[data-theme="dark"] .dashboard-kpi-cluster--performance .dashboard-kpi-item:nth-child(n+3) .dashboard-kpi-item__meta {
  margin-top: 5px;
}

html[data-theme="dark"] .dashboard-kpi-cluster--activity .dashboard-kpi-item:last-child,
body[data-theme="dark"] .dashboard-kpi-cluster--activity .dashboard-kpi-item:last-child {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .dashboard-kpi-cluster--activity .dashboard-kpi-item:last-child .dashboard-kpi-item__label,
body[data-theme="dark"] .dashboard-kpi-cluster--activity .dashboard-kpi-item:last-child .dashboard-kpi-item__label {
  color: var(--text-2);
}

/* Dashboard hero — balanced compact composition */
html[data-theme="dark"] .account-banner--hero-refined,
body[data-theme="dark"] .account-banner--hero-refined {
  gap: 12px !important;
  padding: 16px 20px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-head,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-head {
  gap: 12px !important;
  align-items: start !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-body,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-body {
  display: grid !important;
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1.48fr) !important;
  gap: 16px !important;
  align-items: stretch !important;
  min-width: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-hero,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-hero {
  display: grid !important;
  gap: 8px !important;
  align-content: start !important;
  min-width: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-metric,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-metric {
  font-size: clamp(40px, 4vw, 48px) !important;
  line-height: 0.9 !important;
  letter-spacing: -0.052em !important;
  margin-top: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-currency,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-currency {
  font-size: 0.32em !important;
  opacity: 0.8 !important;
  transform: translateY(0.3em) !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-metrics-block,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-metrics-block {
  display: grid !important;
  gap: 6px !important;
  margin-top: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .metric-line,
body[data-theme="dark"] .account-banner--hero-refined .metric-line {
  display: grid !important;
  grid-template-columns: 82px minmax(0, 1fr) !important;
  align-items: baseline !important;
  gap: 8px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .metric-line-label,
body[data-theme="dark"] .account-banner--hero-refined .metric-line-label {
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.035em !important;
}

html[data-theme="dark"] .account-banner--hero-refined .metric-line strong,
body[data-theme="dark"] .account-banner--hero-refined .metric-line strong {
  font-size: 16px !important;
  font-weight: 650 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-badges,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-badges {
  margin-top: 2px !important;
  gap: 5px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-chart,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-chart {
  display: flex !important;
  align-items: stretch !important;
  min-width: 0 !important;
  margin-top: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz {
  flex: 1 1 auto !important;
  min-height: 178px !important;
  padding: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz .kmfx-chart-shell--hero,
html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz canvas,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz .kmfx-chart-shell--hero,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz canvas {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

@media (max-width: 980px) {
  html[data-theme="dark"] .account-cards-grid[data-count="2"],
  body[data-theme="dark"] .account-cards-grid[data-count="2"] {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .account-cards-grid[data-scrollable="true"],
  body[data-theme="dark"] .account-cards-grid[data-scrollable="true"] {
    grid-auto-columns: minmax(300px, 84vw);
  }

  html[data-theme="dark"] .dashboard-risk-card__metrics,
  body[data-theme="dark"] .dashboard-risk-card__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .dashboard-risk-overview__grid,
  body[data-theme="dark"] .dashboard-risk-overview__grid,
  html[data-theme="dark"] .dashboard-risk-block__grid,
  body[data-theme="dark"] .dashboard-risk-block__grid,
  html[data-theme="dark"] .dashboard-risk-grid,
  body[data-theme="dark"] .dashboard-risk-grid,
  html[data-theme="dark"] .dashboard-secondary-grid,
  body[data-theme="dark"] .dashboard-secondary-grid,
  html[data-theme="dark"] .dashboard-bottom-grid,
  body[data-theme="dark"] .dashboard-bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .dashboard-kpi-clusters,
  body[data-theme="dark"] .dashboard-kpi-clusters {
    grid-template-columns: 1fr !important;
  }

  html[data-theme="dark"] .connections-shell__header,
  body[data-theme="dark"] .connections-shell__header {
    flex-direction: column;
    align-items: stretch;
  }

  html[data-theme="dark"] .connections-shell__actions,
  body[data-theme="dark"] .connections-shell__actions,
  html[data-theme="dark"] .connections-empty-card__actions,
  body[data-theme="dark"] .connections-empty-card__actions {
    width: 100%;
  }

  html[data-theme="dark"] .connections-shell__actions > *,
  body[data-theme="dark"] .connections-shell__actions > *,
  html[data-theme="dark"] .connections-empty-card__actions > *,
  body[data-theme="dark"] .connections-empty-card__actions > * {
    flex: 1 1 220px;
  }

  html[data-theme="dark"] .connections-account-card__footer,
  body[data-theme="dark"] .connections-account-card__footer {
    flex-direction: column;
    align-items: stretch;
  }

  html[data-theme="dark"] .dashboard-kpi-cluster--performance .dashboard-kpi-cluster__items,
  body[data-theme="dark"] .dashboard-kpi-cluster--performance .dashboard-kpi-cluster__items {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .account-banner--hero-refined .account-banner-body,
  body[data-theme="dark"] .account-banner--hero-refined .account-banner-body {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz,
  body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz {
    min-height: 190px !important;
  }
}

@media (max-width: 640px) {
  html[data-theme="dark"] .dashboard-risk-card__head,
  body[data-theme="dark"] .dashboard-risk-card__head {
    flex-direction: column;
    align-items: flex-start;
  }

  html[data-theme="dark"] .dashboard-risk-card__metrics,
  body[data-theme="dark"] .dashboard-risk-card__metrics {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .dashboard-risk-overview__head,
  body[data-theme="dark"] .dashboard-risk-overview__head,
  html[data-theme="dark"] .dashboard-risk-overview__foot,
  body[data-theme="dark"] .dashboard-risk-overview__foot,
  html[data-theme="dark"] .dashboard-header-card,
  body[data-theme="dark"] .dashboard-header-card {
    flex-direction: column;
    align-items: flex-start;
  }

  html[data-theme="dark"] .dashboard-main-grid--master,
  body[data-theme="dark"] .dashboard-main-grid--master {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .dashboard-risk-overview__grid,
  body[data-theme="dark"] .dashboard-risk-overview__grid,
  html[data-theme="dark"] .dashboard-risk-block__grid,
  body[data-theme="dark"] .dashboard-risk-block__grid,
  html[data-theme="dark"] .dashboard-risk-grid,
  body[data-theme="dark"] .dashboard-risk-grid,
  html[data-theme="dark"] .risk-exposure-table__head,
  body[data-theme="dark"] .risk-exposure-table__head,
  html[data-theme="dark"] .risk-exposure-table__row,
  body[data-theme="dark"] .risk-exposure-table__row {
    grid-template-columns: 1fr;
  }
}

/* Phase 5.3 — neutral card temperature recalibration */
:root,
[data-theme="dark"] {
  --layer-1: #171718 !important;
  --card-surface: var(--layer-1);
  --layer-1-subtle: rgba(255, 255, 255, 0.018);
}

/* Phase 4D — Internal surface consistency */

/* 1. Sub-surface token */
:root {
  --layer-1-subtle: rgba(255, 255, 255, 0.02);
}

/* Hero H — overlay timeframes and taller chart */
html[data-theme="dark"] .account-banner--hero-refined,
body[data-theme="dark"] .account-banner--hero-refined {
  gap: 0 !important;
  padding: 16px 18px 14px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-body,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-body {
  display: grid !important;
  grid-template-columns: minmax(300px, 0.84fr) minmax(0, 1.6fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
  min-width: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-info,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-info {
  display: grid !important;
  align-content: center !important;
  align-self: stretch !important;
  min-width: 0 !important;
  padding: 18px 0 10px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-heading,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-heading {
  margin-bottom: 14px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .banner-kicker,
body[data-theme="dark"] .account-banner--hero-refined .banner-kicker {
  margin-bottom: 6px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .banner-title,
body[data-theme="dark"] .account-banner--hero-refined .banner-title {
  font-size: 18px !important;
  line-height: 1.08 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .banner-sub,
body[data-theme="dark"] .account-banner--hero-refined .banner-sub {
  margin-top: 4px !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-hero,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-hero {
  display: grid !important;
  gap: 10px !important;
  align-content: start !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-metric,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-metric {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  font-size: clamp(40px, 4vw, 48px) !important;
  line-height: 0.9 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-metrics-block,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-metrics-block {
  display: grid !important;
  gap: 8px !important;
  margin-top: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .metric-line,
body[data-theme="dark"] .account-banner--hero-refined .metric-line {
  display: grid !important;
  grid-template-columns: 84px minmax(0, 1fr) !important;
  align-items: baseline !important;
  gap: 8px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .metric-line-label,
body[data-theme="dark"] .account-banner--hero-refined .metric-line-label {
  font-size: 11px !important;
  line-height: 1.2 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .metric-line strong,
body[data-theme="dark"] .account-banner--hero-refined .metric-line strong {
  font-size: 16px !important;
  line-height: 1.1 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-badges,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-badges {
  margin-top: 4px !important;
  gap: 5px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-chart,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-chart {
  position: relative !important;
  display: flex !important;
  align-items: stretch !important;
  align-self: stretch !important;
  min-width: 0 !important;
  margin-top: 0 !important;
  padding-top: 2px !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-controls--overlay,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-controls--overlay {
  position: absolute !important;
  top: 6px !important;
  right: 2px !important;
  z-index: 3 !important;
  display: flex !important;
  justify-content: flex-end !important;
  pointer-events: none !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-controls--overlay .widget-segmented,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-controls--overlay .widget-segmented {
  pointer-events: auto !important;
  background: rgba(23, 23, 24, 0.74) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* Calendar polish — quieter idle cells, subtler legend, refined active states */
html[data-theme="dark"] .calendar-month-panel__legend,
body[data-theme="dark"] .calendar-month-panel__legend {
  gap: 9px !important;
  font-size: 10px !important;
  color: var(--text-2) !important;
  opacity: 0.72 !important;
}

html[data-theme="dark"] .calendar-legend-dot,
body[data-theme="dark"] .calendar-legend-dot {
  width: 6px !important;
  height: 6px !important;
  opacity: 0.82 !important;
}

html[data-theme="dark"] .calendar-day,
body[data-theme="dark"] .calendar-day {
  background: color-mix(in srgb, var(--card) 88%, var(--muted) 12%) !important;
  border-color: color-mix(in srgb, var(--border) 72%, transparent) !important;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

html[data-theme="dark"] .calendar-day::after,
body[data-theme="dark"] .calendar-day::after {
  display: none !important;
  content: none !important;
}

html[data-theme="dark"] .calendar-day::before,
body[data-theme="dark"] .calendar-day::before {
  display: none !important;
  content: none !important;
}

html[data-theme="dark"] .calendar-day.is-idle .calendar-day__meta,
body[data-theme="dark"] .calendar-day.is-idle .calendar-day__meta {
  color: var(--text-2) !important;
  opacity: 0.36 !important;
}

html[data-theme="dark"] .calendar-day.is-idle .calendar-day__date,
body[data-theme="dark"] .calendar-day.is-idle .calendar-day__date {
  color: var(--text-1) !important;
  opacity: 0.66 !important;
}

html[data-theme="dark"] .calendar-day.has-trades.is-win,
body[data-theme="dark"] .calendar-day.has-trades.is-win {
  background: color-mix(in srgb, var(--card) 91%, var(--profit) 9%) !important;
  border-color: color-mix(in srgb, var(--border) 84%, var(--profit) 16%) !important;
}

html[data-theme="dark"] .calendar-day.has-trades.is-loss,
body[data-theme="dark"] .calendar-day.has-trades.is-loss {
  background: color-mix(in srgb, var(--card) 91%, var(--loss) 9%) !important;
  border-color: color-mix(in srgb, var(--border) 84%, var(--loss) 16%) !important;
}

html[data-theme="dark"] .calendar-day.has-trades.is-heat-2.is-win,
body[data-theme="dark"] .calendar-day.has-trades.is-heat-2.is-win {
  background: color-mix(in srgb, var(--card) 88%, var(--profit) 12%) !important;
}

html[data-theme="dark"] .calendar-day.has-trades.is-heat-2.is-loss,
body[data-theme="dark"] .calendar-day.has-trades.is-heat-2.is-loss {
  background: color-mix(in srgb, var(--card) 88%, var(--loss) 12%) !important;
}

html[data-theme="dark"] .calendar-day.has-trades.is-heat-3.is-win,
body[data-theme="dark"] .calendar-day.has-trades.is-heat-3.is-win {
  background: color-mix(in srgb, var(--card) 85%, var(--profit) 15%) !important;
}

html[data-theme="dark"] .calendar-day.has-trades.is-heat-3.is-loss,
body[data-theme="dark"] .calendar-day.has-trades.is-heat-3.is-loss {
  background: color-mix(in srgb, var(--card) 85%, var(--loss) 15%) !important;
}

html[data-theme="dark"] .calendar-day.has-trades .calendar-day__count,
body[data-theme="dark"] .calendar-day.has-trades .calendar-day__count {
  color: var(--text-1) !important;
}

html[data-theme="dark"] .calendar-day__pnl,
body[data-theme="dark"] .calendar-day__pnl {
  font-size: 15px !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-idle,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-idle {
  background: rgba(255, 255, 255, 0.012) !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-idle .calendar-day__meta,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-idle .calendar-day__meta {
  color: rgba(255, 255, 255, 0.24) !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-idle .calendar-day__date,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.is-idle .calendar-day__date {
  color: rgba(255, 255, 255, 0.46) !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades.is-win,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades.is-win {
  background: color-mix(in srgb, var(--layer-1) 94%, var(--positive) 6%) !important;
  border-color: color-mix(in srgb, rgba(255, 255, 255, 0.045) 94%, var(--positive) 6%) !important;
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades.is-loss,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades.is-loss {
  background: color-mix(in srgb, var(--layer-1) 94%, var(--negative) 6%) !important;
  border-color: color-mix(in srgb, rgba(255, 255, 255, 0.045) 94%, var(--negative) 6%) !important;
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades.is-heat-2.is-win,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades.is-heat-2.is-win {
  background: color-mix(in srgb, var(--layer-1) 92%, var(--positive) 8%) !important;
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades.is-heat-2.is-loss,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades.is-heat-2.is-loss {
  background: color-mix(in srgb, var(--layer-1) 92%, var(--negative) 8%) !important;
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades.is-heat-3.is-win,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades.is-heat-3.is-win {
  background: color-mix(in srgb, var(--layer-1) 89%, var(--positive) 11%) !important;
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades.is-heat-3.is-loss,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades.is-heat-3.is-loss {
  background: color-mix(in srgb, var(--layer-1) 89%, var(--negative) 11%) !important;
}

html[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades .calendar-day__meta,
body[data-theme="dark"] .analytics-daily-calendar .calendar-day.has-trades .calendar-day__meta {
  color: rgba(255, 255, 255, 0.44) !important;
}

html[data-theme="dark"] .calendar-day.has-trades .calendar-day__meta,
body[data-theme="dark"] .calendar-day.has-trades .calendar-day__meta {
  color: var(--text-2) !important;
  opacity: 0.76 !important;
}

html[data-theme="dark"] .calendar-month-panel .calendar-day.has-trades:hover,
body[data-theme="dark"] .calendar-month-panel .calendar-day.has-trades:hover {
  border-color: color-mix(in srgb, var(--ring) 28%, var(--border));
  transform: translateY(-1px);
}

html[data-theme="dark"] .calendar-month-panel .calendar-day:focus-visible,
body[data-theme="dark"] .calendar-month-panel .calendar-day:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ring) 72%, white 8%);
  outline-offset: 2px;
}

html[data-theme="dark"] .calendar-month-panel .calendar-day.is-selected,
body[data-theme="dark"] .calendar-month-panel .calendar-day.is-selected {
  border-color: color-mix(in srgb, var(--ring) 38%, var(--border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ring) 18%, transparent);
}

html[data-theme="dark"] .calendar-month-panel .calendar-day.is-today:not(.is-selected),
body[data-theme="dark"] .calendar-month-panel .calendar-day.is-today:not(.is-selected) {
  border-color: color-mix(in srgb, var(--foreground) 18%, var(--border));
}

html[data-theme="dark"] .calendar-month-panel .calendar-day.is-outside-month,
body[data-theme="dark"] .calendar-month-panel .calendar-day.is-outside-month {
  filter: saturate(0.72);
}

html[data-theme="dark"] .calendar-matrix-cell--active,
body[data-theme="dark"] .calendar-matrix-cell--active {
  background: transparent !important;
  box-shadow: none !important;
  font-weight: inherit !important;
}

html[data-theme="dark"] .calendar-returns-panel tfoot th,
html[data-theme="dark"] .calendar-returns-panel tfoot td,
body[data-theme="dark"] .calendar-returns-panel tfoot th,
body[data-theme="dark"] .calendar-returns-panel tfoot td {
  color: var(--text-1) !important;
  font-weight: 600 !important;
}

html[data-theme="dark"] .calendar-returns-panel tfoot th,
body[data-theme="dark"] .calendar-returns-panel tfoot th {
  opacity: 0.82 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz {
  flex: 1 1 auto !important;
  min-height: 252px !important;
  padding-top: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
}

html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz .kmfx-chart-shell--hero,
body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz .kmfx-chart-shell--hero {
  min-height: 252px !important;
}

@media (max-width: 980px) {
  html[data-theme="dark"] .account-banner--hero-refined,
  body[data-theme="dark"] .account-banner--hero-refined {
    padding: 16px 18px !important;
  }

  html[data-theme="dark"] .account-banner--hero-refined .account-banner-controls--overlay,
  body[data-theme="dark"] .account-banner--hero-refined .account-banner-controls--overlay {
    top: 2px !important;
  }

  html[data-theme="dark"] .account-banner--hero-refined .account-banner-body,
  body[data-theme="dark"] .account-banner--hero-refined .account-banner-body {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  html[data-theme="dark"] .account-banner--hero-refined .account-banner-info,
  body[data-theme="dark"] .account-banner--hero-refined .account-banner-info {
    padding: 8px 0 0 !important;
  }

  html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz,
  body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz,
  html[data-theme="dark"] .account-banner--hero-refined .account-banner-viz .kmfx-chart-shell--hero,
  body[data-theme="dark"] .account-banner--hero-refined .account-banner-viz .kmfx-chart-shell--hero {
    min-height: 214px !important;
  }
}

/* Hero I — quieter secondary metric values */
html[data-theme="dark"] .account-banner--hero-refined .metric-line strong,
body[data-theme="dark"] .account-banner--hero-refined .metric-line strong {
  font-size: 15px !important;
  font-weight: 600 !important;
}

/* 2. Evitar nested cards */
html[data-theme="dark"] .widget-card .widget-card,
html[data-theme="dark"] .widget-card .kpi-card,
html[data-theme="dark"] .widget-card .mini-widget,
html[data-theme="dark"] .widget-card .session-card,
html[data-theme="dark"] .widget-card .inner-card,
body[data-theme="dark"] .widget-card .widget-card,
body[data-theme="dark"] .widget-card .kpi-card,
body[data-theme="dark"] .widget-card .mini-widget,
body[data-theme="dark"] .widget-card .session-card,
body[data-theme="dark"] .widget-card .inner-card {
  background: var(--layer-1-subtle) !important;
  border: 1px solid var(--border-0) !important;
  box-shadow: none !important;
}

/* 3. Widgets sueltos dentro de secciones grandes */
html[data-theme="dark"] .session-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .mini-widget,
body[data-theme="dark"] .session-card,
body[data-theme="dark"] .kpi-card,
body[data-theme="dark"] .mini-widget {
  background: var(--layer-1-subtle) !important;
  border: 1px solid var(--border-0) !important;
  box-shadow: none !important;
}

/* 4. Asegurar que las cards principales mantienen su identidad */
html[data-theme="dark"] .widget-card,
body[data-theme="dark"] .widget-card {
  background: var(--layer-1) !important;
}

/* 5. Reducir contraste excesivo en agrupaciones internas */
html[data-theme="dark"] .widget-card .group,
body[data-theme="dark"] .widget-card .group {
  background: transparent !important;
  border: none !important;
}

/* Phase 4D.2 — Surface normalization */

/* 1. Nuevo nivel para panels grandes */
:root {
  --layer-1-elevated: rgba(255, 255, 255, 0.035);
}

/* 2. Normalizar charts y widgets grandes */
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .analytics-card,
html[data-theme="dark"] .performance-card,
html[data-theme="dark"] .distribution-card,
html[data-theme="dark"] .table-card,
body[data-theme="dark"] .chart-card,
body[data-theme="dark"] .analytics-card,
body[data-theme="dark"] .performance-card,
body[data-theme="dark"] .distribution-card,
body[data-theme="dark"] .table-card {
  background: var(--layer-1-elevated) !important;
  border: 1px solid var(--border-0) !important;
}

/* Phase 5 — Unified card pattern */

/* 1. Canonical card tokens for v2 */
:root,
[data-theme="dark"] {
  --card-surface: var(--layer-1);
  --card-border: var(--border-0);
  --card-radius: 16px;
}

/* 2. Unified base card family */
html[data-theme="dark"] .widget-card,
html[data-theme="dark"] .tl-kpi-card,
html[data-theme="dark"] .rm4-card,
html[data-theme="dark"] .tl-section-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .pnlcal-card,
html[data-theme="dark"] .account-hero-card,
html[data-theme="dark"] .widget-card--kpi,
html[data-theme="dark"] .widget-card--kpi-pnl,
html[data-theme="dark"] .widget-card--kpi-wr,
html[data-theme="dark"] .widget-card--kpi-trades,
html[data-theme="dark"] .widget-card--kpi-pf,
html[data-theme="dark"] .widget-card--kpi-best,
body[data-theme="dark"] .widget-card,
body[data-theme="dark"] .tl-kpi-card,
body[data-theme="dark"] .rm4-card,
body[data-theme="dark"] .tl-section-card,
body[data-theme="dark"] .chart-card,
body[data-theme="dark"] .pnlcal-card,
body[data-theme="dark"] .account-hero-card,
body[data-theme="dark"] .widget-card--kpi,
body[data-theme="dark"] .widget-card--kpi-pnl,
body[data-theme="dark"] .widget-card--kpi-wr,
body[data-theme="dark"] .widget-card--kpi-trades,
body[data-theme="dark"] .widget-card--kpi-pf,
body[data-theme="dark"] .widget-card--kpi-best {
  background: var(--card-surface) !important;
  background-image: none !important;
  border: 1px solid var(--card-border) !important;
  border-radius: var(--card-radius) !important;
  box-shadow: none !important;
}

/* 3. Keep large chart/panel wrappers inside the same family for now */
html[data-theme="dark"] .analytics-card,
html[data-theme="dark"] .performance-card,
html[data-theme="dark"] .distribution-card,
html[data-theme="dark"] .table-card,
body[data-theme="dark"] .analytics-card,
body[data-theme="dark"] .performance-card,
body[data-theme="dark"] .distribution-card,
body[data-theme="dark"] .table-card {
  background: var(--card-surface) !important;
  border: 1px solid var(--card-border) !important;
  box-shadow: none !important;
}

/* Phase 5.1 — analytics large-card surface fix */
html[data-theme="dark"] .analytics-card,
html[data-theme="dark"] .performance-card,
html[data-theme="dark"] .distribution-card,
html[data-theme="dark"] .table-card,
body[data-theme="dark"] .analytics-card,
body[data-theme="dark"] .performance-card,
body[data-theme="dark"] .distribution-card,
body[data-theme="dark"] .table-card {
  background: var(--card-surface) !important;
  background-image: none !important;
  border: 1px solid var(--card-border) !important;
  box-shadow: none !important;
}

/* Stop inner chart/distribution wrappers from repainting large cards */
html[data-theme="dark"] .widget-card [class*="chart"],
html[data-theme="dark"] .widget-card [class*="distribution"],
body[data-theme="dark"] .widget-card [class*="chart"],
body[data-theme="dark"] .widget-card [class*="distribution"] {
  background: transparent !important;
}

/* 3. Forzar consistencia en charts concretos */
html[data-theme="dark"] .widget-card canvas,
body[data-theme="dark"] .widget-card canvas {
  background: transparent !important;
}

/* 4. Evitar tonos azulados inconsistentes */
html[data-theme="dark"] .widget-card [class*="chart"],
html[data-theme="dark"] .widget-card [class*="distribution"],
body[data-theme="dark"] .widget-card [class*="chart"],
body[data-theme="dark"] .widget-card [class*="distribution"] {
  background: var(--layer-1-elevated) !important;
}

/* Sidebar profile widget refinement */
html[data-theme="dark"] .sidebar-profile,
body[data-theme="dark"] .sidebar-profile {
  background: var(--layer-2) !important;
  border: 1px solid var(--border-0) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  padding: 12px !important;
  gap: 12px !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .sidebar-profile:hover,
body[data-theme="dark"] .sidebar-profile:hover {
  background: var(--layer-2) !important;
  border-color: var(--border-0) !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme="dark"] .sidebar-profile-main,
body[data-theme="dark"] .sidebar-profile-main {
  gap: 12px !important;
  align-items: center !important;
}

html[data-theme="dark"] .sidebar-profile-avatar,
body[data-theme="dark"] .sidebar-profile-avatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  background: color-mix(in srgb, var(--layer-3) 72%, var(--layer-2)) !important;
  border: 1px solid var(--border-0) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .sidebar-profile-copy,
body[data-theme="dark"] .sidebar-profile-copy {
  gap: 3px !important;
  align-content: center !important;
}

html[data-theme="dark"] .sidebar-profile-name,
body[data-theme="dark"] .sidebar-profile-name {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--text-0) !important;
  line-height: 1.15 !important;
}

html[data-theme="dark"] .sidebar-profile-sub,
body[data-theme="dark"] .sidebar-profile-sub {
  font-size: 10px !important;
  color: var(--text-2) !important;
  line-height: 1.15 !important;
}

html[data-theme="dark"] .sidebar-profile-menu-btn,
body[data-theme="dark"] .sidebar-profile-menu-btn {
  width: 30px !important;
  height: 30px !important;
  border-radius: 10px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Topbar cleanup — remove duplicated user block */
html[data-theme="dark"] .topbar-user-card,
body[data-theme="dark"] .topbar-user-card {
  display: none !important;
}

html[data-theme="dark"] .topbar-user-shell,
body[data-theme="dark"] .topbar-user-shell {
  gap: 0 !important;
}

html[data-theme="dark"] .topbar-meta,
body[data-theme="dark"] .topbar-meta {
  gap: 0 !important;
}

/* Sidebar profile — align with main widget surface */
html[data-theme="dark"] .sidebar-profile,
body[data-theme="dark"] .sidebar-profile {
  background: var(--card-surface) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: var(--card-radius) !important;
  box-shadow: none !important;
  padding: 14px !important;
  gap: 12px !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .sidebar-profile:hover,
body[data-theme="dark"] .sidebar-profile:hover {
  background: var(--card-surface) !important;
  border-color: var(--card-border) !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme="dark"] .sidebar-profile-main,
body[data-theme="dark"] .sidebar-profile-main {
  gap: 12px !important;
  align-items: center !important;
}

html[data-theme="dark"] .sidebar-profile-copy,
body[data-theme="dark"] .sidebar-profile-copy {
  gap: 4px !important;
  align-content: center !important;
}

/* Phase 3A — base card surface normalization */
html[data-theme="dark"] .widget-card,
html[data-theme="dark"] .tl-kpi-card,
html[data-theme="dark"] .rm4-card,
html[data-theme="dark"] .tl-section-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .pnlcal-card,
body[data-theme="dark"] .widget-card,
body[data-theme="dark"] .tl-kpi-card,
body[data-theme="dark"] .rm4-card,
body[data-theme="dark"] .tl-section-card,
body[data-theme="dark"] .chart-card,
body[data-theme="dark"] .pnlcal-card {
  background: var(--layer-1) !important;
  background-image: none !important;
  border: 1px solid var(--border-0) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .widget-card:hover,
html[data-theme="dark"] .tl-kpi-card:hover,
html[data-theme="dark"] .rm4-card:hover,
html[data-theme="dark"] .tl-section-card:hover,
html[data-theme="dark"] .chart-card:hover,
html[data-theme="dark"] .pnlcal-card:hover,
body[data-theme="dark"] .widget-card:hover,
body[data-theme="dark"] .tl-kpi-card:hover,
body[data-theme="dark"] .rm4-card:hover,
body[data-theme="dark"] .tl-section-card:hover,
body[data-theme="dark"] .chart-card:hover,
body[data-theme="dark"] .pnlcal-card:hover {
  background: var(--layer-1) !important;
  background-image: none !important;
  border-color: var(--border-0) !important;
  box-shadow: none !important;
}

/* Phase 3B.1 — KPI/Card density alignment */
html[data-theme="dark"] .widget-card,
html[data-theme="dark"] .rm4-card,
body[data-theme="dark"] .widget-card,
body[data-theme="dark"] .rm4-card {
  padding: 20px !important;
}

html[data-theme="dark"] .tl-kpi-card,
body[data-theme="dark"] .tl-kpi-card {
  padding: 18px !important;
}

html[data-theme="dark"] .tl-kpi-label,
html[data-theme="dark"] .rm4-label,
html[data-theme="dark"] .widget-card-meta,
html[data-theme="dark"] .widget-eyebrow,
html[data-theme="dark"] .metric-rail-hint,
body[data-theme="dark"] .tl-kpi-label,
body[data-theme="dark"] .rm4-label,
body[data-theme="dark"] .widget-card-meta,
body[data-theme="dark"] .widget-eyebrow,
body[data-theme="dark"] .metric-rail-hint {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] .tl-kpi-val,
html[data-theme="dark"] .rm4-val,
html[data-theme="dark"] .metric-large,
html[data-theme="dark"] .tl-kpi-value,
html[data-theme="dark"] .metric-value,
html[data-theme="dark"] .kpi-value,
body[data-theme="dark"] .tl-kpi-val,
body[data-theme="dark"] .rm4-val,
body[data-theme="dark"] .metric-large,
body[data-theme="dark"] .tl-kpi-value,
body[data-theme="dark"] .metric-value,
body[data-theme="dark"] .kpi-value {
  font-size: 28px !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  line-height: 1.05 !important;
  color: var(--text-0) !important;
}

html[data-theme="dark"] .widget-kpi-trend,
body[data-theme="dark"] .widget-kpi-trend {
  margin-top: 8px !important;
  color: var(--text-2) !important;
}

/* Phase 3B.2 — section/card header rhythm */
html[data-theme="dark"] .tl-section-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .pnlcal-card,
body[data-theme="dark"] .tl-section-card,
body[data-theme="dark"] .chart-card,
body[data-theme="dark"] .pnlcal-card {
  padding: 20px !important;
}

html[data-theme="dark"] .tl-section-header,
body[data-theme="dark"] .tl-section-header {
  margin-bottom: 12px !important;
  gap: 12px !important;
}

html[data-theme="dark"] .tl-section-title,
html[data-theme="dark"] .section-title,
body[data-theme="dark"] .tl-section-title,
body[data-theme="dark"] .section-title {
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
  color: var(--text-0) !important;
  margin-bottom: 4px !important;
}

html[data-theme="dark"] .tl-section-subtitle,
html[data-theme="dark"] .section-subtitle,
body[data-theme="dark"] .tl-section-subtitle,
body[data-theme="dark"] .section-subtitle {
  font-size: 12px !important;
  color: var(--text-2) !important;
  margin-bottom: 0 !important;
}

/* Phase 3B.3 — special KPI widget normalization */
html[data-theme="dark"] .widget-card--kpi,
body[data-theme="dark"] .widget-card--kpi,
html[data-theme="dark"] .widget-card--kpi-pnl,
html[data-theme="dark"] .widget-card--kpi-wr,
html[data-theme="dark"] .widget-card--kpi-trades,
html[data-theme="dark"] .widget-card--kpi-pf,
html[data-theme="dark"] .widget-card--kpi-best,
body[data-theme="dark"] .widget-card--kpi-pnl,
body[data-theme="dark"] .widget-card--kpi-wr,
body[data-theme="dark"] .widget-card--kpi-trades,
body[data-theme="dark"] .widget-card--kpi-pf,
body[data-theme="dark"] .widget-card--kpi-best {
  background: var(--card-surface) !important;
  border-color: var(--card-border) !important;
  min-height: 164px !important;
  padding: 20px !important;
}

html[data-theme="dark"] .widget-card--kpi .tl-kpi-label,
body[data-theme="dark"] .widget-card--kpi .tl-kpi-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] .widget-card--kpi .tl-kpi-val,
body[data-theme="dark"] .widget-card--kpi .tl-kpi-val {
  font-size: 28px !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  line-height: 1.05 !important;
  color: var(--text-0) !important;
}

html[data-theme="dark"] .widget-card--kpi .widget-card-meta,
html[data-theme="dark"] .widget-card--kpi .widget-kpi-trend,
body[data-theme="dark"] .widget-card--kpi .widget-card-meta,
body[data-theme="dark"] .widget-card--kpi .widget-kpi-trend {
  font-size: 11px !important;
  line-height: 1.3 !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] .widget-card--kpi .widget-card-meta,
body[data-theme="dark"] .widget-card--kpi .widget-card-meta {
  margin-top: 8px !important;
}

html[data-theme="dark"] .widget-card--kpi .widget-kpi-trend,
body[data-theme="dark"] .widget-card--kpi .widget-kpi-trend {
  margin-top: 8px !important;
  letter-spacing: 0.05em !important;
}

/* Phase 3C.1 — account hero card family integration */
html[data-theme="dark"] .account-hero-card,
body[data-theme="dark"] .account-hero-card,
html[data-theme="dark"] .account-hero-card:not(.active):not(.account-hero-card--main),
body[data-theme="dark"] .account-hero-card:not(.active):not(.account-hero-card--main) {
  background: var(--card-surface) !important;
  background-image: none !important;
  border: 1px solid var(--card-border) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .account-hero-card.active,
html[data-theme="dark"] .account-hero-card--main,
body[data-theme="dark"] .account-hero-card.active,
body[data-theme="dark"] .account-hero-card--main {
  background: var(--card-surface) !important;
  background-image: none !important;
  border: 1px solid var(--border-1) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .account-card-blobs,
html[data-theme="dark"] .account-card-blob,
body[data-theme="dark"] .account-card-blobs,
body[data-theme="dark"] .account-card-blob {
  opacity: 0 !important;
  background: none !important;
  filter: none !important;
}

/* Phase 3C.2 — account hero internal hierarchy */
html[data-theme="dark"] .account-hero-card--main .account-hero-card__content,
body[data-theme="dark"] .account-hero-card--main .account-hero-card__content {
  padding: 20px !important;
}

html[data-theme="dark"] .account-hero-card--side .account-hero-card__content,
body[data-theme="dark"] .account-hero-card--side .account-hero-card__content {
  padding: 18px !important;
}

html[data-theme="dark"] .account-hero-card--main .account-hero-card__top,
body[data-theme="dark"] .account-hero-card--main .account-hero-card__top {
  gap: 12px !important;
  margin-bottom: 18px !important;
}

html[data-theme="dark"] .account-hero-card--side .account-hero-card__top,
body[data-theme="dark"] .account-hero-card--side .account-hero-card__top {
  gap: 12px !important;
  margin-bottom: 14px !important;
}

html[data-theme="dark"] .account-hero-card--main .account-hero-card__name,
body[data-theme="dark"] .account-hero-card--main .account-hero-card__name {
  font-size: 17px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}

html[data-theme="dark"] .account-hero-card--side .account-hero-card__name,
body[data-theme="dark"] .account-hero-card--side .account-hero-card__name {
  font-size: 14px !important;
  font-weight: 650 !important;
  letter-spacing: -0.01em !important;
}

html[data-theme="dark"] .account-hero-card__meta,
body[data-theme="dark"] .account-hero-card__meta {
  font-size: 11px !important;
  line-height: 1.35 !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] .account-hero-card--main .account-hero-card__equity,
body[data-theme="dark"] .account-hero-card--main .account-hero-card__equity {
  font-size: 32px !important;
  line-height: 1 !important;
  letter-spacing: -0.04em !important;
  margin-bottom: 4px !important;
}

html[data-theme="dark"] .account-hero-card--side .account-hero-card__equity,
body[data-theme="dark"] .account-hero-card--side .account-hero-card__equity {
  font-size: 24px !important;
  line-height: 1 !important;
  letter-spacing: -0.03em !important;
  margin-bottom: 4px !important;
}

html[data-theme="dark"] .account-hero-card__equity-label,
html[data-theme="dark"] .account-hero-card__stat-label,
body[data-theme="dark"] .account-hero-card__equity-label,
body[data-theme="dark"] .account-hero-card__stat-label {
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] .account-hero-card--main .account-hero-card__stats,
body[data-theme="dark"] .account-hero-card--main .account-hero-card__stats {
  gap: 10px !important;
  padding-top: 14px !important;
  border-top: 1px solid var(--border-0) !important;
}

html[data-theme="dark"] .account-hero-card--side .account-hero-card__stats,
body[data-theme="dark"] .account-hero-card--side .account-hero-card__stats {
  gap: 10px !important;
  padding-top: 12px !important;
  border-top: 1px solid var(--border-0) !important;
}

html[data-theme="dark"] .account-hero-card--main .account-hero-card__stat-val,
body[data-theme="dark"] .account-hero-card--main .account-hero-card__stat-val {
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}

html[data-theme="dark"] .account-hero-card--side .account-hero-card__stat-val,
body[data-theme="dark"] .account-hero-card--side .account-hero-card__stat-val {
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}

/* Phase 4A — Hero + Performance emphasis */
html[data-theme="dark"] .account-hero-card--main .account-hero-card__equity,
body[data-theme="dark"] .account-hero-card--main .account-hero-card__equity,
html[data-theme="dark"] .metric-large,
html[data-theme="dark"] .metric-value,
html[data-theme="dark"] .kpi-value,
body[data-theme="dark"] .metric-large,
body[data-theme="dark"] .metric-value,
body[data-theme="dark"] .kpi-value {
  font-size: 30px !important;
  font-weight: 700 !important;
  letter-spacing: -0.04em !important;
  line-height: 1 !important;
  color: var(--text-0) !important;
}

html[data-theme="dark"] .account-hero-card--side .account-hero-card__equity,
body[data-theme="dark"] .account-hero-card--side .account-hero-card__equity,
html[data-theme="dark"] .tl-kpi-val,
html[data-theme="dark"] .tl-kpi-value,
html[data-theme="dark"] .rm4-val,
body[data-theme="dark"] .tl-kpi-val,
body[data-theme="dark"] .tl-kpi-value,
body[data-theme="dark"] .rm4-val {
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  color: var(--text-0) !important;
}

html[data-theme="dark"] .account-hero-card__equity-label,
html[data-theme="dark"] .tl-kpi-label,
html[data-theme="dark"] .rm4-label,
html[data-theme="dark"] .metric-label,
body[data-theme="dark"] .account-hero-card__equity-label,
body[data-theme="dark"] .tl-kpi-label,
body[data-theme="dark"] .rm4-label,
body[data-theme="dark"] .metric-label {
  color: var(--text-2) !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em !important;
}

html[data-theme="dark"] .account-hero-card__stat-val,
body[data-theme="dark"] .account-hero-card__stat-val,
html[data-theme="dark"] .widget-kpi-trend,
body[data-theme="dark"] .widget-kpi-trend {
  font-weight: 650 !important;
}

html[data-theme="dark"] .widget-card-meta,
html[data-theme="dark"] .metric-rail-hint,
body[data-theme="dark"] .widget-card-meta,
body[data-theme="dark"] .metric-rail-hint {
  color: var(--text-1) !important;
}

html[data-theme="dark"] .widget-kpi-trend.green,
body[data-theme="dark"] .widget-kpi-trend.green,
html[data-theme="dark"] .account-hero-card__stat-val.green,
body[data-theme="dark"] .account-hero-card__stat-val.green {
  color: var(--positive) !important;
}

html[data-theme="dark"] .widget-kpi-trend.red,
body[data-theme="dark"] .widget-kpi-trend.red {
  color: var(--negative) !important;
}

/* Phase 4B — Support + Diagnostic quieting */
html[data-theme="dark"] .tl-kpi-label,
html[data-theme="dark"] .rm4-label,
html[data-theme="dark"] .metric-label,
html[data-theme="dark"] .widget-card-meta,
html[data-theme="dark"] .metric-rail-hint,
html[data-theme="dark"] .account-hero-card__stat-label,
body[data-theme="dark"] .tl-kpi-label,
body[data-theme="dark"] .rm4-label,
body[data-theme="dark"] .metric-label,
body[data-theme="dark"] .widget-card-meta,
body[data-theme="dark"] .metric-rail-hint,
body[data-theme="dark"] .account-hero-card__stat-label {
  color: var(--text-2) !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em !important;
}

html[data-theme="dark"] .widget-card-meta,
html[data-theme="dark"] .metric-rail-hint,
body[data-theme="dark"] .widget-card-meta,
body[data-theme="dark"] .metric-rail-hint {
  line-height: 1.3 !important;
}

html[data-theme="dark"] .account-hero-card__stat-label,
body[data-theme="dark"] .account-hero-card__stat-label {
  font-size: 9px !important;
}

/* Phase 4C — Chips / Pills / Badges hierarchy */
html[data-theme="dark"] .widget-pill,
html[data-theme="dark"] .pill,
html[data-theme="dark"] .row-chip,
html[data-theme="dark"] .calc-chip,
body[data-theme="dark"] .widget-pill,
body[data-theme="dark"] .pill,
body[data-theme="dark"] .row-chip,
body[data-theme="dark"] .calc-chip {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid var(--border-0) !important;
  color: var(--text-2) !important;
  font-weight: 500 !important;
  font-size: 10px !important;
  letter-spacing: 0.03em !important;
  padding: 3px 9px !important;
}

html[data-theme="dark"] .account-hero-card .status-badge,
body[data-theme="dark"] .account-hero-card .status-badge {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: rgba(255, 255, 255, 0.62) !important;
  font-size: 10px !important;
  font-weight: 550 !important;
  letter-spacing: 0.03em !important;
  padding: 4px 10px !important;
}

html[data-theme="dark"] .account-hero-card .status-dot,
body[data-theme="dark"] .account-hero-card .status-dot {
  opacity: 0.9 !important;
}

html[data-theme="dark"] .account-hero-card .status-dot.connected,
body[data-theme="dark"] .account-hero-card .status-dot.connected {
  background: var(--positive) !important;
}

html[data-theme="dark"] .account-hero-card .status-badge.is-warning,
html[data-theme="dark"] .account-hero-card .status-badge.is-disconnected,
body[data-theme="dark"] .account-hero-card .status-badge.is-warning,
body[data-theme="dark"] .account-hero-card .status-badge.is-disconnected {
  color: rgba(255, 255, 255, 0.56) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Sidebar profile card restoration */
html[data-theme="dark"] .sidebar-profile,
body[data-theme="dark"] .sidebar-profile {
  background: var(--layer-2) !important;
  border: 1px solid var(--border-0) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .sidebar-profile:hover,
body[data-theme="dark"] .sidebar-profile:hover {
  background: var(--layer-2) !important;
  border-color: var(--border-0) !important;
  box-shadow: none !important;
}

/* Topbar spacing correction — avatar and time/date */
html[data-theme="dark"] .topbar-meta,
body[data-theme="dark"] .topbar-meta,
html[data-theme="dark"] .topbar-user-shell,
body[data-theme="dark"] .topbar-user-shell {
  gap: 5px !important;
}

/* Topbar refinement — dark only */
html[data-theme="dark"] .topbar-meta,
body[data-theme="dark"] .topbar-meta,
html[data-theme="dark"] .topbar-user-shell,
body[data-theme="dark"] .topbar-user-shell {
  gap: 6px !important;
}

html[data-theme="dark"] .topbar-user-card,
html[data-theme="dark"] .topbar-time-stack,
body[data-theme="dark"] .topbar-user-card,
body[data-theme="dark"] .topbar-time-stack {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: auto !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .topbar-user-avatar,
body[data-theme="dark"] .topbar-user-avatar {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
}

/* Ocultar copy del topbar si existe en runtime */
html[data-theme="dark"] .topbar-user-copy,
html[data-theme="dark"] .topbar-user-name,
html[data-theme="dark"] .topbar-user-context,
body[data-theme="dark"] .topbar-user-copy,
body[data-theme="dark"] .topbar-user-name,
body[data-theme="dark"] .topbar-user-context {
  display: none !important;
}

html[data-theme="dark"] .meta-date,
body[data-theme="dark"] .meta-date {
  font-size: 11px !important;
  line-height: 1.1 !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] .meta-clock,
body[data-theme="dark"] .meta-clock {
  font-size: 13px !important;
  line-height: 1.1 !important;
  color: var(--text-0) !important;
}

/* Sidebar refinement — dark only */
html[data-theme="dark"] .brand-lockup,
body[data-theme="dark"] .brand-lockup {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
}

html[data-theme="dark"] .sidebar-profile,
body[data-theme="dark"] .sidebar-profile {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .sidebar-profile:hover,
body[data-theme="dark"] .sidebar-profile:hover {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .sidebar-profile-avatar,
body[data-theme="dark"] .sidebar-profile-avatar {
  background: rgba(255,255,255,0.04) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .sidebar-profile-copy,
body[data-theme="dark"] .sidebar-profile-copy {
  gap: 2px !important;
}

html[data-theme="dark"] .sidebar-profile-name,
body[data-theme="dark"] .sidebar-profile-name {
  color: var(--text-0) !important;
}

html[data-theme="dark"] .sidebar-profile-sub,
body[data-theme="dark"] .sidebar-profile-sub {
  color: var(--text-2) !important;
}

html[data-theme="dark"] .sidebar-profile-menu-btn,
body[data-theme="dark"] .sidebar-profile-menu-btn {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .sidebar-account-slot,
body[data-theme="dark"] .sidebar-account-slot {
  display: grid;
  margin-top: 10px;
}

html[data-theme="dark"] .sidebar-account-switcher,
body[data-theme="dark"] .sidebar-account-switcher {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 4px 8px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

html[data-theme="dark"] .sidebar-account-switcher--empty,
body[data-theme="dark"] .sidebar-account-switcher--empty {
  text-align: left;
  cursor: pointer;
}

html[data-theme="dark"] .sidebar-account-switcher__icon,
body[data-theme="dark"] .sidebar-account-switcher__icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--layer-2);
  color: var(--text-0);
  padding: 0;
}

html[data-theme="dark"] .sidebar-account-switcher__icon-image,
body[data-theme="dark"] .sidebar-account-switcher__icon-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

html[data-theme="dark"] .sidebar-account-switcher__icon-glyph,
body[data-theme="dark"] .sidebar-account-switcher__icon-glyph {
  font-size: 16px;
  line-height: 1;
  color: var(--text-1);
}

html[data-theme="dark"] .sidebar-account-switcher__copy,
body[data-theme="dark"] .sidebar-account-switcher__copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

html[data-theme="dark"] .sidebar-account-switcher__title,
body[data-theme="dark"] .sidebar-account-switcher__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 620;
  line-height: 1.2;
  color: var(--text-0);
}

html[data-theme="dark"] .sidebar-account-switcher__balance,
body[data-theme="dark"] .sidebar-account-switcher__balance {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.2;
  color: var(--text-2);
}

html[data-theme="dark"] .sidebar-account-switcher__select,
body[data-theme="dark"] .sidebar-account-switcher__select {
  width: 100%;
  min-width: 0;
  min-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-0);
  font-size: 13px;
  font-weight: 620;
  line-height: 1.2;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .sidebar-account-switcher__select:focus-visible,
body[data-theme="dark"] .sidebar-account-switcher__select:focus-visible,
html[data-theme="dark"] .sidebar-account-switcher--empty:focus-visible,
body[data-theme="dark"] .sidebar-account-switcher--empty:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 58%, transparent);
  outline-offset: 2px;
}

html[data-theme="dark"] .sidebar-account-switcher--empty:hover,
body[data-theme="dark"] .sidebar-account-switcher--empty:hover {
  background: transparent;
}

/* Main content refinement — dark only */
html[data-theme="dark"] .main-panel,
body[data-theme="dark"] .main-panel,
[data-theme="dark"] .main-panel,
html[data-theme="dark"] .content,
body[data-theme="dark"] .content,
[data-theme="dark"] .content {
  background: #101011 !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Shell correction — restore shared background */
html[data-theme="dark"] .main-panel,
body[data-theme="dark"] .main-panel,
[data-theme="dark"] .main-panel,
html[data-theme="dark"] .content,
body[data-theme="dark"] .content,
[data-theme="dark"] .content {
  background: #0a0a0a !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Topbar compaction — avatar + time */
html[data-theme="dark"] .topbar-meta,
body[data-theme="dark"] .topbar-meta,
html[data-theme="dark"] .topbar-user-shell,
body[data-theme="dark"] .topbar-user-shell {
  gap: 4px !important;
}

html[data-theme="dark"] .topbar-user-card,
html[data-theme="dark"] .topbar-time-stack,
body[data-theme="dark"] .topbar-user-card,
body[data-theme="dark"] .topbar-time-stack {
  gap: 4px !important;
  padding: 0 !important;
  min-height: auto !important;
}

html[data-theme="dark"] .topbar-user-avatar,
body[data-theme="dark"] .topbar-user-avatar {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
}

html[data-theme="dark"] .meta-date,
body[data-theme="dark"] .meta-date {
  font-size: 10px !important;
  line-height: 1.05 !important;
}

html[data-theme="dark"] .meta-clock,
body[data-theme="dark"] .meta-clock {
  font-size: 12px !important;
  line-height: 1.05 !important;
}

/* Topbar micro-compaction — avatar attached to time */
html[data-theme="dark"] .topbar-meta,
body[data-theme="dark"] .topbar-meta {
  gap: 1px !important;
}

html[data-theme="dark"] .topbar,
body[data-theme="dark"] .topbar {
  min-height: 34px !important;
  padding: 4px 18px !important;
  gap: 8px !important;
}

html[data-theme="dark"] .topbar-brand,
body[data-theme="dark"] .topbar-brand {
  min-width: 0 !important;
  gap: 0 !important;
}

html[data-theme="dark"] .topbar-title,
body[data-theme="dark"] .topbar-title {
  display: none !important;
}

html[data-theme="dark"] .topbar-sub,
body[data-theme="dark"] .topbar-sub {
  margin: 0 !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  color: var(--text-2) !important;
  opacity: 0.62 !important;
  max-width: 280px !important;
}

html[data-theme="dark"] .topbar-user-shell,
body[data-theme="dark"] .topbar-user-shell {
  gap: 1px !important;
}

/* Topbar scroll polish — integrated glass shell */
html[data-theme="dark"] .topbar,
body[data-theme="dark"] .topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 24 !important;
  background: rgba(10, 10, 10, 0.4) !important;
  background-image: none !important;
  backdrop-filter: blur(18px) saturate(112%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(112%) !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

html[data-theme="dark"] .main-panel,
body[data-theme="dark"] .main-panel,
[data-theme="dark"] .main-panel {
  gap: 2px !important;
  padding-top: 0 !important;
}

html[data-theme="dark"] .content,
body[data-theme="dark"] .content,
[data-theme="dark"] .content {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

html[data-theme="dark"] .content::before,
body[data-theme="dark"] .content::before,
[data-theme="dark"] .content::before {
  content: none !important;
  display: none !important;
}

html[data-theme="dark"] .content::after,
body[data-theme="dark"] .content::after,
[data-theme="dark"] .content::after {
  content: none !important;
  display: none !important;
}

html[data-theme="dark"] .content-sticky-header,
body[data-theme="dark"] .content-sticky-header {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  width: fit-content !important;
  max-width: min(260px, calc(100vw - 320px)) !important;
  min-height: 0 !important;
  padding: 7px 15px !important;
  margin: 12px 0 8px auto !important;
  border-radius: 999px !important;
  background: rgba(12, 12, 12, 0.48) !important;
  border: 1px solid rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(16px) saturate(110%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(110%) !important;
  box-shadow: 0 10px 24px -22px rgba(0, 0, 0, 0.44) !important;
  isolation: auto !important;
  overflow: visible !important;
}

html[data-theme="dark"] .content-sticky-header::before,
body[data-theme="dark"] .content-sticky-header::before {
  content: "" !important;
  position: absolute !important;
  top: -8px !important;
  right: -14px !important;
  width: calc(100% + 28px) !important;
  height: 56px !important;
  border-radius: 999px !important;
  pointer-events: none !important;
  z-index: -1 !important;
  background: rgba(10, 10, 10, 0.12) !important;
  backdrop-filter: blur(12px) saturate(106%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(106%) !important;
}

html[data-theme="dark"] .content-sticky-header__context,
body[data-theme="dark"] .content-sticky-header__context {
  display: none !important;
}

html[data-theme="dark"] .content-sticky-header__meta,
body[data-theme="dark"] .content-sticky-header__meta {
  margin-left: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  width: fit-content !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .content-sticky-header .topbar-user-card,
body[data-theme="dark"] .content-sticky-header .topbar-user-card {
  display: none !important;
}

html[data-theme="dark"] .content-sticky-header .topbar-user-shell,
body[data-theme="dark"] .content-sticky-header .topbar-user-shell {
  gap: 0 !important;
  width: fit-content !important;
}

html[data-theme="dark"] .content-sticky-header .topbar-time-stack,
body[data-theme="dark"] .content-sticky-header .topbar-time-stack {
  display: flex !important;
  align-items: baseline !important;
  gap: 8px !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
  min-width: auto !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .content-sticky-header .meta-date,
body[data-theme="dark"] .content-sticky-header .meta-date {
  font-size: 10px !important;
  line-height: 1 !important;
  color: var(--text-2) !important;
  opacity: 0.68 !important;
}

html[data-theme="dark"] .content-sticky-header .meta-clock,
body[data-theme="dark"] .content-sticky-header .meta-clock {
  font-size: 11px !important;
  line-height: 1 !important;
  font-weight: 600 !important;
  color: var(--text-0) !important;
}

html[data-theme="dark"] .topbar::before,
html[data-theme="dark"] .topbar::after,
body[data-theme="dark"] .topbar::before,
body[data-theme="dark"] .topbar::after {
  content: none !important;
  display: block !important;
}

html[data-theme="dark"] .topbar::after,
body[data-theme="dark"] .topbar::after {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: 100% !important;
  height: 14px !important;
  pointer-events: none !important;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.12), rgba(10, 10, 10, 0.04) 45%, rgba(10, 10, 10, 0)) !important;
}

html[data-theme="dark"] .topbar-user-card,
body[data-theme="dark"] .topbar-user-card {
  display: none !important;
}

html[data-theme="dark"] .topbar-time-stack,
body[data-theme="dark"] .topbar-time-stack {
  display: flex !important;
  align-items: baseline !important;
  gap: 5px !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
  min-width: auto !important;
}

html[data-theme="dark"] .topbar-meta,
body[data-theme="dark"] .topbar-meta {
  margin-left: auto !important;
}

html[data-theme="dark"] .meta-date,
body[data-theme="dark"] .meta-date {
  font-size: 10px !important;
  line-height: 1 !important;
  opacity: 0.68 !important;
}

html[data-theme="dark"] .meta-clock,
body[data-theme="dark"] .meta-clock {
  font-size: 11px !important;
  line-height: 1 !important;
  font-weight: 600 !important;
}

/* Sidebar flattening override — dark only (v2 refinement) */
html[data-theme="dark"] .sidebar,
body[data-theme="dark"] .sidebar {
  background: #0a0a0a !important;
  top: 0 !important;
  border-right: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .sidebar::before,
html[data-theme="dark"] .sidebar::after,
body[data-theme="dark"] .sidebar::before,
body[data-theme="dark"] .sidebar::after {
  content: none !important;
  display: none !important;
}

/* Sidebar v-next collapsible layer, scoped away from legacy sidebar behavior. */
.app-shell.sidebar-vnext {
  --sidebar-vnext-expanded-width: 212px;
  --sidebar-vnext-collapsed-width: 72px;
  --sidebar-vnext-main-gap: 30px;
}

.app-shell.sidebar-vnext .sidebar,
.app-shell.sidebar-vnext .main-panel,
.app-shell.sidebar-vnext .brand-copy,
.app-shell.sidebar-vnext .nav-group-label,
.app-shell.sidebar-vnext .nav-item-label,
.app-shell.sidebar-vnext .sidebar-profile-copy,
.app-shell.sidebar-vnext .sidebar-admin-badge,
.app-shell.sidebar-vnext .sidebar-vnext-divider,
.app-shell.sidebar-vnext .sidebar-vnext-divider__line {
  transition:
    width 0.22s ease,
    margin-left 0.22s ease,
    left 0.22s ease,
    opacity 0.16s ease,
    transform 0.18s ease,
    color 0.16s ease,
    background 0.16s ease;
}

.app-shell.sidebar-vnext .sidebar {
  width: var(--sidebar-vnext-expanded-width);
}

.app-shell.sidebar-vnext .sidebar-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.app-shell.sidebar-vnext .brand-copy {
  flex: 1 1 auto;
}

.app-shell.sidebar-vnext .sidebar-footer,
.app-shell.sidebar-vnext .sidebar-profile {
  overflow: visible;
}

.app-shell.sidebar-vnext .sidebar-profile-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  left: auto;
  width: min(280px, calc(100vw - 48px));
  max-width: min(280px, calc(100vw - 48px));
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.985);
  transform-origin: bottom right;
  transition: opacity 140ms ease, transform 140ms ease;
}

.app-shell.sidebar-vnext .sidebar-profile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.app-shell.sidebar-vnext .sidebar-vnext-divider {
  position: fixed;
  top: 14px;
  bottom: 14px;
  left: calc(var(--sidebar-vnext-expanded-width) + (var(--sidebar-vnext-main-gap) / 2) - 6px);
  width: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: ew-resize;
  z-index: 85;
}

.app-shell.sidebar-vnext .sidebar-vnext-divider__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: var(--border-subtle);
}

.app-shell.sidebar-vnext .sidebar-vnext-divider:hover .sidebar-vnext-divider__line {
  background: var(--border-medium);
  width: 2px;
}

.app-shell.sidebar-vnext .sidebar-vnext-divider:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 58%, transparent);
  outline-offset: 2px;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar {
  width: var(--sidebar-vnext-collapsed-width);
  padding-inline: 12px;
  gap: 8px;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-vnext-divider {
  left: calc(var(--sidebar-vnext-collapsed-width) + (var(--sidebar-vnext-main-gap) / 2) - 6px);
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .main-panel {
  margin-left: calc(var(--sidebar-vnext-collapsed-width) + var(--sidebar-vnext-main-gap));
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-topbar {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: center;
  gap: 8px;
  padding-inline: 0;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .brand-copy,
.app-shell.sidebar-vnext.sidebar-vnext-collapsed .nav-group-label,
.app-shell.sidebar-vnext.sidebar-vnext-collapsed .nav-item-label,
.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-profile-copy,
.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-admin-badge,
.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-account-switcher {
  display: none;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .brand-lockup {
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .brand-logo {
  width: 28px;
  height: 28px;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-nav {
  padding-inline: 0;
  padding-right: 0;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .nav-list {
  align-items: stretch;
  gap: 8px;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .nav-group {
  width: 100%;
  display: grid;
  gap: 6px;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  width: 44px;
  min-height: 44px;
  margin-inline: auto;
  padding: 7px 0;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .nav-icon,
.app-shell.sidebar-vnext.sidebar-vnext-collapsed .nav-item svg {
  margin: 0;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-footer {
  align-items: center;
  padding-top: 8px;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-profile {
  display: grid;
  justify-content: center;
  justify-items: center;
  gap: 6px;
  padding-inline: 0;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-profile-main {
  justify-content: center;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-profile-menu-btn {
  width: 28px;
  height: 28px;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-profile-menu {
  left: calc(100% + 12px);
  right: auto;
  bottom: 0;
  transform-origin: left bottom;
}

@media (max-width: 920px) {
  .app-shell.sidebar-vnext .sidebar-vnext-divider {
    display: none;
  }

  .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar {
    display: none;
  }

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .main-panel {
    margin-left: 0;
    padding: 0;
  }
}

/* --------------------------------------------------------------------------
   KMFX Visual Primitives v1
   Additive design-system layer for new pages and controlled migrations.
   Keep specificity intentionally low with :where(); do not replace legacy
   page classes globally until each surface is migrated and verified.
-------------------------------------------------------------------------- */

:root {
  --kmfx-ds-space-1: 4px;
  --kmfx-ds-space-2: 8px;
  --kmfx-ds-space-3: 12px;
  --kmfx-ds-space-4: 16px;
  --kmfx-ds-space-5: 20px;
  --kmfx-ds-space-6: 24px;
  --kmfx-ds-space-7: 32px;
  --kmfx-ds-radius-sm: 10px;
  --kmfx-ds-radius-md: 12px;
  --kmfx-ds-radius-lg: 16px;
  --kmfx-ds-radius-xl: 18px;
  --kmfx-ds-card-bg: var(--layer-1);
  --kmfx-ds-card-bg-subtle: var(--layer-2);
  --kmfx-ds-card-border: var(--border-0);
  --kmfx-ds-card-border-hover: var(--border-1);
  --kmfx-ds-control-bg: rgba(255,255,255,0.035);
  --kmfx-ds-control-bg-hover: rgba(255,255,255,0.06);
  --kmfx-ds-accent-muted: color-mix(in srgb, var(--accent) 58%, var(--text-0) 0%);
  --kmfx-ds-accent-surface: color-mix(in srgb, var(--accent) 14%, transparent);
  --kmfx-ds-danger-muted: color-mix(in srgb, var(--negative) 18%, transparent);
  --kmfx-ds-success-muted: color-mix(in srgb, var(--positive) 15%, transparent);
  --kmfx-ds-warning-muted: color-mix(in srgb, var(--warning) 15%, transparent);
}

:where(.kmfx-ds-stack) {
  display: grid;
  gap: var(--kmfx-ds-space-4);
}

:where(.kmfx-ds-stack--tight) {
  gap: var(--kmfx-ds-space-3);
}

:where(.kmfx-ds-stack--loose) {
  gap: var(--kmfx-ds-space-6);
}

:where(.kmfx-ds-cluster) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kmfx-ds-space-3);
}

:where(.kmfx-ds-section-head) {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--kmfx-ds-space-4);
  min-width: 0;
}

:where(.kmfx-ds-title) {
  margin: 0;
  color: var(--text-0);
  font-size: clamp(18px, 1.35vw, 22px);
  font-weight: 680;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

:where(.kmfx-ds-subtitle) {
  margin: 5px 0 0;
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.45;
}

:where(.kmfx-ds-muted) {
  color: var(--text-2);
}

:where(.kmfx-ds-card) {
  position: relative;
  min-width: 0;
  border: 1px solid var(--kmfx-ds-card-border);
  border-radius: var(--kmfx-ds-radius-lg);
  background: var(--kmfx-ds-card-bg);
  box-shadow: var(--shadow-card);
  color: var(--text-0);
}

:where(.kmfx-ds-card--interactive) {
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    transform 0.16s ease;
}

:where(.kmfx-ds-card--interactive:hover) {
  border-color: var(--kmfx-ds-card-border-hover);
  background: color-mix(in srgb, var(--kmfx-ds-card-bg) 88%, var(--layer-2));
}

:where(.kmfx-ds-card--interactive:active) {
  transform: translateY(1px);
}

:where(.kmfx-ds-card--compact) {
  padding: var(--kmfx-ds-space-4);
  border-radius: var(--kmfx-ds-radius-md);
  background: var(--kmfx-ds-card-bg-subtle);
}

:where(.kmfx-ds-section-card) {
  padding: var(--kmfx-ds-space-5);
}

:where(.kmfx-ds-card--metric) {
  display: grid;
  gap: var(--kmfx-ds-space-2);
  padding: var(--kmfx-ds-space-4);
}

:where(.kmfx-ds-kpi-label) {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:where(.kmfx-ds-kpi-value) {
  color: var(--text-0);
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 720;
  line-height: 1;
  letter-spacing: -0.045em;
}

:where(.kmfx-ds-kpi-meta) {
  color: var(--text-1);
  font-size: 12px;
  line-height: 1.35;
}

:where(.kmfx-ds-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--kmfx-ds-radius-sm);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.12s ease,
    opacity 0.16s ease;
}

:where(.kmfx-ds-btn:disabled, .kmfx-ds-btn[aria-disabled="true"]) {
  cursor: not-allowed;
  opacity: 0.48;
}

:where(.kmfx-ds-btn:not(:disabled):active) {
  transform: translateY(1px);
}

:where(.kmfx-ds-btn:focus-visible) {
  outline: 0;
  box-shadow: var(--focus-ring);
}

:where(.kmfx-ds-btn--primary) {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border-1));
  background: color-mix(in srgb, var(--accent) 62%, var(--layer-3));
  color: var(--text-0);
}

:where(.kmfx-ds-btn--primary:hover) {
  background: color-mix(in srgb, var(--accent) 70%, var(--layer-3));
}

:where(.kmfx-ds-btn--secondary) {
  border-color: var(--border-1);
  background: var(--kmfx-ds-control-bg);
  color: var(--text-0);
}

:where(.kmfx-ds-btn--secondary:hover) {
  border-color: var(--border-2);
  background: var(--kmfx-ds-control-bg-hover);
}

:where(.kmfx-ds-btn--ghost) {
  border-color: transparent;
  background: transparent;
  color: var(--text-1);
}

:where(.kmfx-ds-btn--ghost:hover) {
  background: var(--kmfx-ds-control-bg);
  color: var(--text-0);
}

:where(.kmfx-ds-pill) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--border-0);
  border-radius: var(--control-radius-pill);
  background: var(--layer-2);
  color: var(--text-1);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.01em;
}

:where(.kmfx-ds-pill::before) {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.7;
}

:where(.kmfx-ds-pill--neutral) {
  color: var(--text-1);
}

:where(.kmfx-ds-pill--success) {
  border-color: color-mix(in srgb, var(--positive) 18%, var(--border-0));
  background: var(--kmfx-ds-success-muted);
  color: color-mix(in srgb, var(--positive) 82%, var(--text-0));
}

:where(.kmfx-ds-pill--warning) {
  border-color: color-mix(in srgb, var(--warning) 20%, var(--border-0));
  background: var(--kmfx-ds-warning-muted);
  color: color-mix(in srgb, var(--warning) 82%, var(--text-0));
}

:where(.kmfx-ds-pill--danger) {
  border-color: color-mix(in srgb, var(--negative) 20%, var(--border-0));
  background: var(--kmfx-ds-danger-muted);
  color: color-mix(in srgb, var(--negative) 82%, var(--text-0));
}

:where(.kmfx-ds-pill--accent) {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border-0));
  background: var(--kmfx-ds-accent-surface);
  color: color-mix(in srgb, var(--accent) 78%, var(--text-0));
}

:where(.kmfx-ds-divider) {
  width: 100%;
  height: 1px;
  background: var(--border-0);
}

/* --------------------------------------------------------------------------
   KMFX Page Grammar v1
   Extracted from the strongest existing internal pages:
   - Dashboard: metric strip + asymmetric content blocks
   - Calendar: page header + metric row + primary panel + secondary stack
   - Insights: dense section rhythm + panel headings

   Usage target for new pages and gradual refactors:

   <section class="kmfx-page">
     <header class="kmfx-page__header">
       <div class="kmfx-page__copy">
         <div class="kmfx-page__eyebrow">...</div>
         <h1 class="kmfx-page__title">...</h1>
         <p class="kmfx-page__subtitle">...</p>
       </div>
       <div class="kmfx-page__actions">...</div>
     </header>

     <section class="kmfx-page__metrics">...</section>

     <section class="kmfx-page__main">
       <div class="kmfx-page__primary">...</div>
       <aside class="kmfx-page__secondary">...</aside>
     </section>
   </section>
-------------------------------------------------------------------------- */

:where(.kmfx-page) {
  display: grid;
  gap: 18px;
}

:where(.kmfx-page--compact) {
  gap: 14px;
}

:where(.kmfx-page--spacious) {
  gap: 24px;
}

:where(.kmfx-page__header) {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

:where(.kmfx-page__copy) {
  min-width: 0;
  display: grid;
  gap: 0;
}

:where(.kmfx-page__eyebrow) {
  margin: 0;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

:where(.kmfx-page__title) {
  margin: 6px 0 0;
  color: var(--text-0);
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

:where(.kmfx-page__subtitle) {
  max-width: 640px;
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

:where(.kmfx-page__actions) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

:where(.kmfx-page__metrics) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

:where(.kmfx-page__metrics--dense) {
  gap: 10px;
}

:where(.kmfx-page__metrics--three) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

:where(.kmfx-page__metrics--two) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

:where(.kmfx-page__main) {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: 14px;
  align-items: start;
}

:where(.kmfx-page__main--equal) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

:where(.kmfx-page__main--single) {
  grid-template-columns: minmax(0, 1fr);
}

:where(.kmfx-page__primary),
:where(.kmfx-page__secondary) {
  min-width: 0;
  display: grid;
  gap: 14px;
}

:where(.kmfx-page__secondary--compact) {
  gap: 12px;
}

:where(.kmfx-page__stack) {
  display: grid;
  gap: 14px;
}

:where(.kmfx-page__stack--compact) {
  gap: 10px;
}

:where(.kmfx-page__section) {
  min-width: 0;
}

:where(.kmfx-page__section-head) {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

:where(.kmfx-page__section-copy) {
  min-width: 0;
}

:where(.kmfx-page__section-title) {
  margin: 0;
  color: var(--text-0);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

:where(.kmfx-page__section-subtitle) {
  margin: 5px 0 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.4;
}

:where(.kmfx-page__section-actions) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 980px) {
  :where(.kmfx-page__header),
  :where(.kmfx-page__section-head),
  :where(.kmfx-page__main) {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

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

  :where(.kmfx-page__actions),
  :where(.kmfx-page__section-actions) {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  :where(.kmfx-page) {
    gap: 14px;
  }

  :where(.kmfx-page__metrics),
  :where(.kmfx-page__metrics--three),
  :where(.kmfx-page__metrics--two) {
    grid-template-columns: 1fr;
  }

  :where(.kmfx-page__title) {
    font-size: clamp(24px, 7vw, 30px);
  }
}

/* INICIO BLOQUE: wizard-runtime */
html[data-theme="dark"] .connection-wizard-modal,
body[data-theme="dark"] .connection-wizard-modal {
  max-width: 720px !important;
}

html[data-theme="dark"] .connection-wizard-modal .modal-head,
body[data-theme="dark"] .connection-wizard-modal .modal-head {
  align-items: flex-start !important;
  padding: 28px 32px 24px !important;
}

html[data-theme="dark"] .modal-body.connection-wizard-modal__body,
body[data-theme="dark"] .modal-body.connection-wizard-modal__body {
  padding: 24px 32px 28px !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard {
  display: grid !important;
  gap: 20px !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__steps,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__steps {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  padding-bottom: 4px !important;
  border-bottom: 1px solid var(--border-subtle) !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__step-wrap,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__step-wrap {
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
  flex: 1 1 0 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__step,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__step {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__step.is-current,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__step.is-current {
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__step.is-complete,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__step.is-complete {
  color: var(--text-secondary) !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__step.is-current .connection-wizard__step-marker,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__step.is-current .connection-wizard__step-marker {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__step.is-complete .connection-wizard__step-marker,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__step.is-complete .connection-wizard__step-marker {
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__step-separator,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__step-separator {
  height: 1px !important;
  flex: 1 1 auto !important;
  margin: 0 14px !important;
  background: var(--border-medium) !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__step-marker,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__step-marker {
  width: 22px !important;
  height: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  background: var(--layer-2) !important;
  border: 1px solid var(--border-subtle) !important;
  color: currentColor !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  flex-shrink: 0 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__step-label,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__step-label {
  white-space: nowrap !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__section,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__section {
  display: grid !important;
  gap: 16px !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__section-head,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__section-head {
  display: grid !important;
  gap: 4px !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__title,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__title {
  margin: 0 !important;
  color: var(--text-primary) !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  letter-spacing: -0.4px !important;
  line-height: 1.1 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__subtitle,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__subtitle {
  margin: 0 !important;
  max-width: 42ch !important;
  color: var(--text-secondary) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__card,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__card {
  display: grid !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  gap: 16px !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-grid,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-grid {
  display: grid !important;
  gap: 12px !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-grid--stacked,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-grid--stacked {
  grid-template-columns: 1fr !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-grid--methods,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-grid--methods {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option {
  position: relative !important;
  display: grid !important;
  align-content: center !important;
  justify-items: center !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 12px !important;
  outline: 1px solid transparent !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  gap: 0 !important;
  min-height: 72px !important;
  padding: 20px !important;
  transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), outline-color 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-align: center !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option:hover:not(:disabled),
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: var(--border-medium) !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option.is-selected,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option.is-selected {
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: var(--accent) !important;
  outline-color: color-mix(in srgb, var(--accent) 18%, transparent) !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-check,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-check {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  width: 22px !important;
  height: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  border-radius: 999px !important;
  background: var(--accent) !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  opacity: 0 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-copy,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-copy {
  display: grid !important;
  gap: 6px !important;
  min-width: 0 !important;
  justify-items: center !important;
  max-width: 30ch !important;
  margin: 0 auto !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option.is-selected .connection-wizard__option-check,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option.is-selected .connection-wizard__option-check {
  opacity: 1 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option--muted,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option--muted {
  opacity: 0.62 !important;
  cursor: not-allowed !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-title,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-title {
  color: var(--text-primary) !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  letter-spacing: -0.3px !important;
  line-height: 1.2 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-subtitle,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-subtitle {
  color: var(--text-secondary) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-note,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-note {
  color: var(--text-secondary) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  margin: 0 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__form-grid,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__form-grid {
  display: grid !important;
  gap: 12px !important;
}

html[data-theme="dark"] .connection-wizard-modal .form-stack,
body[data-theme="dark"] .connection-wizard-modal .form-stack {
  display: grid !important;
  gap: 6px !important;
}

html[data-theme="dark"] .connection-wizard-modal .form-stack > span,
body[data-theme="dark"] .connection-wizard-modal .form-stack > span {
  color: var(--text-secondary) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__warning,
html[data-theme="dark"] .connection-wizard-modal .connection-wizard__inline-error,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__warning,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__inline-error {
  margin: 0 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__warning,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__warning {
  color: var(--text-muted) !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  padding-top: 2px !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__utility-row,
html[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-row,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__utility-row,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-row {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 12px !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: start !important;
  padding: 16px !important;
  gap: 12px !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__utility-actions,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__utility-actions {
  display: flex !important;
  justify-content: flex-start !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-copy,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-copy {
  display: grid !important;
  gap: 8px !important;
  min-width: 0 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__inline-actions,
html[data-theme="dark"] .connection-wizard-modal .connection-wizard__utility-actions,
html[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-actions,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__inline-actions,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__utility-actions,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__checklist,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__checklist {
  display: grid !important;
  gap: 10px !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__checklist-item,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__checklist-item {
  color: var(--text-secondary) !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__checklist-item::before,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__checklist-item::before {
  display: none !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__utility-label,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__utility-label {
  color: var(--text-muted) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__utility-value,
html[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-value,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__utility-value,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-value {
  color: var(--text-primary) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__success-title,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__success-title {
  color: var(--text-primary) !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  letter-spacing: -0.3px !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__success-subtitle,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__success-subtitle {
  color: var(--text-secondary) !important;
  font-size: 13px !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__success,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__success {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  margin-bottom: 4px !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__success-icon,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__success-icon {
  width: 32px !important;
  height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--positive) 14%, transparent) !important;
  color: var(--positive) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  flex-shrink: 0 !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__success-copy,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__success-copy {
  display: grid !important;
  gap: 4px !important;
}

html[data-theme="dark"] .connection-wizard-modal input:not([type="checkbox"]):not([type="radio"]),
body[data-theme="dark"] .connection-wizard-modal input:not([type="checkbox"]):not([type="radio"]) {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid var(--border-medium) !important;
  box-shadow: none !important;
  border-radius: 10px !important;
}

html[data-theme="dark"] .connection-wizard-modal input:not([type="checkbox"]):not([type="radio"]):focus,
body[data-theme="dark"] .connection-wizard-modal input:not([type="checkbox"]):not([type="radio"]):focus {
  border-color: var(--border-medium) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .connection-wizard-modal .btn-primary,
html[data-theme="dark"] .connection-wizard-modal .btn-secondary,
html[data-theme="dark"] .connection-wizard-modal .btn-ghost,
body[data-theme="dark"] .connection-wizard-modal .btn-primary,
body[data-theme="dark"] .connection-wizard-modal .btn-secondary,
body[data-theme="dark"] .connection-wizard-modal .btn-ghost {
  min-height: 44px !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  letter-spacing: -0.2px !important;
}

html[data-theme="dark"] .connection-wizard-modal .btn-primary,
body[data-theme="dark"] .connection-wizard-modal .btn-primary {
  background: var(--accent) !important;
  border: none !important;
  color: #fff !important;
}

html[data-theme="dark"] .connection-wizard-modal .btn-secondary,
body[data-theme="dark"] .connection-wizard-modal .btn-secondary {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .connection-wizard-modal .btn-ghost,
body[data-theme="dark"] .connection-wizard-modal .btn-ghost {
  background: transparent !important;
  border: 1px solid var(--border-medium) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .connection-wizard-modal .btn-secondary:hover:not(:disabled),
body[data-theme="dark"] .connection-wizard-modal .btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--border-medium) !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .connection-wizard-modal .btn-ghost:hover:not(:disabled),
body[data-theme="dark"] .connection-wizard-modal .btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: var(--border-medium) !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .connection-wizard-modal .connection-wizard__actions,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__actions {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  margin: 8px -24px -24px !important;
  padding: 20px 24px 24px !important;
  border-top: 1px solid var(--border-subtle) !important;
}

@media (max-width: 980px) {
  html[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-grid--methods,
  html[data-theme="dark"] .connection-wizard-modal .connection-wizard__form-grid,
  body[data-theme="dark"] .connection-wizard-modal .connection-wizard__option-grid--methods,
  body[data-theme="dark"] .connection-wizard-modal .connection-wizard__form-grid {
    grid-template-columns: 1fr !important;
  }

  html[data-theme="dark"] .connection-wizard-modal .connection-wizard__utility-row,
  html[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-row,
  body[data-theme="dark"] .connection-wizard-modal .connection-wizard__utility-row,
  body[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-row {
    grid-template-columns: 1fr !important;
  }

  html[data-theme="dark"] .connection-wizard-modal .connection-wizard__inline-actions,
  html[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-actions,
  html[data-theme="dark"] .connection-wizard-modal .connection-wizard__actions,
  body[data-theme="dark"] .connection-wizard-modal .connection-wizard__inline-actions,
  body[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-actions,
  body[data-theme="dark"] .connection-wizard-modal .connection-wizard__actions {
    justify-content: stretch !important;
  }

  html[data-theme="dark"] .connection-wizard-modal .connection-wizard__steps,
  body[data-theme="dark"] .connection-wizard-modal .connection-wizard__steps {
    overflow-x: auto !important;
    padding-bottom: 8px !important;
  }

  html[data-theme="dark"] .connection-wizard-modal .connection-wizard__inline-actions > *,
  html[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-actions > *,
  html[data-theme="dark"] .connection-wizard-modal .connection-wizard__actions > *,
  body[data-theme="dark"] .connection-wizard-modal .connection-wizard__inline-actions > *,
  body[data-theme="dark"] .connection-wizard-modal .connection-wizard__secret-actions > *,
  body[data-theme="dark"] .connection-wizard-modal .connection-wizard__actions > * {
    flex: 1 1 100% !important;
  }
}
/* FIN BLOQUE: wizard-runtime */

/* INICIO BLOQUE: dashboard-runtime */
html[data-theme="dark"] .dashboard-screen,
body[data-theme="dark"] .dashboard-screen {
  --dashboard-space-sm: 16px;
  --dashboard-space-md: 24px;
  --dashboard-space-lg: 32px;
  display: grid;
  gap: var(--dashboard-space-lg);
}

html[data-theme="dark"] .dashboard-screen__header,
body[data-theme="dark"] .dashboard-screen__header {
  align-items: flex-start;
}

html[data-theme="dark"] .dashboard-screen__actions,
body[data-theme="dark"] .dashboard-screen__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

html[data-theme="dark"] .dashboard-screen__actions .btn-inline,
body[data-theme="dark"] .dashboard-screen__actions .btn-inline {
  min-height: 40px;
  padding-inline: 16px;
  font-size: 14px;
}

html[data-theme="dark"] .dashboard-screen__actions .dashboard-screen__add-account,
body[data-theme="dark"] .dashboard-screen__actions .dashboard-screen__add-account {
  min-height: 38px;
  padding-inline: 14px;
  font-size: 13px;
}

html[data-theme="dark"] .dashboard-summary-kpis,
body[data-theme="dark"] .dashboard-summary-kpis {
  margin-bottom: 0;
}

html[data-theme="dark"] .dashboard-summary-kpis .widget-card--kpi,
body[data-theme="dark"] .dashboard-summary-kpis .widget-card--kpi {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 122px;
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}

html[data-theme="dark"] .dashboard-summary-kpis .tl-kpi-label,
body[data-theme="dark"] .dashboard-summary-kpis .tl-kpi-label {
  font-size: 14px !important;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-2);
  text-transform: none !important;
}

html[data-theme="dark"] .dashboard-summary-kpis .tl-kpi-val,
body[data-theme="dark"] .dashboard-summary-kpis .tl-kpi-val {
  margin-top: 8px;
  font-size: 34px;
  line-height: 0.96;
  letter-spacing: -0.045em;
}

html[data-theme="dark"] .dashboard-summary-kpis .widget-card--kpi:first-child .tl-kpi-val,
body[data-theme="dark"] .dashboard-summary-kpis .widget-card--kpi:first-child .tl-kpi-val {
  font-size: 30px;
  line-height: 1;
  color: var(--text-0);
}

html[data-theme="dark"] .dashboard-summary-kpis .widget-card-meta,
body[data-theme="dark"] .dashboard-summary-kpis .widget-card-meta {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.32;
  color: var(--text-1);
}

html[data-theme="dark"] .dashboard-summary-kpis .dashboard-kpi-support .widget-card-meta,
body[data-theme="dark"] .dashboard-summary-kpis .dashboard-kpi-support .widget-card-meta {
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-summary-kpis .metric-positive-soft,
body[data-theme="dark"] .dashboard-summary-kpis .metric-positive-soft {
  color: var(--text-0) !important;
}

html[data-theme="dark"] .dashboard-summary-kpis .metric-negative-soft,
body[data-theme="dark"] .dashboard-summary-kpis .metric-negative-soft {
  color: var(--text-0) !important;
}

html[data-theme="dark"] .dashboard-summary-kpis .dashboard-kpi-muted-value,
body[data-theme="dark"] .dashboard-summary-kpis .dashboard-kpi-muted-value {
  color: var(--text-1) !important;
}

html[data-theme="dark"] .dashboard-summary-kpis .metric-warning,
body[data-theme="dark"] .dashboard-summary-kpis .metric-warning {
  color: color-mix(in srgb, var(--warning) 82%, var(--text-0)) !important;
}

html[data-theme="dark"] .dashboard-summary-kpis .widget-card--kpi:first-child .widget-card-meta,
body[data-theme="dark"] .dashboard-summary-kpis .widget-card--kpi:first-child .widget-card-meta {
  display: block;
  margin-top: 10px;
  line-height: 1.4;
}

html[data-theme="dark"] .dashboard-layout,
body[data-theme="dark"] .dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--dashboard-space-lg);
  align-items: start;
}

html[data-theme="dark"] .dashboard-secondary-stack,
body[data-theme="dark"] .dashboard-secondary-stack,
html[data-theme="dark"] .dashboard-section-stack,
body[data-theme="dark"] .dashboard-section-stack {
  display: grid;
  gap: var(--dashboard-space-lg);
}

html[data-theme="dark"] .dashboard-secondary-stack,
body[data-theme="dark"] .dashboard-secondary-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--dashboard-space-md);
}

html[data-theme="dark"] .dashboard-primary-card,
html[data-theme="dark"] .dashboard-secondary-card,
html[data-theme="dark"] .dashboard-section-card,
body[data-theme="dark"] .dashboard-primary-card,
body[data-theme="dark"] .dashboard-secondary-card,
body[data-theme="dark"] .dashboard-section-card {
  padding: 24px !important;
  background: var(--layer-1) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .dashboard-primary-card,
body[data-theme="dark"] .dashboard-primary-card {
  padding: 24px !important;
  min-height: 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

html[data-theme="dark"] .dashboard-primary-card::before,
body[data-theme="dark"] .dashboard-primary-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.4;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.10) 0%,
      rgba(255, 255, 255, 0.04) 22%,
      rgba(255, 255, 255, 0.00) 48%
    );
}

html[data-theme="dark"] .dashboard-primary-card__head,
body[data-theme="dark"] .dashboard-primary-card__head {
  padding-top: 0;
  margin-bottom: var(--dashboard-space-sm);
  align-items: flex-start;
}

html[data-theme="dark"] .dashboard-primary-card .calendar-panel-title,
body[data-theme="dark"] .dashboard-primary-card .calendar-panel-title {
  font-size: 20px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.04em;
}

html[data-theme="dark"] .dashboard-primary-card .calendar-panel-sub,
body[data-theme="dark"] .dashboard-primary-card .calendar-panel-sub {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-primary-card__body,
body[data-theme="dark"] .dashboard-primary-card__body {
  display: block;
  min-width: 0;
}

html[data-theme="dark"] .dashboard-primary-card__summary,
body[data-theme="dark"] .dashboard-primary-card__summary {
  display: none;
}

html[data-theme="dark"] .dashboard-primary-card__metric,
body[data-theme="dark"] .dashboard-primary-card__metric {
  font-size: clamp(48px, 5vw, 60px);
  line-height: 0.88;
  letter-spacing: -0.06em;
  font-weight: 700;
  color: var(--text-0);
}

html[data-theme="dark"] .dashboard-primary-card__lines,
body[data-theme="dark"] .dashboard-primary-card__lines {
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] .dashboard-primary-card__line,
body[data-theme="dark"] .dashboard-primary-card__line {
  display: grid;
  gap: 6px;
}

html[data-theme="dark"] .dashboard-primary-card__line span,
body[data-theme="dark"] .dashboard-primary-card__line span {
  font-size: 12px;
  line-height: 1.2;
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-primary-card__line strong,
body[data-theme="dark"] .dashboard-primary-card__line strong {
  font-size: 16px;
  line-height: 1.12;
  font-weight: 600;
  color: var(--text-0);
}

html[data-theme="dark"] .dashboard-primary-card__line .metric-positive,
body[data-theme="dark"] .dashboard-primary-card__line .metric-positive,
html[data-theme="dark"] .dashboard-summary-kpis .metric-positive,
body[data-theme="dark"] .dashboard-summary-kpis .metric-positive {
  color: var(--positive) !important;
}

html[data-theme="dark"] .dashboard-primary-card__line .metric-negative,
body[data-theme="dark"] .dashboard-primary-card__line .metric-negative,
html[data-theme="dark"] .dashboard-summary-kpis .metric-negative,
body[data-theme="dark"] .dashboard-summary-kpis .metric-negative {
  color: var(--negative) !important;
}

html[data-theme="dark"] .dashboard-primary-card__chart,
body[data-theme="dark"] .dashboard-primary-card__chart {
  min-width: 0;
  opacity: 1;
  margin: 0 -2px -2px;
}

html[data-theme="dark"] .dashboard-primary-card__chart .kmfx-chart-shell--hero,
html[data-theme="dark"] .dashboard-primary-card__chart canvas,
body[data-theme="dark"] .dashboard-primary-card__chart .kmfx-chart-shell--hero,
body[data-theme="dark"] .dashboard-primary-card__chart canvas {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .dashboard-primary-card__chart .kmfx-chart-shell--hero,
body[data-theme="dark"] .dashboard-primary-card__chart .kmfx-chart-shell--hero {
  min-height: 288px !important;
  padding: 0 !important;
  border-radius: 0;
  background: transparent !important;
}

html[data-theme="dark"] .dashboard-primary-card .widget-segmented,
body[data-theme="dark"] .dashboard-primary-card .widget-segmented {
  margin-top: 0;
  flex-shrink: 0;
}

html[data-theme="dark"] .dashboard-primary-card .widget-segmented-btn,
body[data-theme="dark"] .dashboard-primary-card .widget-segmented-btn,
html[data-theme="dark"] .dashboard-primary-card .widget-segmented-btn.active,
body[data-theme="dark"] .dashboard-primary-card .widget-segmented-btn.active {
  border-radius: 999px !important;
}

/* --------------------------------------------------------------------------
   Dashboard — Equity Chart Card
-------------------------------------------------------------------------- */

.dashboard-chart-card {
  color: var(--card-foreground);
}

.dashboard-chart-card__header {
  align-items: flex-start;
  padding: 0 0 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
}

.dashboard-chart-card__copy {
  min-width: 0;
}

.dashboard-chart-card__title {
  font-size: 18px;
  line-height: 1.12;
  font-weight: 740;
  letter-spacing: -0.035em;
}

.dashboard-chart-card__description {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-chart-card__content {
  min-height: 288px;
  padding: 14px 0 0;
}

.dashboard-chart-card__chart {
  margin: 0 -2px -2px;
}

.dashboard-chart-range {
  flex-shrink: 0;
}

.dashboard-chart-range__button {
  min-width: 38px;
}

@media (max-width: 720px) {
  .dashboard-chart-card__header {
    flex-direction: column;
    gap: 12px;
  }

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

html[data-theme="dark"] .dashboard-secondary-card,
body[data-theme="dark"] .dashboard-secondary-card {
  padding: var(--dashboard-space-sm) !important;
}

.dashboard-state-grid {
  align-items: stretch;
}

.dashboard-state-card {
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  gap: 14px;
}

.dashboard-state-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-state-card__title {
  margin: 0;
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.dashboard-state-card__description {
  margin: 4px 0 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-state-card__metrics {
  flex: 1;
}

.dashboard-state-metric {
  min-width: 0;
  min-height: 92px;
  padding: 12px;
  color: var(--foreground);
  background: color-mix(in srgb, var(--foreground) 2%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: var(--radius-md);
}

.dashboard-state-metric__label {
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.1;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-state-metric__value {
  margin-top: 7px;
  color: var(--foreground);
  font-size: 17px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.dashboard-state-metric__meta {
  margin-top: 5px;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.32;
}

.dashboard-state-metric[data-tone="ok"] .dashboard-state-metric__value {
  color: var(--profit);
}

.dashboard-state-metric[data-tone="warning"] .dashboard-state-metric__value {
  color: var(--risk);
}

.dashboard-state-metric[data-tone="breach"] .dashboard-state-metric__value,
.dashboard-state-metric[data-tone="blocked"] .dashboard-state-metric__value {
  color: var(--loss);
}

.dashboard-state-card__foot {
  margin-top: auto;
}

/* --------------------------------------------------------------------------
   Dashboard — Enforcement Card
-------------------------------------------------------------------------- */

.dashboard-enforcement__card {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.dashboard-enforcement__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
}

.dashboard-enforcement__eyebrow,
.dashboard-enforcement__title,
.dashboard-enforcement__description,
.dashboard-enforcement-row__description {
  margin: 0;
}

.dashboard-enforcement__eyebrow {
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dashboard-enforcement__title {
  margin-top: 7px;
  color: var(--foreground);
  font-size: 17px;
  line-height: 1.15;
  font-weight: 740;
  letter-spacing: -0.025em;
}

.dashboard-enforcement__description {
  margin-top: 6px;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.4;
}

.dashboard-enforcement__badge {
  flex-shrink: 0;
}

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

.dashboard-enforcement-row {
  display: flex;
  min-width: 0;
  min-height: 78px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--foreground) 2%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: var(--radius-md);
}

.dashboard-enforcement-row__label {
  display: block;
  color: var(--foreground);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.dashboard-enforcement-row__description {
  margin-top: 5px;
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.35;
}

.dashboard-enforcement-status {
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .dashboard-enforcement__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dashboard-enforcement__header,
  .dashboard-enforcement-row {
    flex-direction: column;
  }

  .dashboard-enforcement__grid {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] .dashboard-secondary-card__head,
body[data-theme="dark"] .dashboard-secondary-card__head {
  margin-bottom: var(--dashboard-space-sm);
  align-items: flex-start;
}

html[data-theme="dark"] .dashboard-secondary-card .calendar-panel-sub,
body[data-theme="dark"] .dashboard-secondary-card .calendar-panel-sub {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-secondary-card__metrics,
body[data-theme="dark"] .dashboard-secondary-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--dashboard-space-sm);
}

html[data-theme="dark"] .dashboard-secondary-card__metrics--two,
body[data-theme="dark"] .dashboard-secondary-card__metrics--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[data-theme="dark"] .dashboard-secondary-card__foot,
body[data-theme="dark"] .dashboard-secondary-card__foot {
  margin-top: var(--dashboard-space-sm);
  padding-top: var(--dashboard-space-sm);
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-screen .risk-metric-card,
body[data-theme="dark"] .dashboard-screen .risk-metric-card {
  padding: 12px !important;
  border-radius: 14px;
  border: 1px solid var(--border-subtle) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  box-shadow: none !important;
  min-height: 104px;
  display: grid;
  align-content: start;
}

html[data-theme="dark"] .dashboard-screen .risk-metric-card__label,
body[data-theme="dark"] .dashboard-screen .risk-metric-card__label {
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-screen .risk-metric-card__value,
body[data-theme="dark"] .dashboard-screen .risk-metric-card__value {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.08;
  font-weight: 650;
}

html[data-theme="dark"] .dashboard-screen .risk-metric-card__meta,
body[data-theme="dark"] .dashboard-screen .risk-metric-card__meta {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-2);
}

html[data-theme="dark"] .dashboard-screen .risk-metric-card--ok .risk-metric-card__value,
body[data-theme="dark"] .dashboard-screen .risk-metric-card--ok .risk-metric-card__value {
  color: var(--positive);
}

html[data-theme="dark"] .dashboard-screen .risk-metric-card--warning .risk-metric-card__value,
body[data-theme="dark"] .dashboard-screen .risk-metric-card--warning .risk-metric-card__value {
  color: var(--warning, #d6a24a);
}

html[data-theme="dark"] .dashboard-screen .risk-metric-card--breach .risk-metric-card__value,
html[data-theme="dark"] .dashboard-screen .risk-metric-card--blocked .risk-metric-card__value,
body[data-theme="dark"] .dashboard-screen .risk-metric-card--breach .risk-metric-card__value,
body[data-theme="dark"] .dashboard-screen .risk-metric-card--blocked .risk-metric-card__value {
  color: var(--negative);
}

html[data-theme="dark"] .app-disclaimer-footer,
body[data-theme="dark"] .app-disclaimer-footer {
  margin-top: auto;
  padding-top: 0;
}

html[data-theme="dark"] .dashboard-screen .risk-enforcement-panel,
body[data-theme="dark"] .dashboard-screen .risk-enforcement-panel {
  gap: var(--dashboard-space-sm);
}

html[data-theme="dark"] .dashboard-screen .risk-enforcement-panel__item,
body[data-theme="dark"] .dashboard-screen .risk-enforcement-panel__item {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .dashboard-screen .risk-exposure-table__head,
body[data-theme="dark"] .dashboard-screen .risk-exposure-table__head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

html[data-theme="dark"] .dashboard-screen .risk-exposure-table__row,
body[data-theme="dark"] .dashboard-screen .risk-exposure-table__row {
  min-height: 48px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 1100px) {
  html[data-theme="dark"] .dashboard-secondary-stack,
  body[data-theme="dark"] .dashboard-secondary-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html[data-theme="dark"] .dashboard-screen__header,
  body[data-theme="dark"] .dashboard-screen__header {
    flex-direction: column;
    align-items: stretch;
  }

  html[data-theme="dark"] .dashboard-primary-card__body,
  body[data-theme="dark"] .dashboard-primary-card__body,
  html[data-theme="dark"] .dashboard-secondary-card__metrics,
  body[data-theme="dark"] .dashboard-secondary-card__metrics,
  html[data-theme="dark"] .dashboard-secondary-card__metrics--two,
  body[data-theme="dark"] .dashboard-secondary-card__metrics--two {
    grid-template-columns: 1fr;
  }
}
/* FIN BLOQUE: dashboard-runtime */

/* INICIO BLOQUE: trades-runtime */
html[data-theme="dark"] .trades-screen,
body[data-theme="dark"] .trades-screen {
  --trades-space-sm: 16px;
  --trades-space-md: 24px;
  --trades-space-lg: 32px;
  display: grid;
  gap: var(--trades-space-lg);
}

html[data-theme="dark"] .trades-screen .tl-kpi-row,
html[data-theme="dark"] .trades-screen .tl-kpi-row.five,
body[data-theme="dark"] .trades-screen .tl-kpi-row,
body[data-theme="dark"] .trades-screen .tl-kpi-row.five {
  gap: var(--trades-space-sm);
  margin-bottom: 0;
}

html[data-theme="dark"] .trades-screen .grid-2,
html[data-theme="dark"] .trades-screen .grid-2.equal,
body[data-theme="dark"] .trades-screen .grid-2,
body[data-theme="dark"] .trades-screen .grid-2.equal {
  gap: var(--trades-space-md);
  margin-bottom: 0;
}

html[data-theme="dark"] .trades-screen .calendar-screen__header,
body[data-theme="dark"] .trades-screen .calendar-screen__header {
  align-items: flex-start;
}

html[data-theme="dark"] .trades-screen .calendar-screen__copy,
body[data-theme="dark"] .trades-screen .calendar-screen__copy {
  max-width: 70ch;
}

html[data-theme="dark"] .trades-screen .calendar-screen__title,
html[data-theme="dark"] .trades-screen .calendar-screen__title::before,
html[data-theme="dark"] .trades-screen .calendar-screen__title::after,
body[data-theme="dark"] .trades-screen .calendar-screen__title,
body[data-theme="dark"] .trades-screen .calendar-screen__title::before,
body[data-theme="dark"] .trades-screen .calendar-screen__title::after {
  margin: 6px 0 0;
}

html[data-theme="dark"] .trades-screen .calendar-screen__title::before,
html[data-theme="dark"] .trades-screen .calendar-screen__title::after,
body[data-theme="dark"] .trades-screen .calendar-screen__title::before,
body[data-theme="dark"] .trades-screen .calendar-screen__title::after {
  display: none !important;
  content: none !important;
}

html[data-theme="dark"] .trades-screen .calendar-screen__subtitle,
body[data-theme="dark"] .trades-screen .calendar-screen__subtitle {
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Operaciones — Trade Truth Summary
-------------------------------------------------------------------------- */
html[data-theme="dark"] .trades-screen .trades-truth,
body[data-theme="dark"] .trades-screen .trades-truth {
  padding: 20px;
  background: var(--card);
  border-color: var(--border);
  border-radius: var(--radius-lg);
}

html[data-theme="dark"] .trades-screen .trades-truth__header,
body[data-theme="dark"] .trades-screen .trades-truth__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-0);
}

html[data-theme="dark"] .trades-screen .trades-truth__eyebrow,
body[data-theme="dark"] .trades-screen .trades-truth__eyebrow,
html[data-theme="dark"] .trades-screen .trades-truth__label,
body[data-theme="dark"] .trades-screen .trades-truth__label {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.1;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

html[data-theme="dark"] .trades-screen .trades-truth__title,
body[data-theme="dark"] .trades-screen .trades-truth__title {
  margin: 6px 0 0;
  color: var(--card-foreground);
  font-size: 18px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.025em;
}

html[data-theme="dark"] .trades-screen .trades-truth__badge,
body[data-theme="dark"] .trades-screen .trades-truth__badge {
  flex: 0 0 auto;
  margin-top: 2px;
}

html[data-theme="dark"] .trades-screen .trades-truth__grid,
body[data-theme="dark"] .trades-screen .trades-truth__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.05fr) minmax(0, 1.35fr) minmax(0, 1.05fr);
  gap: 12px;
  padding-top: 16px;
}

html[data-theme="dark"] .trades-screen .trades-truth__block,
body[data-theme="dark"] .trades-screen .trades-truth__block {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-0);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--muted) 56%, transparent);
}

html[data-theme="dark"] .trades-screen .trades-truth__block--state,
body[data-theme="dark"] .trades-screen .trades-truth__block--state {
  background: color-mix(in srgb, var(--primary) 5%, var(--muted) 52%);
}

html[data-theme="dark"] .trades-screen .trades-truth__block--action,
body[data-theme="dark"] .trades-screen .trades-truth__block--action {
  border-color: color-mix(in srgb, var(--risk) 18%, var(--border) 82%);
  background: color-mix(in srgb, var(--risk-muted) 38%, transparent);
}

html[data-theme="dark"] .trades-screen .trades-truth__block strong,
body[data-theme="dark"] .trades-screen .trades-truth__block strong {
  display: block;
  margin-top: 8px;
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.01em;
}

html[data-theme="dark"] .trades-screen .trades-truth__block p,
body[data-theme="dark"] .trades-screen .trades-truth__block p {
  margin: 6px 0 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.45;
}

html[data-theme="dark"] .trades-screen .trades-truth__metrics,
body[data-theme="dark"] .trades-screen .trades-truth__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

html[data-theme="dark"] .trades-screen .trades-truth__metric,
body[data-theme="dark"] .trades-screen .trades-truth__metric {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--border-0);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .trades-screen .trades-truth__metric span,
body[data-theme="dark"] .trades-screen .trades-truth__metric span {
  display: block;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.1;
}

html[data-theme="dark"] .trades-screen .trades-truth__metric strong,
body[data-theme="dark"] .trades-screen .trades-truth__metric strong {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Operaciones — Compact Truth Layer
-------------------------------------------------------------------------- */
.trades-screen .trades-truth-compact {
  color: var(--card-foreground);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 2.5%, transparent), transparent 62%),
    var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.trades-screen .trades-truth-compact__header {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(220px, 0.78fr) minmax(280px, 1fr);
  align-items: baseline;
  gap: 18px;
  padding: 15px 18px 13px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.trades-screen .trades-truth-compact__eyebrow,
.trades-screen .trades-truth-compact__title,
.trades-screen .trades-truth-compact__description,
.trades-screen .trades-truth-compact__cell p,
.trades-screen .trades-truth-compact__evidence {
  margin: 0;
}

.trades-screen .trades-truth-compact__eyebrow,
.trades-screen .trades-truth-compact__label {
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.trades-screen .trades-truth-compact__title {
  color: var(--foreground);
  font-size: 17px;
  line-height: 1.18;
  font-weight: 740;
  letter-spacing: -0.025em;
}

.trades-screen .trades-truth-compact__description,
.trades-screen .trades-truth-compact__cell p {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.4;
}

.trades-screen .trades-truth-compact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(280px, 1.24fr) 1fr;
}

.trades-screen .trades-truth-compact__cell {
  min-width: 0;
  padding: 14px 16px 15px;
  border-right: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
}

.trades-screen .trades-truth-compact__cell:last-child {
  border-right: 0;
}

.trades-screen .trades-truth-compact__cell-title {
  display: block;
  margin: 8px 0 5px;
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 740;
  letter-spacing: -0.015em;
}

.trades-screen .trades-truth-compact__cell[data-tone="success"] .trades-truth-compact__cell-title {
  color: var(--profit);
}

.trades-screen .trades-truth-compact__cell[data-tone="info"] .trades-truth-compact__cell-title {
  color: var(--equity);
}

.trades-screen .trades-truth-compact__cell[data-tone="warning"] .trades-truth-compact__cell-title {
  color: var(--risk);
}

.trades-screen .trades-truth-compact__cell[data-tone="danger"] .trades-truth-compact__cell-title {
  color: var(--loss);
}

.trades-screen .trades-truth-compact__evidence {
  display: grid;
  margin-top: 8px;
}

.trades-screen .trades-truth-compact__evidence-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 4px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 46%, transparent);
}

.trades-screen .trades-truth-compact__evidence-row:last-child {
  border-bottom: 0;
}

.trades-screen .trades-truth-compact__evidence dt,
.trades-screen .trades-truth-compact__evidence dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
}

.trades-screen .trades-truth-compact__evidence dt {
  color: var(--muted-foreground);
}

.trades-screen .trades-truth-compact__evidence dd {
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.trades-screen .trades-truth-compact__evidence dd .kmfx-ui-pnl {
  justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   Operaciones — KPI Row
-------------------------------------------------------------------------- */
.trades-screen .trades-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.trades-screen .trades-kpi-card {
  justify-content: center;
  min-height: 102px;
  padding: 13px 15px;
  gap: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 1.5%, transparent), transparent 62%),
    var(--card);
  box-shadow: none;
}

.trades-screen .trades-kpi-card .kmfx-ui-kpi__body {
  gap: 7px;
}

.trades-screen .trades-kpi-card .kmfx-ui-kpi__label {
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: 0.105em;
}

.trades-screen .trades-kpi-card .kmfx-ui-kpi__value {
  color: var(--foreground);
  font-size: clamp(22px, 1.75vw, 27px);
  line-height: 1.04;
  font-weight: 720;
  letter-spacing: -0.035em;
}

.trades-screen .trades-kpi-card[data-tone="profit"] {
  border-color: color-mix(in srgb, var(--profit) 11%, var(--border));
}

.trades-screen .trades-kpi-card[data-tone="profit"] .kmfx-ui-kpi__value,
.trades-screen .trades-kpi-card[data-tone="profit"] .kmfx-ui-pnl {
  color: var(--profit);
}

.trades-screen .trades-kpi-card[data-tone="loss"] {
  border-color: color-mix(in srgb, var(--loss) 11%, var(--border));
}

.trades-screen .trades-kpi-card[data-tone="loss"] .kmfx-ui-kpi__value,
.trades-screen .trades-kpi-card[data-tone="loss"] .kmfx-ui-pnl {
  color: var(--loss);
}

.trades-screen .trades-kpi-card[data-tone="info"] {
  border-color: color-mix(in srgb, var(--equity) 10%, var(--border));
}

.trades-screen .trades-kpi-card[data-tone="info"] .kmfx-ui-kpi__value {
  color: var(--foreground);
}

.trades-screen .trades-kpi-card .kmfx-ui-pnl {
  display: inline-flex;
  font: inherit;
  letter-spacing: inherit;
}

/* --------------------------------------------------------------------------
   Operaciones — Overview Cards
-------------------------------------------------------------------------- */
.trades-screen .trades-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.trades-screen .trades-overview-card {
  min-width: 0;
  color: var(--card-foreground);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 1.8%, transparent), transparent 64%),
    var(--layer-2);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.trades-screen .trades-overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid color-mix(in srgb, var(--border-0) 64%, transparent);
}

.trades-screen .trades-overview-title,
.trades-screen .trades-overview-subtitle {
  margin: 0;
}

.trades-screen .trades-overview-title {
  color: var(--foreground);
  font-size: var(--space-4);
  line-height: 1.2;
  font-weight: 740;
  letter-spacing: -0.025em;
}

.trades-screen .trades-overview-subtitle {
  margin-top: calc(var(--space-2) - 3px);
  color: var(--muted-foreground);
  font-size: var(--space-3);
  line-height: 1.35;
}

.trades-screen .trades-overview-card__body,
.trades-screen .trades-symbols-list {
  display: grid;
  padding: 0 var(--space-4) var(--space-2);
}

.trades-screen .trades-overview-row,
.trades-screen .trades-symbol-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--row-padding-y) 0;
  border-top: 1px solid color-mix(in srgb, var(--border-0) 48%, transparent);
}

.trades-screen .trades-overview-row:first-child,
.trades-screen .trades-symbol-row:first-child {
  border-top: 0;
}

.trades-screen .trades-overview-row > div {
  min-width: 0;
}

.trades-screen .trades-overview-row__label,
.trades-screen .trades-overview-row__meta,
.trades-screen .trades-symbol-meta {
  font-size: var(--kmfx-label-size);
  line-height: 1.25;
}

.trades-screen .trades-overview-row__label {
  display: block;
  margin-bottom: calc(var(--space-2) - 3px);
  color: color-mix(in srgb, var(--foreground) 64%, var(--muted-foreground));
  font-weight: 760;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

.trades-screen .trades-overview-row__value {
  flex: 0 0 calc(var(--space-6) * 7);
  max-width: 52%;
  color: var(--foreground);
  font-size: clamp(calc(var(--space-4) - 3px), 0.98vw, calc(var(--space-4) - 1px));
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-align: right;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

.trades-screen .trades-overview-row[data-tone="profit"] .trades-overview-row__value {
  color: var(--profit);
}

.trades-screen .trades-overview-row[data-tone="loss"] .trades-overview-row__value {
  color: var(--loss);
}

.trades-screen .trades-overview-row__meta {
  display: block;
  color: var(--muted-foreground);
}

.trades-screen .trades-symbol-row > div {
  min-width: 0;
}

.trades-screen .trades-symbol-name {
  color: var(--foreground);
  font-size: var(--space-4);
  line-height: 1.15;
  font-weight: 760;
  letter-spacing: -0.015em;
}

.trades-screen .trades-symbol-meta {
  color: var(--muted-foreground);
  margin-top: calc(var(--space-2) - 3px);
}

.trades-screen .trades-symbol-value {
  flex: 0 0 calc(var(--space-6) * 5);
  justify-content: flex-end;
  font-size: var(--space-4);
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.trades-screen .trades-symbol-value[data-tone="profit"] {
  color: var(--profit);
}

.trades-screen .trades-symbol-value[data-tone="loss"] {
  color: var(--loss);
}

.trades-screen .trades-symbol-row:first-child .trades-symbol-name {
  font-size: calc(var(--space-4) + 2px);
  font-weight: 800;
}

.trades-screen .trades-symbol-row:first-child .trades-symbol-value {
  font-size: calc(var(--space-4) + 2px);
  font-weight: 850;
}

.trades-screen .trades-symbol-value[data-tone="breakeven"],
.trades-screen .trades-symbol-value[data-tone="neutral"] {
  color: var(--muted-foreground);
}

html[data-theme="dark"] .trades-screen .tl-kpi-card,
body[data-theme="dark"] .trades-screen .tl-kpi-card {
  position: relative;
  overflow: hidden;
}

html[data-theme="dark"] .trades-screen .tl-kpi-card::after,
body[data-theme="dark"] .trades-screen .tl-kpi-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.03), transparent 42%);
  pointer-events: none;
}

html[data-theme="dark"] .trades-screen .tl-kpi-card::before,
body[data-theme="dark"] .trades-screen .tl-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

html[data-theme="dark"] .trades-screen .tl-kpi-row .tl-kpi-card:nth-child(1)::before,
body[data-theme="dark"] .trades-screen .tl-kpi-row .tl-kpi-card:nth-child(1)::before {
  background: color-mix(in srgb, var(--accent) 38%, transparent);
}

html[data-theme="dark"] .trades-screen .tl-kpi-row .tl-kpi-card:nth-child(2)::before,
body[data-theme="dark"] .trades-screen .tl-kpi-row .tl-kpi-card:nth-child(2)::before {
  background: color-mix(in srgb, var(--positive) 34%, transparent);
}

html[data-theme="dark"] .trades-screen .tl-kpi-row .tl-kpi-card:nth-child(3)::before,
body[data-theme="dark"] .trades-screen .tl-kpi-row .tl-kpi-card:nth-child(3)::before {
  background: color-mix(in srgb, #7aa2ff 28%, transparent);
}

html[data-theme="dark"] .trades-screen .tl-kpi-row .tl-kpi-card:nth-child(4)::before,
body[data-theme="dark"] .trades-screen .tl-kpi-row .tl-kpi-card:nth-child(4)::before {
  background: color-mix(in srgb, var(--warning) 28%, transparent);
}

html[data-theme="dark"] .trades-screen .tl-kpi-row .tl-kpi-card:nth-child(5)::before,
body[data-theme="dark"] .trades-screen .tl-kpi-row .tl-kpi-card:nth-child(5)::before {
  background: color-mix(in srgb, #9a8cff 28%, transparent);
}

html[data-theme="dark"] .trades-screen .tl-kpi-label,
body[data-theme="dark"] .trades-screen .tl-kpi-label {
  color: var(--text-2);
  margin-bottom: 10px;
}

html[data-theme="dark"] .trades-screen .tl-kpi-val,
body[data-theme="dark"] .trades-screen .tl-kpi-val {
  line-height: 1;
  letter-spacing: -0.02em;
}

html[data-theme="dark"] .trades-history-card,
body[data-theme="dark"] .trades-history-card {
  padding: var(--card-padding);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 1.8%, transparent), transparent 64%),
    var(--layer-2);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-card);
  overflow: hidden;
}

html[data-theme="dark"] .trades-history-card .tl-section-header,
body[data-theme="dark"] .trades-history-card .tl-section-header {
  margin-bottom: var(--space-4);
  align-items: flex-start;
}

html[data-theme="dark"] .trades-table-summary,
body[data-theme="dark"] .trades-table-summary {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  align-items: center;
  color: var(--muted-foreground);
  font-size: var(--kmfx-label-size);
  line-height: 1.35;
}

html[data-theme="dark"] .trades-table-summary span,
body[data-theme="dark"] .trades-table-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

html[data-theme="dark"] .trades-toolbar,
body[data-theme="dark"] .trades-toolbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid color-mix(in srgb, var(--border-0) 72%, transparent);
}

html[data-theme="dark"] .trades-filter-field,
body[data-theme="dark"] .trades-filter-field {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

html[data-theme="dark"] .trades-filter-field.is-active,
body[data-theme="dark"] .trades-filter-field.is-active {
  color: var(--text-0);
}

html[data-theme="dark"] .trades-filter-field span,
body[data-theme="dark"] .trades-filter-field span {
  font-size: var(--kmfx-label-size);
  line-height: 1.2;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

html[data-theme="dark"] .trades-filter-field select,
html[data-theme="dark"] .trades-filter-field input,
body[data-theme="dark"] .trades-filter-field select,
body[data-theme="dark"] .trades-filter-field input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-0);
  background: color-mix(in srgb, var(--layer-1) 74%, black);
  color: var(--foreground);
  box-shadow: none;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

html[data-theme="dark"] .trades-filter-field select:hover,
html[data-theme="dark"] .trades-filter-field input:hover,
body[data-theme="dark"] .trades-filter-field select:hover,
body[data-theme="dark"] .trades-filter-field input:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--layer-1) 70%, black);
}

html[data-theme="dark"] .trades-filter-field select:focus,
html[data-theme="dark"] .trades-filter-field input:focus,
body[data-theme="dark"] .trades-filter-field select:focus,
body[data-theme="dark"] .trades-filter-field input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 36%, rgba(255, 255, 255, 0.12));
  background: color-mix(in srgb, var(--layer-1) 66%, black);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

html[data-theme="dark"] .trades-filter-field.is-active select,
html[data-theme="dark"] .trades-filter-field.is-active input,
body[data-theme="dark"] .trades-filter-field.is-active select,
body[data-theme="dark"] .trades-filter-field.is-active input {
  border-color: rgba(255, 255, 255, 0.1);
  background: color-mix(in srgb, var(--layer-2) 72%, black);
}

html[data-theme="dark"] .trades-filter-search-shell,
body[data-theme="dark"] .trades-filter-search-shell {
  position: relative;
}

html[data-theme="dark"] .trades-filter-search-shell input,
body[data-theme="dark"] .trades-filter-search-shell input {
  padding-left: 38px;
}

html[data-theme="dark"] .trades-filter-search-icon,
body[data-theme="dark"] .trades-filter-search-icon {
  position: absolute;
  top: 50%;
  left: var(--space-3);
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

html[data-theme="dark"] .trades-filter-search-icon svg,
body[data-theme="dark"] .trades-filter-search-icon svg {
  width: 100%;
  height: 100%;
}

html[data-theme="dark"] .trades-filter-field--search,
body[data-theme="dark"] .trades-filter-field--search {
  grid-column: span 2;
}

html[data-theme="dark"] .trades-table-wrap,
html[data-theme="dark"] .trades-history-card .table-wrap,
body[data-theme="dark"] .trades-table-wrap,
body[data-theme="dark"] .trades-history-card .table-wrap {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  max-height: min(620px, calc(100vh - 280px));
  overflow: auto;
  overscroll-behavior: contain;
}

html[data-theme="dark"] .trades-table-wrap::before,
html[data-theme="dark"] .trades-table-wrap::after,
html[data-theme="dark"] .trades-history-card .table-wrap::before,
html[data-theme="dark"] .trades-history-card .table-wrap::after,
body[data-theme="dark"] .trades-table-wrap::before,
body[data-theme="dark"] .trades-table-wrap::after,
body[data-theme="dark"] .trades-history-card .table-wrap::before,
body[data-theme="dark"] .trades-history-card .table-wrap::after {
  display: none !important;
}

html[data-theme="dark"] .trades-history-card table,
body[data-theme="dark"] .trades-history-card table {
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
}

html[data-theme="dark"] .trades-history-card thead th,
body[data-theme="dark"] .trades-history-card thead th {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  padding: var(--space-3) var(--table-cell-padding-x);
  font-size: var(--kmfx-label-size);
  line-height: 1.2;
  color: var(--muted-foreground);
  font-weight: 760;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-0);
  background: var(--layer-2);
  white-space: nowrap;
}

html[data-theme="dark"] .trades-history-card thead th:nth-child(n + 4):nth-child(-n + 11),
body[data-theme="dark"] .trades-history-card thead th:nth-child(n + 4):nth-child(-n + 11) {
  text-align: right;
}

html[data-theme="dark"] .trades-history-card tbody td,
body[data-theme="dark"] .trades-history-card tbody td {
  padding: var(--row-padding-y) var(--table-cell-padding-x);
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted-foreground);
  border-bottom: 1px solid color-mix(in srgb, var(--border-0) 46%, transparent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

html[data-theme="dark"] .trades-history-card tbody td:nth-child(2),
body[data-theme="dark"] .trades-history-card tbody td:nth-child(2) {
  color: var(--foreground);
  font-weight: 740;
  letter-spacing: -0.01em;
}

html[data-theme="dark"] .trades-history-card tbody td:nth-child(n + 4):nth-child(-n + 11),
body[data-theme="dark"] .trades-history-card tbody td:nth-child(n + 4):nth-child(-n + 11),
html[data-theme="dark"] .trades-history-card tbody td.table-num,
body[data-theme="dark"] .trades-history-card tbody td.table-num {
  text-align: right;
}

html[data-theme="dark"] .trades-history-card tbody tr:last-child td,
body[data-theme="dark"] .trades-history-card tbody tr:last-child td {
  border-bottom: 0;
}

html[data-theme="dark"] .trades-history-card tbody tr:hover td,
body[data-theme="dark"] .trades-history-card tbody tr:hover td {
  background: color-mix(in srgb, var(--foreground) 3.5%, transparent);
}

html[data-theme="dark"] .trades-screen .tl-section-title::before,
body[data-theme="dark"] .trades-screen .tl-section-title::before {
  display: none !important;
}

html[data-theme="dark"] .trades-screen .list-row,
body[data-theme="dark"] .trades-screen .list-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

html[data-theme="dark"] .trades-screen .row-title,
body[data-theme="dark"] .trades-screen .row-title {
  font-size: 15px;
  line-height: 1.25;
  color: var(--text-0);
}

html[data-theme="dark"] .trades-screen .row-sub,
body[data-theme="dark"] .trades-screen .row-sub {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] .trades-screen .row-chip,
body[data-theme="dark"] .trades-screen .row-chip {
  display: none;
}

html[data-theme="dark"] .trades-screen .row-pnl,
body[data-theme="dark"] .trades-screen .row-pnl {
  font-size: 16px;
  line-height: 1.1;
  font-weight: 650;
  text-align: right;
}

html[data-theme="dark"] .trades-screen .trades-open-positions,
body[data-theme="dark"] .trades-screen .trades-open-positions {
  min-width: 0;
  overflow: hidden;
  color: var(--card-foreground);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 1.8%, transparent), transparent 64%),
    var(--layer-2);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-card);
}

html[data-theme="dark"] .trades-screen .trades-open-positions__header,
body[data-theme="dark"] .trades-screen .trades-open-positions__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid color-mix(in srgb, var(--border-0) 60%, transparent);
}

html[data-theme="dark"] .trades-screen .trades-open-positions__copy,
body[data-theme="dark"] .trades-screen .trades-open-positions__copy {
  min-width: 0;
}

html[data-theme="dark"] .trades-screen .trades-open-positions__title,
body[data-theme="dark"] .trades-screen .trades-open-positions__title,
html[data-theme="dark"] .trades-screen .trades-open-positions__description,
body[data-theme="dark"] .trades-screen .trades-open-positions__description {
  margin: 0;
}

html[data-theme="dark"] .trades-screen .trades-open-positions__title,
body[data-theme="dark"] .trades-screen .trades-open-positions__title {
  color: var(--foreground);
  font-size: var(--space-4);
  line-height: 1.2;
  font-weight: 740;
  letter-spacing: -0.025em;
}

html[data-theme="dark"] .trades-screen .trades-open-positions__description,
body[data-theme="dark"] .trades-screen .trades-open-positions__description {
  margin-top: calc(var(--space-2) - 3px);
  color: var(--muted-foreground);
  font-size: var(--space-3);
  line-height: 1.35;
}

html[data-theme="dark"] .trades-screen .trades-open-positions__summary,
body[data-theme="dark"] .trades-screen .trades-open-positions__summary {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: calc(var(--space-2) - 2px);
  min-height: 28px;
  color: var(--muted-foreground);
  font-size: var(--kmfx-label-size);
  line-height: 1.1;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

html[data-theme="dark"] .trades-screen .trades-open-positions__summary-pnl,
body[data-theme="dark"] .trades-screen .trades-open-positions__summary-pnl {
  font: inherit;
  letter-spacing: inherit;
}

html[data-theme="dark"] .trades-screen .trades-open-positions__table,
body[data-theme="dark"] .trades-screen .trades-open-positions__table {
  overflow-x: auto;
}

html[data-theme="dark"] .trades-screen .trades-open-positions__head,
body[data-theme="dark"] .trades-screen .trades-open-positions__head,
html[data-theme="dark"] .trades-screen .trades-position-row,
body[data-theme="dark"] .trades-screen .trades-position-row {
  display: grid;
  grid-template-columns: minmax(168px, 1.35fr) minmax(44px, 0.28fr) minmax(62px, 0.38fr) minmax(96px, 0.58fr) minmax(112px, 0.68fr);
  align-items: center;
  min-width: 560px;
}

html[data-theme="dark"] .trades-screen .trades-open-positions__head,
body[data-theme="dark"] .trades-screen .trades-open-positions__head {
  padding: calc(var(--space-2) - 2px) var(--space-4);
  color: var(--muted-foreground);
  font-size: var(--kmfx-label-size);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid color-mix(in srgb, var(--border-0) 72%, transparent);
}

html[data-theme="dark"] .trades-screen .trades-position-row,
body[data-theme="dark"] .trades-screen .trades-position-row {
  width: 100%;
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 42px;
  padding: calc(var(--space-2) - 2px) var(--space-4);
  border-top: 1px solid color-mix(in srgb, var(--border-0) 46%, transparent);
}

html[data-theme="dark"] .trades-screen .trades-position-row:first-child,
body[data-theme="dark"] .trades-screen .trades-position-row:first-child {
  border-top: 0;
}

html[data-theme="dark"] .trades-screen .trades-position-row:hover,
body[data-theme="dark"] .trades-screen .trades-position-row:hover {
  background: color-mix(in srgb, var(--foreground) 3.5%, transparent);
}

html[data-theme="dark"] .trades-screen .trades-position-row:focus-visible,
body[data-theme="dark"] .trades-screen .trades-position-row:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

html[data-theme="dark"] .trades-screen .trades-position-row__main,
body[data-theme="dark"] .trades-screen .trades-position-row__main {
  display: grid;
  gap: calc(var(--space-2) - 4px);
  min-width: 0;
}

html[data-theme="dark"] .trades-screen .trades-position-row__symbol,
body[data-theme="dark"] .trades-screen .trades-position-row__symbol {
  color: var(--foreground);
  font-size: calc(var(--space-4) - 2px);
  line-height: 1.12;
  font-weight: 760;
  letter-spacing: -0.015em;
}

html[data-theme="dark"] .trades-screen .trades-position-row__meta,
body[data-theme="dark"] .trades-screen .trades-position-row__meta {
  display: none;
  color: var(--muted-foreground);
  font-size: var(--kmfx-label-size);
  line-height: 1.25;
}

html[data-theme="dark"] .trades-screen .trades-position-row__value,
body[data-theme="dark"] .trades-screen .trades-position-row__value {
  color: color-mix(in srgb, var(--foreground) 76%, var(--muted-foreground));
  font-size: calc(var(--space-3) - 1px);
  line-height: 1.2;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .trades-screen .trades-position-row__side,
body[data-theme="dark"] .trades-screen .trades-position-row__side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 18px;
  padding: 1px 6px;
  border: 1px solid var(--border-0);
  border-radius: var(--control-radius-pill);
  color: var(--muted-foreground);
  background: color-mix(in srgb, var(--foreground) 3%, transparent);
  font-size: 8.5px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

html[data-theme="dark"] .trades-screen .trades-position-row__side--buy,
body[data-theme="dark"] .trades-screen .trades-position-row__side--buy {
  color: color-mix(in srgb, var(--positive) 82%, white);
  background: color-mix(in srgb, var(--positive) 9%, transparent);
  border-color: color-mix(in srgb, var(--positive) 18%, var(--border-0));
}

html[data-theme="dark"] .trades-screen .trades-position-row__side--sell,
body[data-theme="dark"] .trades-screen .trades-position-row__side--sell {
  color: color-mix(in srgb, var(--negative) 78%, white);
  background: color-mix(in srgb, var(--negative) 9%, transparent);
  border-color: color-mix(in srgb, var(--negative) 18%, var(--border-0));
}

html[data-theme="dark"] .trades-screen .trades-position-row__pnl-cell,
body[data-theme="dark"] .trades-screen .trades-position-row__pnl-cell {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

html[data-theme="dark"] .trades-screen .trades-position-row__pnl,
body[data-theme="dark"] .trades-screen .trades-position-row__pnl {
  justify-content: flex-end;
  font-size: calc(var(--space-4) - 2px);
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

html[data-theme="dark"] .trades-position-focus,
body[data-theme="dark"] .trades-position-focus {
  display: grid;
  gap: var(--space-3);
  box-sizing: border-box;
  width: 100%;
  padding: var(--space-4) var(--space-5) 0;
  color: var(--foreground);
}

html[data-theme="dark"] .modal-card--focus-panel:has(.trades-position-focus),
body[data-theme="dark"] .modal-card--focus-panel:has(.trades-position-focus) {
  width: min(64vw, 700px);
  max-height: min(74vh, 680px);
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__header,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__header {
  padding: var(--space-4) calc(var(--space-6) * 3) var(--space-4) var(--space-5);
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__content,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__content {
  margin: 0;
  padding-bottom: var(--space-4);
}

html[data-theme="dark"] .trades-position-focus__head,
body[data-theme="dark"] .trades-position-focus__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  box-sizing: border-box;
  width: 100%;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .trades-position-focus__eyebrow,
body[data-theme="dark"] .trades-position-focus__eyebrow,
html[data-theme="dark"] .trades-position-focus__label,
body[data-theme="dark"] .trades-position-focus__label {
  color: var(--muted-foreground);
  font-size: var(--kmfx-label-size);
  line-height: 1.1;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

html[data-theme="dark"] .trades-position-focus__title,
body[data-theme="dark"] .trades-position-focus__title,
html[data-theme="dark"] .trades-position-focus__description,
body[data-theme="dark"] .trades-position-focus__description {
  margin: 0;
}

html[data-theme="dark"] .trades-position-focus__title,
body[data-theme="dark"] .trades-position-focus__title {
  margin-top: calc(var(--space-2) - 4px);
  color: var(--foreground);
  font-size: calc(var(--space-4) - 1px);
  line-height: 1.2;
  font-weight: 740;
  letter-spacing: -0.02em;
}

html[data-theme="dark"] .trades-position-focus__description,
body[data-theme="dark"] .trades-position-focus__description {
  max-width: 260px;
  color: var(--muted-foreground);
  font-size: var(--space-3);
  line-height: 1.35;
  text-align: right;
}

html[data-theme="dark"] .trades-position-focus__grid,
body[data-theme="dark"] .trades-position-focus__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  border-top: 1px solid var(--border-0);
}

html[data-theme="dark"] .trades-position-focus__item,
body[data-theme="dark"] .trades-position-focus__item {
  display: grid;
  gap: calc(var(--space-2) - 4px);
  min-width: 0;
  padding: calc(var(--space-3) - 2px) var(--space-3);
  border-right: 1px solid var(--border-0);
  border-bottom: 1px solid var(--border-0);
}

html[data-theme="dark"] .trades-position-focus__item:nth-child(2n),
body[data-theme="dark"] .trades-position-focus__item:nth-child(2n) {
  border-right: 0;
}

html[data-theme="dark"] .trades-position-focus__value,
body[data-theme="dark"] .trades-position-focus__value {
  color: var(--foreground);
  font-size: calc(var(--space-4) - 1px);
  line-height: 1.2;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .trades-screen .widget-position-rails,
body[data-theme="dark"] .trades-screen .widget-position-rails {
  margin-top: var(--trades-space-sm);
  display: grid;
  gap: var(--trades-space-sm);
}

html[data-theme="dark"] .trades-screen .open-position-summary,
body[data-theme="dark"] .trades-screen .open-position-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .trades-screen .open-position-summary__copy,
body[data-theme="dark"] .trades-screen .open-position-summary__copy {
  min-width: 0;
}

html[data-theme="dark"] .trades-screen .open-position-summary__title,
body[data-theme="dark"] .trades-screen .open-position-summary__title {
  color: var(--text-0);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.01em;
}

html[data-theme="dark"] .trades-screen .open-position-summary__meta,
body[data-theme="dark"] .trades-screen .open-position-summary__meta {
  margin-top: 4px;
  color: var(--text-1);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .trades-screen .open-position-summary__pnl,
body[data-theme="dark"] .trades-screen .open-position-summary__pnl {
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  text-align: right;
}

html[data-theme="dark"] .trades-screen .trade-side,
body[data-theme="dark"] .trades-screen .trade-side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(var(--space-6) * 2);
  padding: calc(var(--space-2) / 2) var(--space-3);
  border-radius: var(--control-radius-pill);
  font-size: var(--kmfx-label-size);
  line-height: 1;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border-0);
  color: var(--muted-foreground);
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .trades-screen .open-position-row,
html[data-theme="dark"] .trades-screen .trade-row,
body[data-theme="dark"] .trades-screen .open-position-row,
body[data-theme="dark"] .trades-screen .trade-row {
  cursor: pointer;
}

html[data-theme="dark"] .trades-screen .trade-side--buy,
body[data-theme="dark"] .trades-screen .trade-side--buy {
  color: color-mix(in srgb, var(--positive) 82%, white);
  background: color-mix(in srgb, var(--positive) 10%, transparent);
  border-color: color-mix(in srgb, var(--positive) 20%, var(--border-subtle));
}

html[data-theme="dark"] .trades-screen .trade-side--sell,
body[data-theme="dark"] .trades-screen .trade-side--sell {
  color: color-mix(in srgb, var(--negative) 82%, white);
  background: color-mix(in srgb, var(--negative) 10%, transparent);
  border-color: color-mix(in srgb, var(--negative) 20%, var(--border-subtle));
}

html[data-theme="dark"] .trades-empty-state,
body[data-theme="dark"] .trades-empty-state {
  padding: var(--trades-space-lg) var(--trades-space-sm) !important;
  color: var(--text-1);
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

@media (max-width: 1180px) {
  .trades-screen .trades-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trades-screen .trades-truth-compact__header {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .trades-screen .trades-truth-compact__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trades-screen .trades-truth-compact__cell:nth-child(2n) {
    border-right: 0;
  }

  .trades-screen .trades-truth-compact__cell:nth-child(n + 3) {
    border-top: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
  }

  html[data-theme="dark"] .trades-screen .trades-truth__grid,
  body[data-theme="dark"] .trades-screen .trades-truth__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .trades-toolbar,
  body[data-theme="dark"] .trades-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .trades-filter-field--search,
  body[data-theme="dark"] .trades-filter-field--search {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .trades-screen .trades-kpi-row {
    grid-template-columns: 1fr;
  }

  .trades-screen .trades-overview-grid {
    grid-template-columns: 1fr;
  }

  .trades-screen .trades-overview-row {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-2);
  }

  .trades-screen .trades-overview-row__value {
    max-width: none;
    text-align: left;
  }

  .trades-screen .trades-open-positions__header {
    flex-direction: column;
    gap: var(--space-2);
  }

  .trades-screen .trades-open-positions__summary {
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
  }

  html[data-theme="dark"] .trades-screen .trades-open-positions__head,
  body[data-theme="dark"] .trades-screen .trades-open-positions__head {
    display: none;
  }

  html[data-theme="dark"] .trades-screen .trades-position-row,
  body[data-theme="dark"] .trades-screen .trades-position-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-width: 0;
    gap: var(--space-3);
  }

  html[data-theme="dark"] .trades-screen .trades-position-row__meta,
  body[data-theme="dark"] .trades-screen .trades-position-row__meta {
    display: block;
  }

  html[data-theme="dark"] .trades-screen .trades-position-row__value,
  body[data-theme="dark"] .trades-screen .trades-position-row__value {
    display: none;
  }

  html[data-theme="dark"] .trades-position-focus__head,
  body[data-theme="dark"] .trades-position-focus__head {
    flex-direction: column;
    gap: var(--space-2);
  }

  html[data-theme="dark"] .trades-position-focus__description,
  body[data-theme="dark"] .trades-position-focus__description {
    max-width: none;
    text-align: left;
  }

  html[data-theme="dark"] .trades-position-focus__grid,
  body[data-theme="dark"] .trades-position-focus__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .trades-position-focus__item:nth-child(2n),
  body[data-theme="dark"] .trades-position-focus__item:nth-child(2n) {
    border-right: 0;
  }

  .trades-screen .trades-truth-compact__grid {
    grid-template-columns: 1fr;
  }

  .trades-screen .trades-truth-compact__cell,
  .trades-screen .trades-truth-compact__cell:nth-child(n) {
    border-right: 0;
    border-top: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
  }

  .trades-screen .trades-truth-compact__cell:first-child {
    border-top: 0;
  }

  html[data-theme="dark"] .trades-screen .trades-truth,
  body[data-theme="dark"] .trades-screen .trades-truth {
    padding: 16px;
  }

  html[data-theme="dark"] .trades-screen .trades-truth__header,
  body[data-theme="dark"] .trades-screen .trades-truth__header {
    flex-direction: column;
    gap: 10px;
  }

  html[data-theme="dark"] .trades-screen .trades-truth__grid,
  body[data-theme="dark"] .trades-screen .trades-truth__grid,
  html[data-theme="dark"] .trades-screen .trades-truth__metrics,
  body[data-theme="dark"] .trades-screen .trades-truth__metrics {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .trades-toolbar,
  body[data-theme="dark"] .trades-toolbar {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .trades-filter-field--search,
  body[data-theme="dark"] .trades-filter-field--search {
    grid-column: auto;
  }
}
/* FIN BLOQUE: trades-runtime */

/* INICIO BLOQUE: strategies-runtime */
html[data-theme="dark"] .strategies-screen,
body[data-theme="dark"] .strategies-screen {
  --strategies-space-sm: 16px;
  --strategies-space-md: 24px;
  --strategies-space-lg: 32px;
  display: grid;
  gap: var(--strategies-space-lg);
}

html[data-theme="dark"] .strategies-screen__header,
body[data-theme="dark"] .strategies-screen__header {
  align-items: flex-start;
}

html[data-theme="dark"] .strategies-screen__actions,
body[data-theme="dark"] .strategies-screen__actions {
  flex-shrink: 0;
}

html[data-theme="dark"] .strategies-screen__actions .btn-inline,
body[data-theme="dark"] .strategies-screen__actions .btn-inline {
  min-height: 40px;
  padding-inline: 18px;
}

html[data-theme="dark"] .strategies-setup-card,
body[data-theme="dark"] .strategies-setup-card {
  padding: 20px !important;
}

html[data-theme="dark"] .strategies-table-card,
body[data-theme="dark"] .strategies-table-card {
  padding: var(--strategies-space-md) !important;
}

html[data-theme="dark"] .strategies-setup-card .tl-section-header,
html[data-theme="dark"] .strategies-table-card .tl-section-header,
body[data-theme="dark"] .strategies-setup-card .tl-section-header,
body[data-theme="dark"] .strategies-table-card .tl-section-header {
  margin-bottom: var(--strategies-space-sm);
  align-items: flex-start;
}

html[data-theme="dark"] .strategies-setup-card .tl-section-header,
body[data-theme="dark"] .strategies-setup-card .tl-section-header {
  gap: 18px;
}

html[data-theme="dark"] .strategies-setup-card .tl-section-title::before,
html[data-theme="dark"] .strategies-table-card .tl-section-title::before,
body[data-theme="dark"] .strategies-setup-card .tl-section-title::before,
body[data-theme="dark"] .strategies-table-card .tl-section-title::before {
  display: none;
}

html[data-theme="dark"] .strategies-section-heading,
body[data-theme="dark"] .strategies-section-heading {
  display: grid;
  gap: 5px;
  min-width: 0;
}

html[data-theme="dark"] .strategies-section-heading .tl-section-title,
body[data-theme="dark"] .strategies-section-heading .tl-section-title {
  margin: 0;
  color: var(--text-0);
  font-size: 17px;
  line-height: 1.12;
  font-weight: 720;
  letter-spacing: -0.025em;
}

html[data-theme="dark"] .strategies-section-heading .row-sub,
body[data-theme="dark"] .strategies-section-heading .row-sub {
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.35;
}

html[data-theme="dark"] .strategies-summary,
body[data-theme="dark"] .strategies-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(100%, 680px);
}

html[data-theme="dark"] .strategies-summary__item,
body[data-theme="dark"] .strategies-summary__item {
  display: inline-grid;
  align-content: center;
  gap: 5px;
  min-width: 126px;
  padding: 8px 11px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--text-0) 2.5%, transparent);
}

html[data-theme="dark"] .strategies-summary__label,
body[data-theme="dark"] .strategies-summary__label {
  color: var(--text-2);
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme="dark"] .strategies-summary__value,
body[data-theme="dark"] .strategies-summary__value {
  color: var(--text-0);
  font-size: 12.5px;
  line-height: 1.1;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

html[data-theme="dark"] .strategies-summary__value .kmfx-ui-pnl,
body[data-theme="dark"] .strategies-summary__value .kmfx-ui-pnl {
  justify-content: flex-start;
}

html[data-theme="dark"] .strategies-setup-grid,
body[data-theme="dark"] .strategies-setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

html[data-theme="dark"] .strategies-setup-item,
body[data-theme="dark"] .strategies-setup-item {
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 13px 14px 12px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 86%, transparent);
  border-radius: var(--radius-card, 16px);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--text-0) 2.4%, transparent), transparent 68%),
    color-mix(in srgb, var(--layer-2, #171717) 88%, transparent);
  transition: border-color 140ms ease, background-color 140ms ease;
}

html[data-theme="dark"] .strategies-setup-item:hover,
body[data-theme="dark"] .strategies-setup-item:hover {
  border-color: color-mix(in srgb, var(--border-subtle) 68%, var(--text-0) 18%);
  background-color: color-mix(in srgb, var(--text-0) 1.8%, transparent);
}

html[data-theme="dark"] .strategies-setup-item__head,
body[data-theme="dark"] .strategies-setup-item__head {
  display: grid;
  gap: 4px;
}

html[data-theme="dark"] .strategies-setup-item__name,
body[data-theme="dark"] .strategies-setup-item__name {
  color: var(--text-0);
  font-size: 15px;
  line-height: 1.15;
  font-weight: 740;
  letter-spacing: -0.022em;
}

html[data-theme="dark"] .strategies-setup-item__sample,
body[data-theme="dark"] .strategies-setup-item__sample {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.25;
}

html[data-theme="dark"] .strategies-setup-item__stats,
body[data-theme="dark"] .strategies-setup-item__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--text-1);
  font-size: 12px;
  line-height: 1.35;
}

html[data-theme="dark"] .strategies-setup-item__metric,
body[data-theme="dark"] .strategies-setup-item__metric {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 76%, transparent);
  border-radius: 999px;
  color: var(--text-1);
  background: color-mix(in srgb, var(--text-0) 2%, transparent);
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .strategies-setup-item__metric--pnl,
body[data-theme="dark"] .strategies-setup-item__metric--pnl {
  padding-inline: 0;
  border: 0;
  background: transparent;
  font-weight: 720;
}

html[data-theme="dark"] .strategies-setup-item--empty,
body[data-theme="dark"] .strategies-setup-item--empty {
  grid-column: 1 / -1;
}

html[data-theme="dark"] .strategies-table-card .table-wrap,
body[data-theme="dark"] .strategies-table-card .table-wrap {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .strategies-table-card table,
body[data-theme="dark"] .strategies-table-card table {
  min-width: 1120px;
}

html[data-theme="dark"] .strategies-table-card thead th,
body[data-theme="dark"] .strategies-table-card thead th {
  padding: 9px 12px;
  color: color-mix(in srgb, var(--text-2) 82%, white);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
}

html[data-theme="dark"] .strategies-table-card tbody td,
body[data-theme="dark"] .strategies-table-card tbody td {
  padding: 12px;
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.35;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  transition: background-color 120ms ease, border-color 120ms ease;
  background: transparent !important;
}

html[data-theme="dark"] .strategies-table-card tbody tr,
html[data-theme="dark"] .strategies-table-row,
body[data-theme="dark"] .strategies-table-card tbody tr,
body[data-theme="dark"] .strategies-table-row {
  background: transparent !important;
}

html[data-theme="dark"] .strategies-table-card tbody tr:last-child td,
body[data-theme="dark"] .strategies-table-card tbody tr:last-child td {
  border-bottom: 0;
}

html[data-theme="dark"] .strategies-table-card tbody tr:hover,
html[data-theme="dark"] .strategies-table-row:hover,
body[data-theme="dark"] .strategies-table-card tbody tr:hover,
body[data-theme="dark"] .strategies-table-row:hover {
  background: transparent !important;
}

html[data-theme="dark"] .strategies-table-card tbody tr:hover td,
body[data-theme="dark"] .strategies-table-card tbody tr:hover td {
  background: rgba(255, 255, 255, 0.014) !important;
}

html[data-theme="dark"] .strategies-table-row:hover td,
body[data-theme="dark"] .strategies-table-row:hover td {
  background: rgba(255, 255, 255, 0.014) !important;
}

html[data-theme="dark"] .strategy-primary-cell,
body[data-theme="dark"] .strategy-primary-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

html[data-theme="dark"] .strategy-primary-cell strong,
body[data-theme="dark"] .strategy-primary-cell strong {
  color: var(--text-0);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.02em;
}

html[data-theme="dark"] .strategy-primary-cell .row-sub,
body[data-theme="dark"] .strategy-primary-cell .row-sub {
  margin-top: 0;
  max-width: 34ch;
}

html[data-theme="dark"] .strategy-primary-cell__meta,
body[data-theme="dark"] .strategy-primary-cell__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

html[data-theme="dark"] .strategy-status-chip,
body[data-theme="dark"] .strategy-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, transparent);
  background: color-mix(in srgb, var(--text-0) 2.5%, transparent);
  color: var(--text-1);
  font-size: 11px;
  line-height: 1;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[data-theme="dark"] .strategy-status-chip--active,
body[data-theme="dark"] .strategy-status-chip--active {
  color: color-mix(in srgb, var(--positive) 76%, white 24%);
  border-color: color-mix(in srgb, var(--positive) 20%, var(--border-subtle));
  background: color-mix(in srgb, var(--positive) 5%, transparent);
}

html[data-theme="dark"] .strategy-status-chip--testing,
body[data-theme="dark"] .strategy-status-chip--testing {
  color: color-mix(in srgb, var(--equity, var(--text-1)) 70%, white 30%);
  border-color: color-mix(in srgb, var(--equity, var(--text-1)) 18%, var(--border-subtle));
}

html[data-theme="dark"] .strategy-status-chip--paused,
body[data-theme="dark"] .strategy-status-chip--paused,
html[data-theme="dark"] .strategy-status-chip--retired,
body[data-theme="dark"] .strategy-status-chip--retired {
  color: var(--text-2);
}

html[data-theme="dark"] .strategies-score-cell,
body[data-theme="dark"] .strategies-score-cell {
  min-width: 130px;
}

html[data-theme="dark"] .strategies-score-read,
body[data-theme="dark"] .strategies-score-read {
  display: grid;
  gap: 5px;
  justify-items: end;
}

html[data-theme="dark"] .strategies-score-read strong,
body[data-theme="dark"] .strategies-score-read strong {
  color: var(--text-0);
  font-size: 14px;
  line-height: 1;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .strategies-score-read span,
body[data-theme="dark"] .strategies-score-read span {
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.3;
}

html[data-theme="dark"] .strategies-score-read__meta,
body[data-theme="dark"] .strategies-score-read__meta {
  display: grid;
  gap: 3px;
  justify-items: end;
}

html[data-theme="dark"] .strategies-score-read__grade,
body[data-theme="dark"] .strategies-score-read__grade {
  color: color-mix(in srgb, var(--text-1) 90%, white);
  font-size: 11px;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-theme="dark"] .strategies-score-read__sample,
body[data-theme="dark"] .strategies-score-read__sample {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.35;
}

html[data-theme="dark"] .strategies-table-actions,
body[data-theme="dark"] .strategies-table-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

html[data-theme="dark"] .strategies-action-btn,
body[data-theme="dark"] .strategies-action-btn {
  min-height: 30px;
  padding-inline: 10px;
  border-color: var(--border-subtle) !important;
  background: transparent !important;
  color: var(--text-1);
  font-size: 12px;
}

html[data-theme="dark"] .strategies-action-btn:hover,
body[data-theme="dark"] .strategies-action-btn:hover {
  background: rgba(255, 255, 255, 0.035) !important;
}

html[data-theme="dark"] .strategies-action-btn--danger,
body[data-theme="dark"] .strategies-action-btn--danger {
  color: color-mix(in srgb, var(--negative) 82%, white) !important;
  border-color: color-mix(in srgb, var(--negative) 16%, var(--border-subtle)) !important;
}

html[data-theme="dark"] .strategies-action-btn--danger:hover,
body[data-theme="dark"] .strategies-action-btn--danger:hover {
  background: color-mix(in srgb, var(--negative) 8%, transparent) !important;
}

html[data-theme="dark"] .strategies-empty-state,
body[data-theme="dark"] .strategies-empty-state {
  display: grid;
  justify-items: start;
  gap: var(--strategies-space-sm);
  padding: var(--strategies-space-lg) var(--strategies-space-sm);
}

html[data-theme="dark"] .strategies-empty-state__title,
body[data-theme="dark"] .strategies-empty-state__title {
  color: var(--text-0);
  font-size: 18px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.02em;
}

html[data-theme="dark"] .strategies-empty-state__copy,
body[data-theme="dark"] .strategies-empty-state__copy {
  max-width: 52ch;
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.45;
}

html[data-theme="dark"] .modal-card:has(.strategies-dialog),
body[data-theme="dark"] .modal-card:has(.strategies-dialog) {
  width: min(704px, calc(100vw - 32px));
  max-width: min(704px, calc(100vw - 32px)) !important;
  background: var(--popover, #111111) !important;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent) !important;
  box-shadow: 0 22px 72px rgba(0, 0, 0, 0.44) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .modal-card:has(.strategies-dialog) .modal-head,
body[data-theme="dark"] .modal-card:has(.strategies-dialog) .modal-head {
  padding: 24px 30px 20px !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--foreground) 3.2%, transparent), transparent),
    color-mix(in srgb, var(--popover, #111111) 86%, var(--card, #171717));
}

html[data-theme="dark"] .modal-card:has(.strategies-dialog) .modal-title,
body[data-theme="dark"] .modal-card:has(.strategies-dialog) .modal-title {
  color: var(--text-0);
}

html[data-theme="dark"] .modal-card:has(.strategies-dialog) .modal-subtitle,
body[data-theme="dark"] .modal-card:has(.strategies-dialog) .modal-subtitle {
  color: var(--muted-foreground, var(--text-1));
  max-width: 54ch;
  line-height: 1.42;
}

html[data-theme="dark"] .modal-card:has(.strategies-dialog) .modal-body,
body[data-theme="dark"] .modal-card:has(.strategies-dialog) .modal-body {
  padding: 0;
  background: var(--popover, #111111);
}

html[data-theme="dark"] .strategies-dialog,
body[data-theme="dark"] .strategies-dialog {
  padding: 22px 30px 0;
}

html[data-theme="dark"] .strategies-dialog__form,
body[data-theme="dark"] .strategies-dialog__form {
  display: grid;
  gap: 18px;
}

html[data-theme="dark"] .strategies-dialog__grid,
body[data-theme="dark"] .strategies-dialog__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

html[data-theme="dark"] .strategies-dialog__field,
body[data-theme="dark"] .strategies-dialog__field {
  display: grid;
  gap: 7px;
}

html[data-theme="dark"] .strategies-dialog__field--full,
body[data-theme="dark"] .strategies-dialog__field--full {
  grid-column: 1 / -1;
}

html[data-theme="dark"] .strategies-dialog__field > span,
body[data-theme="dark"] .strategies-dialog__field > span {
  color: var(--muted-foreground, var(--text-1));
  font-size: 11px;
  line-height: 1.2;
  font-weight: 720;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

html[data-theme="dark"] .strategies-dialog__field input,
html[data-theme="dark"] .strategies-dialog__field select,
html[data-theme="dark"] .strategies-dialog__field textarea,
body[data-theme="dark"] .strategies-dialog__field input,
body[data-theme="dark"] .strategies-dialog__field select,
body[data-theme="dark"] .strategies-dialog__field textarea {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent) !important;
  background: color-mix(in srgb, var(--card, #171717) 88%, transparent) !important;
  color: var(--foreground, var(--text-0)) !important;
  font-family: inherit !important;
  font-size: 14px !important;
  line-height: 1.35;
  box-shadow: none !important;
}

html[data-theme="dark"] .strategies-dialog__field textarea,
body[data-theme="dark"] .strategies-dialog__field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

html[data-theme="dark"] .strategies-dialog__field input::placeholder,
html[data-theme="dark"] .strategies-dialog__field textarea::placeholder,
body[data-theme="dark"] .strategies-dialog__field input::placeholder,
body[data-theme="dark"] .strategies-dialog__field textarea::placeholder {
  color: var(--text-2) !important;
}

html[data-theme="dark"] .strategies-dialog__field input:hover,
html[data-theme="dark"] .strategies-dialog__field select:hover,
html[data-theme="dark"] .strategies-dialog__field textarea:hover,
body[data-theme="dark"] .strategies-dialog__field input:hover,
body[data-theme="dark"] .strategies-dialog__field select:hover,
body[data-theme="dark"] .strategies-dialog__field textarea:hover {
  border-color: color-mix(in srgb, var(--border) 62%, var(--foreground) 12%) !important;
  background: color-mix(in srgb, var(--card, #171717) 92%, var(--foreground) 2%) !important;
}

html[data-theme="dark"] .strategies-dialog__field input:focus,
html[data-theme="dark"] .strategies-dialog__field select:focus,
html[data-theme="dark"] .strategies-dialog__field textarea:focus,
body[data-theme="dark"] .strategies-dialog__field input:focus,
body[data-theme="dark"] .strategies-dialog__field select:focus,
body[data-theme="dark"] .strategies-dialog__field textarea:focus {
  border-color: color-mix(in srgb, var(--ring) 34%, var(--border)) !important;
  background: color-mix(in srgb, var(--card, #171717) 94%, var(--foreground) 3%) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 13%, transparent) !important;
  outline: none;
}

html[data-theme="dark"] .strategies-dialog__field input:-webkit-autofill,
html[data-theme="dark"] .strategies-dialog__field input:-webkit-autofill:hover,
html[data-theme="dark"] .strategies-dialog__field input:-webkit-autofill:focus,
html[data-theme="dark"] .strategies-dialog__field textarea:-webkit-autofill,
html[data-theme="dark"] .strategies-dialog__field textarea:-webkit-autofill:hover,
html[data-theme="dark"] .strategies-dialog__field textarea:-webkit-autofill:focus,
body[data-theme="dark"] .strategies-dialog__field input:-webkit-autofill,
body[data-theme="dark"] .strategies-dialog__field input:-webkit-autofill:hover,
body[data-theme="dark"] .strategies-dialog__field input:-webkit-autofill:focus,
body[data-theme="dark"] .strategies-dialog__field textarea:-webkit-autofill,
body[data-theme="dark"] .strategies-dialog__field textarea:-webkit-autofill:hover,
body[data-theme="dark"] .strategies-dialog__field textarea:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-0) !important;
  box-shadow: 0 0 0 1000px #171717 inset !important;
  transition: background-color 99999s ease-in-out 0s;
}

html[data-theme="dark"] .strategies-dialog__footer,
body[data-theme="dark"] .strategies-dialog__footer {
  margin: 0 -30px !important;
  padding: 16px 30px 18px !important;
  border-top: 1px solid color-mix(in srgb, var(--border) 82%, transparent) !important;
  background: color-mix(in srgb, var(--popover, #111111) 88%, var(--card, #171717)) !important;
}

html[data-theme="dark"] .strategies-dialog__footer .btn-secondary,
html[data-theme="dark"] .strategies-dialog__footer .btn-primary,
body[data-theme="dark"] .strategies-dialog__footer .btn-secondary,
body[data-theme="dark"] .strategies-dialog__footer .btn-primary {
  min-height: 38px;
  padding-inline: 16px;
}

@media (max-width: 980px) {
  html[data-theme="dark"] .strategies-screen__header,
  body[data-theme="dark"] .strategies-screen__header {
    flex-direction: column;
    align-items: stretch;
  }

  html[data-theme="dark"] .strategies-setup-grid,
  body[data-theme="dark"] .strategies-setup-grid {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .strategies-dialog__grid,
  body[data-theme="dark"] .strategies-dialog__grid {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .strategies-summary,
  body[data-theme="dark"] .strategies-summary {
    width: 100%;
    justify-content: flex-start;
  }

  html[data-theme="dark"] .strategies-summary__item,
  body[data-theme="dark"] .strategies-summary__item {
    flex: 1 1 150px;
  }
}
/* FIN BLOQUE: strategies-runtime */

/* INICIO BLOQUE: sidebar-runtime */
html[data-theme="dark"] .app-shell.sidebar-vnext,
body[data-theme="dark"] .app-shell.sidebar-vnext {
  --sidebar-vnext-expanded-width: 238px;
  --sidebar-vnext-collapsed-width: 72px;
  --sidebar-vnext-main-gap: 30px;
  --sidebar-vnext-divider-offset: 6px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar {
  width: var(--sidebar-vnext-expanded-width);
  padding: 16px 16px 16px 0;
  gap: 18px;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .main-panel,
body[data-theme="dark"] .app-shell.sidebar-vnext .main-panel {
  padding-left: 24px !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-vnext-divider,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-vnext-divider {
  left: calc(var(--sidebar-vnext-expanded-width) + var(--sidebar-vnext-divider-offset));
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-vnext-divider,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-vnext-divider {
  left: calc(var(--sidebar-vnext-collapsed-width) + var(--sidebar-vnext-divider-offset));
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-header,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-header {
  display: grid;
  gap: 18px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-topbar,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-topbar {
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  min-height: 36px;
  padding-left: 12px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .brand-lockup,
body[data-theme="dark"] .app-shell.sidebar-vnext .brand-lockup {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .brand-logo,
body[data-theme="dark"] .app-shell.sidebar-vnext .brand-logo {
  width: 26px;
  height: 26px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .brand-title-main,
body[data-theme="dark"] .app-shell.sidebar-vnext .brand-title-main {
  font-size: 15px;
  line-height: 1.05;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .brand-title-edge,
body[data-theme="dark"] .app-shell.sidebar-vnext .brand-title-edge {
  font-size: 13px;
  line-height: 1.05;
  color: var(--text-2);
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-slot,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-slot {
  margin-top: 0;
  padding-left: 12px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher,
html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher--empty,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher--empty {
  grid-template-columns: 36px minmax(0, 1fr);
  min-height: auto;
  gap: 12px;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher--button,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher--button {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher__icon,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher__icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher__copy,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher__copy {
  gap: 3px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher--button:hover,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher--button:hover {
  opacity: 0.96;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher__title,
html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher__select,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher__title,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher__select {
  font-size: 13px;
  line-height: 1.15;
  font-weight: 600;
  color: var(--text-0);
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher__meta,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher__meta {
  font-size: 10px;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher__balance,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-account-switcher__balance {
  font-size: 12px;
  line-height: 1.15;
  color: var(--text-1);
}

html[data-theme="dark"] .sidebar-account-picker,
body[data-theme="dark"] .sidebar-account-picker {
  display: grid;
  gap: 18px;
}

html[data-theme="dark"] .sidebar-account-picker__list,
body[data-theme="dark"] .sidebar-account-picker__list {
  display: grid;
  gap: 12px;
}

html[data-theme="dark"] .sidebar-account-picker__item,
body[data-theme="dark"] .sidebar-account-picker__item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border-0);
  background: var(--layer-1);
  color: var(--text-0);
  text-align: left;
}

html[data-theme="dark"] .sidebar-account-picker__item:hover,
body[data-theme="dark"] .sidebar-account-picker__item:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border-0));
}

html[data-theme="dark"] .sidebar-account-picker__item.is-active,
body[data-theme="dark"] .sidebar-account-picker__item.is-active {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--border-0));
}

html[data-theme="dark"] .sidebar-account-picker__item-icon,
body[data-theme="dark"] .sidebar-account-picker__item-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-0);
}

html[data-theme="dark"] .sidebar-account-picker__item-copy,
body[data-theme="dark"] .sidebar-account-picker__item-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

html[data-theme="dark"] .sidebar-account-picker__item-title,
body[data-theme="dark"] .sidebar-account-picker__item-title {
  font-size: 16px;
  line-height: 1.15;
  font-weight: 650;
  color: var(--text-0);
}

html[data-theme="dark"] .sidebar-account-picker__item-balance,
body[data-theme="dark"] .sidebar-account-picker__item-balance {
  font-size: 13px;
  line-height: 1.25;
  color: var(--text-1);
}

html[data-theme="dark"] .sidebar-account-picker__item-check,
body[data-theme="dark"] .sidebar-account-picker__item-check {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 20px;
  line-height: 1;
}

html[data-theme="dark"] .sidebar-account-picker__footer,
body[data-theme="dark"] .sidebar-account-picker__footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-0);
}

html[data-theme="dark"] .sidebar-account-picker__add,
body[data-theme="dark"] .sidebar-account-picker__add {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 16px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-0);
  text-align: left;
}

html[data-theme="dark"] .sidebar-account-picker__add:hover,
body[data-theme="dark"] .sidebar-account-picker__add:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .sidebar-account-picker__add-icon,
body[data-theme="dark"] .sidebar-account-picker__add-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  color: var(--text-0);
  font-size: 30px;
  line-height: 1;
}

html[data-theme="dark"] .sidebar-account-picker__add-copy,
body[data-theme="dark"] .sidebar-account-picker__add-copy {
  display: grid;
  gap: 4px;
}

html[data-theme="dark"] .sidebar-account-picker__add-title,
body[data-theme="dark"] .sidebar-account-picker__add-title {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 650;
  color: var(--text-0);
}

html[data-theme="dark"] .sidebar-account-picker__add-subtitle,
body[data-theme="dark"] .sidebar-account-picker__add-subtitle {
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-1);
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-nav,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-nav {
  padding: 4px 0 0 12px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .nav-list,
body[data-theme="dark"] .app-shell.sidebar-vnext .nav-list {
  gap: 12px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .nav-group,
body[data-theme="dark"] .app-shell.sidebar-vnext .nav-group {
  display: grid;
  gap: 4px;
  border-top: 0 !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .nav-group + .nav-group,
body[data-theme="dark"] .app-shell.sidebar-vnext .nav-group + .nav-group {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .app-shell.sidebar-vnext .nav-group-label,
body[data-theme="dark"] .app-shell.sidebar-vnext .nav-group-label {
  padding: 0 12px 4px;
  font-size: 10px;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

html[data-theme="dark"] .app-shell.sidebar-vnext .nav-item,
body[data-theme="dark"] .app-shell.sidebar-vnext .nav-item {
  min-height: 40px;
  padding: 9px 12px;
  gap: 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--text-1);
  font-size: 14px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .nav-item:hover,
body[data-theme="dark"] .app-shell.sidebar-vnext .nav-item:hover {
  background: rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .app-shell.sidebar-vnext .nav-item.active,
body[data-theme="dark"] .app-shell.sidebar-vnext .nav-item.active {
  background: rgba(255, 255, 255, 0.055) !important;
  border-radius: 12px !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .nav-icon,
html[data-theme="dark"] .app-shell.sidebar-vnext .nav-item svg,
body[data-theme="dark"] .app-shell.sidebar-vnext .nav-icon,
body[data-theme="dark"] .app-shell.sidebar-vnext .nav-item svg {
  width: 15px;
  height: 15px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-bottom.sidebar-footer,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-bottom.sidebar-footer {
  margin-top: auto;
  padding-left: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile {
  position: relative;
  padding: 0 !important;
  gap: 12px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-main,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-avatar-button,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-avatar-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  flex: 0 0 auto;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-avatar,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-avatar {
  width: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-name,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-name {
  font-size: 14px !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-sub,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-sub {
  font-size: 11px !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-btn,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-btn {
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu {
  background: var(--layer-1);
  border: 1px solid var(--border-subtle);
  box-shadow: none;
  min-width: 260px;
  margin-bottom: 6px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item {
  font-size: 14px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar {
  width: var(--sidebar-vnext-collapsed-width);
  padding-inline: 0;
  gap: 12px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-topbar,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-topbar {
  grid-template-columns: 1fr;
  gap: 0;
  justify-items: center;
  padding-left: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-account-slot,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-account-slot,
html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-nav,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-nav,
html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-bottom.sidebar-footer,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-bottom.sidebar-footer {
  padding-left: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .nav-list,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .nav-list {
  gap: 14px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .nav-group + .nav-group,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .nav-group + .nav-group {
  padding-top: 12px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .nav-item,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .nav-item {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-profile,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-profile {
  display: grid;
  justify-items: center;
  gap: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-profile-main,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-profile-main {
  justify-content: center;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-profile-avatar-button,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-profile-avatar-button {
  width: 32px;
  height: 32px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-profile-menu-btn,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-profile-menu-btn {
  display: none !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__identity,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 6px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__avatar,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  flex: 0 0 auto;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__identity-copy,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__identity-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__identity-name,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__identity-name {
  color: var(--text-0);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__identity-email,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__identity-email {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__divider,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__divider {
  height: 1px;
  margin: 6px 2px;
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__section,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu__section {
  display: grid;
  gap: 2px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item__icon,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item__icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: inherit;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item__icon svg,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item__icon svg {
  width: 18px;
  height: 18px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item__label,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item__label {
  min-width: 0;
}
/* FIN BLOQUE: sidebar-runtime */

/* INICIO BLOQUE: floating-surfaces-runtime */
#modalRoot {
  position: relative;
  z-index: 12000;
  isolation: isolate;
}

html[data-theme="dark"] .modal-overlay,
body[data-theme="dark"] .modal-overlay {
  z-index: 12000 !important;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(6px) saturate(110%);
  -webkit-backdrop-filter: blur(6px) saturate(110%);
}

html[data-theme="dark"] .modal-card,
body[data-theme="dark"] .modal-card,
html[data-theme="dark"] .connections-account-modal,
body[data-theme="dark"] .connections-account-modal,
html[data-theme="dark"] .connection-wizard-modal,
body[data-theme="dark"] .connection-wizard-modal,
html[data-theme="dark"] .kmfx-mt5-modal,
body[data-theme="dark"] .kmfx-mt5-modal,
html[data-theme="dark"] .connections-account-card__menu,
body[data-theme="dark"] .connections-account-card__menu,
html[data-theme="dark"] .risk-select-menu,
body[data-theme="dark"] .risk-select-menu,
html[data-theme="dark"] .custom-select-dropdown,
body[data-theme="dark"] .custom-select-dropdown,
html[data-theme="dark"] .bnav-more-menu,
body[data-theme="dark"] .bnav-more-menu,
html[data-theme="dark"] .sidebar-profile-menu,
body[data-theme="dark"] .sidebar-profile-menu {
  background: rgba(20, 20, 20, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.055);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px) saturate(118%);
  -webkit-backdrop-filter: blur(12px) saturate(118%);
}

html[data-theme="dark"] .modal-card,
body[data-theme="dark"] .modal-card,
html[data-theme="dark"] .connections-account-modal,
body[data-theme="dark"] .connections-account-modal,
html[data-theme="dark"] .connection-wizard-modal,
body[data-theme="dark"] .connection-wizard-modal {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.105) !important;
  border-radius: 24px !important;
  background: #111111 !important;
  box-shadow: 0 24px 80px rgba(0,0,0,0.46) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .modal-head,
body[data-theme="dark"] .modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px 24px !important;
  border-bottom: 1px solid rgba(255,255,255,0.115);
  background: #1c1c1e;
}

html[data-theme="dark"] .modal-head > div,
body[data-theme="dark"] .modal-head > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

html[data-theme="dark"] .modal-title,
body[data-theme="dark"] .modal-title {
  color: var(--text-0);
  font-size: 28px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.045em;
}

html[data-theme="dark"] .modal-subtitle,
body[data-theme="dark"] .modal-subtitle {
  max-width: 58ch;
  color: rgba(255,255,255,0.62);
  font-size: 16px;
  line-height: 1.42;
  font-weight: 500;
}

html[data-theme="dark"] .modal-body,
body[data-theme="dark"] .modal-body {
  padding: 28px 32px 28px;
  background: #111111;
}

html[data-theme="dark"] .modal-actions,
body[data-theme="dark"] .modal-actions,
html[data-theme="dark"] .connections-account-modal__actions,
body[data-theme="dark"] .connections-account-modal__actions,
html[data-theme="dark"] .strategies-dialog__footer,
body[data-theme="dark"] .strategies-dialog__footer,
html[data-theme="dark"] .connection-wizard-modal .connection-wizard__actions,
body[data-theme="dark"] .connection-wizard-modal .connection-wizard__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-inline: -32px !important;
  margin-bottom: -28px !important;
  padding: 20px 32px 24px !important;
  border-top: 1px solid rgba(255,255,255,0.095) !important;
  background: #161616 !important;
}

html[data-theme="dark"] .modal-card:has(.strategies-dialog),
body[data-theme="dark"] .modal-card:has(.strategies-dialog) {
  display: flex;
  flex-direction: column;
  max-height: min(86vh, 740px);
}

html[data-theme="dark"] .modal-card:has(.strategies-dialog) .modal-body,
body[data-theme="dark"] .modal-card:has(.strategies-dialog) .modal-body {
  padding: 0 !important;
  background: var(--popover, #111111) !important;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

html[data-theme="dark"] .strategies-dialog__footer,
body[data-theme="dark"] .strategies-dialog__footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-inline: -30px !important;
  margin-bottom: 0 !important;
  padding: 16px 30px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  border-top: 1px solid color-mix(in srgb, var(--border) 82%, transparent) !important;
  background: color-mix(in srgb, var(--popover, #111111) 88%, var(--card, #171717)) !important;
}

html[data-theme="dark"] .topbar-time-stack,
body[data-theme="dark"] .topbar-time-stack {
  background: rgba(255, 255, 255, 0.022);
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .theme-toggle-badge,
body[data-theme="dark"] .theme-toggle-badge,
html[data-theme="dark"] .topbar-user-card,
body[data-theme="dark"] .topbar-user-card {
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px) saturate(115%);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
}

html[data-theme="dark"] .btn-secondary,
body[data-theme="dark"] .btn-secondary {
  background: rgba(255, 255, 255, 0.028);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

html[data-theme="dark"] .btn-secondary:hover,
body[data-theme="dark"] .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.11);
}

html[data-theme="dark"] .btn-secondary:active,
body[data-theme="dark"] .btn-secondary:active {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .btn-ghost,
body[data-theme="dark"] .btn-ghost {
  background: rgba(255, 255, 255, 0.012);
  border-color: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
}

html[data-theme="dark"] .btn-ghost:hover,
body[data-theme="dark"] .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.09);
  color: var(--text-0);
}

html[data-theme="dark"] .btn-ghost:active,
body[data-theme="dark"] .btn-ghost:active {
  background: rgba(255, 255, 255, 0.026);
}

html[data-theme="dark"] .modal-close,
body[data-theme="dark"] .modal-close,
html[data-theme="dark"] .sidebar-profile-menu-btn,
body[data-theme="dark"] .sidebar-profile-menu-btn,
html[data-theme="dark"] .connections-account-card__menu-trigger,
body[data-theme="dark"] .connections-account-card__menu-trigger {
  background: rgba(255, 255, 255, 0.018) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .modal-head .modal-close,
body[data-theme="dark"] .modal-head .modal-close {
  width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 16px;
  color: var(--text-0);
  font-size: 22px;
  line-height: 1;
}

html[data-theme="dark"] .modal-close:hover,
body[data-theme="dark"] .modal-close:hover,
html[data-theme="dark"] .sidebar-profile-menu-btn:hover,
body[data-theme="dark"] .sidebar-profile-menu-btn:hover,
html[data-theme="dark"] .connections-account-card__menu-trigger:hover,
body[data-theme="dark"] .connections-account-card__menu-trigger:hover {
  background: rgba(255, 255, 255, 0.035) !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
}

html[data-theme="dark"] .modal-overlay--focus-panel,
body[data-theme="dark"] .modal-overlay--focus-panel {
  z-index: 12010 !important;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  transition: opacity 120ms ease;
}

html[data-theme="dark"] .modal-overlay--focus-panel.open,
body[data-theme="dark"] .modal-overlay--focus-panel.open {
  opacity: 1;
}

html[data-theme="dark"] .modal-card--focus-panel,
body[data-theme="dark"] .modal-card--focus-panel {
  width: min(84vw, 1180px);
  max-width: min(84vw, 1180px) !important;
  max-height: min(86vh, 920px);
  display: block;
  overflow: hidden;
  background: #111111 !important;
  border: 1px solid rgba(255,255,255,0.105) !important;
  border-radius: 24px !important;
  box-shadow: 0 24px 80px rgba(0,0,0,0.46) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: scale(0.985);
  opacity: 0;
  transition: transform 120ms ease, opacity 120ms ease;
}

html[data-theme="dark"] .modal-overlay--focus-panel.open .modal-card--focus-panel,
body[data-theme="dark"] .modal-overlay--focus-panel.open .modal-card--focus-panel {
  transform: scale(1);
  opacity: 1;
}

html[data-theme="dark"] .modal-body--focus-panel,
body[data-theme="dark"] .modal-body--focus-panel {
  position: relative;
  box-sizing: border-box;
  min-height: 0;
  max-height: min(86vh, 920px);
  overflow: auto;
  margin-right: 6px;
  padding: 0 10px 0 0;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}

html[data-theme="dark"] .focus-panel,
body[data-theme="dark"] .focus-panel {
  display: grid;
  gap: 0;
}

html[data-theme="dark"] .focus-panel-close,
body[data-theme="dark"] .focus-panel-close {
  position: absolute;
  top: 28px;
  right: 32px;
}

html[data-theme="dark"] .focus-panel__header,
body[data-theme="dark"] .focus-panel__header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin: 0 -10px 0 0;
  padding: 28px 72px 24px 32px;
  background: #1c1c1e;
  border-bottom: 1px solid rgba(255,255,255,0.115);
}

html[data-theme="dark"] .focus-panel__metrics,
body[data-theme="dark"] .focus-panel__metrics,
html[data-theme="dark"] .focus-panel__content,
body[data-theme="dark"] .focus-panel__content {
  margin: 24px 24px 0 32px;
  padding-bottom: 32px;
}

html[data-theme="dark"] .focus-panel__identity,
body[data-theme="dark"] .focus-panel__identity {
  display: grid;
  gap: 6px;
}

html[data-theme="dark"] .focus-panel__title-row,
body[data-theme="dark"] .focus-panel__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

html[data-theme="dark"] .focus-panel__title,
body[data-theme="dark"] .focus-panel__title {
  margin: 0;
  font-size: 30px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

html[data-theme="dark"] .focus-panel__meta,
body[data-theme="dark"] .focus-panel__meta {
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.45;
}

html[data-theme="dark"] .focus-panel__status,
body[data-theme="dark"] .focus-panel__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-0);
  background: var(--layer-2);
  color: var(--text-1);
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-theme="dark"] .focus-panel__status--buy,
body[data-theme="dark"] .focus-panel__status--buy {
  color: color-mix(in srgb, var(--positive) 82%, white);
  border-color: color-mix(in srgb, var(--positive) 24%, var(--border-0));
}

html[data-theme="dark"] .focus-panel__status--sell,
body[data-theme="dark"] .focus-panel__status--sell {
  color: color-mix(in srgb, var(--negative) 82%, white);
  border-color: color-mix(in srgb, var(--negative) 24%, var(--border-0));
}

html[data-theme="dark"] .focus-panel__pnl,
body[data-theme="dark"] .focus-panel__pnl {
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

html[data-theme="dark"] .focus-panel__metrics,
body[data-theme="dark"] .focus-panel__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

html[data-theme="dark"] .focus-panel__metrics--inline,
body[data-theme="dark"] .focus-panel__metrics--inline {
  gap: 0;
  background: #232326;
  border: 1px solid #38383a;
  border-radius: 12px;
  overflow: hidden;
}

html[data-theme="dark"] .focus-panel-metric,
body[data-theme="dark"] .focus-panel-metric {
  display: grid;
  gap: 6px;
  padding: 14px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

html[data-theme="dark"] .focus-panel__metrics--inline .focus-panel-metric,
body[data-theme="dark"] .focus-panel__metrics--inline .focus-panel-metric {
  padding: 12px 14px;
  border-right: 1px solid #38383a;
}

html[data-theme="dark"] .focus-panel__metrics--inline .focus-panel-metric:last-child,
body[data-theme="dark"] .focus-panel__metrics--inline .focus-panel-metric:last-child {
  border-right: 0;
}

html[data-theme="dark"] .focus-panel-metric__label,
body[data-theme="dark"] .focus-panel-metric__label {
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[data-theme="dark"] .focus-panel-metric__value,
body[data-theme="dark"] .focus-panel-metric__value {
  color: var(--text-0);
  font-size: 16px;
  line-height: 1.15;
  font-weight: 650;
}

html[data-theme="dark"] .focus-panel__content,
body[data-theme="dark"] .focus-panel__content {
  display: grid;
  gap: 18px;
}

html[data-theme="dark"] .focus-panel-section,
body[data-theme="dark"] .focus-panel-section {
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] .focus-panel-section--lead,
body[data-theme="dark"] .focus-panel-section--lead {
  gap: 0;
}

html[data-theme="dark"] .focus-panel-read,
body[data-theme="dark"] .focus-panel-read {
  padding: 2px 0 0;
}

html[data-theme="dark"] .focus-panel-read__summary,
body[data-theme="dark"] .focus-panel-read__summary {
  margin: 0;
  max-width: 760px;
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
}

html[data-theme="dark"] .focus-panel-section__head,
body[data-theme="dark"] .focus-panel-section__head {
  display: grid;
  gap: 4px;
}

html[data-theme="dark"] .focus-panel-section__title,
body[data-theme="dark"] .focus-panel-section__title {
  color: var(--text-0);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 650;
}

html[data-theme="dark"] .focus-panel-section__subtitle,
body[data-theme="dark"] .focus-panel-section__subtitle {
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.45;
}

html[data-theme="dark"] .focus-panel-chart .kmfx-chart-shell,
body[data-theme="dark"] .focus-panel-chart .kmfx-chart-shell {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

html[data-theme="dark"] .focus-panel-chart,
body[data-theme="dark"] .focus-panel-chart {
  background: #232326;
  border: 1px solid #38383a;
  border-radius: 12px;
  padding: 10px 12px 8px;
}

html[data-theme="dark"] .focus-panel-fields,
body[data-theme="dark"] .focus-panel-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

html[data-theme="dark"] .focus-panel-fields--wide,
body[data-theme="dark"] .focus-panel-fields--wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[data-theme="dark"] .focus-panel-fields > div,
body[data-theme="dark"] .focus-panel-fields > div,
html[data-theme="dark"] .focus-panel-block,
body[data-theme="dark"] .focus-panel-block {
  display: grid;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

html[data-theme="dark"] .focus-panel-fields strong,
body[data-theme="dark"] .focus-panel-fields strong,
html[data-theme="dark"] .focus-panel-block__label,
body[data-theme="dark"] .focus-panel-block__label {
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[data-theme="dark"] .focus-panel-fields span,
body[data-theme="dark"] .focus-panel-fields span,
html[data-theme="dark"] .focus-panel-block__value,
body[data-theme="dark"] .focus-panel-block__value {
  color: var(--text-0);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 500;
}

html[data-theme="dark"] .focus-panel-blocks,
body[data-theme="dark"] .focus-panel-blocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

html[data-theme="dark"] .focus-panel-pairs,
body[data-theme="dark"] .focus-panel-pairs {
  display: grid;
  gap: 0;
  background: #232326;
  border: 1px solid #38383a;
  border-radius: 12px;
  overflow: hidden;
}

html[data-theme="dark"] .focus-panel-pairs--plain,
body[data-theme="dark"] .focus-panel-pairs--plain {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

html[data-theme="dark"] .focus-panel-pair-row,
body[data-theme="dark"] .focus-panel-pair-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 120px minmax(0, 1fr);
  gap: 12px 16px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #38383a;
}

html[data-theme="dark"] .focus-panel-pairs--plain .focus-panel-pair-row,
body[data-theme="dark"] .focus-panel-pairs--plain .focus-panel-pair-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .focus-panel-pair-row:last-child,
body[data-theme="dark"] .focus-panel-pair-row:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] .focus-panel-pair-row strong,
body[data-theme="dark"] .focus-panel-pair-row strong {
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[data-theme="dark"] .focus-panel-pair-row span,
body[data-theme="dark"] .focus-panel-pair-row span {
  color: var(--text-0);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
}

html[data-theme="dark"] .focus-panel-disclosures,
body[data-theme="dark"] .focus-panel-disclosures {
  display: grid;
  gap: 0;
  background: #232326;
  border: 1px solid #38383a;
  border-radius: 12px;
  overflow: hidden;
}

html[data-theme="dark"] .focus-panel-disclosure,
body[data-theme="dark"] .focus-panel-disclosure {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #38383a;
  border-radius: 0;
  overflow: visible;
}

html[data-theme="dark"] .focus-panel-disclosure:last-child,
body[data-theme="dark"] .focus-panel-disclosure:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] .focus-panel-disclosure summary,
body[data-theme="dark"] .focus-panel-disclosure summary {
  list-style: none;
}

html[data-theme="dark"] .focus-panel-disclosure summary::-webkit-details-marker,
body[data-theme="dark"] .focus-panel-disclosure summary::-webkit-details-marker {
  display: none;
}

html[data-theme="dark"] .focus-panel-disclosure__summary,
body[data-theme="dark"] .focus-panel-disclosure__summary {
  display: block;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 120ms ease;
}

html[data-theme="dark"] .focus-panel-disclosure__summary:hover,
body[data-theme="dark"] .focus-panel-disclosure__summary:hover {
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .focus-panel-disclosure--primary,
body[data-theme="dark"] .focus-panel-disclosure--primary {
  background: rgba(255, 255, 255, 0.015);
}

html[data-theme="dark"] .focus-panel-disclosure--primary .focus-panel-disclosure__summary,
body[data-theme="dark"] .focus-panel-disclosure--primary .focus-panel-disclosure__summary {
  background: rgba(255, 255, 255, 0.018);
}

html[data-theme="dark"] .focus-panel-trades-head,
body[data-theme="dark"] .focus-panel-trades-head {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr 0.9fr 0.8fr;
  gap: 12px;
  padding: 0 16px 10px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[data-theme="dark"] .focus-panel-trades-head span:last-child,
body[data-theme="dark"] .focus-panel-trades-head span:last-child {
  text-align: right;
}

html[data-theme="dark"] .focus-panel-disclosure__grid,
body[data-theme="dark"] .focus-panel-disclosure__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr 0.9fr 0.8fr;
  gap: 12px;
  align-items: center;
}

html[data-theme="dark"] .focus-panel-disclosure__cell,
body[data-theme="dark"] .focus-panel-disclosure__cell {
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
}

html[data-theme="dark"] .focus-panel-disclosure__cell--symbol strong,
body[data-theme="dark"] .focus-panel-disclosure__cell--symbol strong {
  color: var(--text-0);
  font-size: 15px;
  line-height: 1.2;
}

html[data-theme="dark"] .focus-panel-disclosure__note,
body[data-theme="dark"] .focus-panel-disclosure__note {
  display: block;
  margin-top: 4px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-theme="dark"] .focus-panel-disclosure__cell--value,
body[data-theme="dark"] .focus-panel-disclosure__cell--value {
  text-align: right;
  font-size: 15px;
  line-height: 1.1;
  font-weight: 650;
  white-space: nowrap;
}

html[data-theme="dark"] .focus-panel-disclosure__body,
body[data-theme="dark"] .focus-panel-disclosure__body {
  padding: 0 16px 8px;
}

html[data-theme="dark"] .focus-panel-executions,
body[data-theme="dark"] .focus-panel-executions {
  display: grid;
  gap: 0;
  margin-top: 10px;
  background: #232326;
  border: 1px solid #38383a;
  border-radius: 12px;
  overflow: hidden;
}

html[data-theme="dark"] .focus-panel-executions__head,
body[data-theme="dark"] .focus-panel-executions__head {
  display: grid;
  grid-template-columns: 0.9fr 0.7fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid #38383a;
}

html[data-theme="dark"] .focus-panel-executions__head span:last-child,
body[data-theme="dark"] .focus-panel-executions__head span:last-child,
html[data-theme="dark"] .focus-panel-execution span:last-child,
body[data-theme="dark"] .focus-panel-execution span:last-child {
  text-align: right;
}

html[data-theme="dark"] .focus-panel-execution,
body[data-theme="dark"] .focus-panel-execution {
  display: grid;
  grid-template-columns: 0.9fr 0.7fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 11px 16px;
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.35;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .focus-panel-execution:last-child,
body[data-theme="dark"] .focus-panel-execution:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] .focus-panel-trade-side,
body[data-theme="dark"] .focus-panel-trade-side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-0);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-1);
}

html[data-theme="dark"] .focus-panel-trade-side--buy,
body[data-theme="dark"] .focus-panel-trade-side--buy {
  color: color-mix(in srgb, var(--positive) 82%, white);
  border-color: color-mix(in srgb, var(--positive) 24%, var(--border-0));
}

html[data-theme="dark"] .focus-panel-trade-side--sell,
body[data-theme="dark"] .focus-panel-trade-side--sell {
  color: color-mix(in srgb, var(--negative) 82%, white);
  border-color: color-mix(in srgb, var(--negative) 24%, var(--border-0));
}

/* --------------------------------------------------------------------------
   Operaciones — Trade Focus Report
-------------------------------------------------------------------------- */

html[data-theme="dark"] .trades-focus-report,
body[data-theme="dark"] .trades-focus-report {
  display: grid;
  gap: 0;
}

html[data-theme="dark"] .modal-card--focus-panel:has(.trades-focus-report),
body[data-theme="dark"] .modal-card--focus-panel:has(.trades-focus-report) {
  width: min(76vw, 980px);
  max-height: min(76vh, 780px);
  background: var(--popover);
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report),
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) {
  margin-right: 0;
  padding-right: 0;
  scrollbar-gutter: auto;
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel-close,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel-close {
  top: 16px;
  right: 20px;
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__header,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__header {
  gap: 16px;
  margin: 0;
  padding: 13px 58px 11px 26px;
  background: var(--popover);
  border-bottom-color: color-mix(in srgb, var(--border) 78%, transparent);
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__identity,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__identity {
  gap: 4px;
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__title,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__title {
  font-size: clamp(19px, 1.75vw, 23px);
  line-height: 1.08;
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__meta,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__meta {
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.3;
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__status,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__status {
  min-height: 24px;
  padding: 0 10px;
  font-size: 11px;
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__pnl,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__pnl {
  padding-top: 1px;
  font-size: clamp(21px, 1.9vw, 25px);
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__content,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-focus-report) .focus-panel__content {
  margin: 0 26px;
  padding-bottom: 18px;
}

html[data-theme="dark"] .trades-focus-report,
body[data-theme="dark"] .trades-focus-report,
html[data-theme="dark"] .trades-focus-stats,
body[data-theme="dark"] .trades-focus-stats,
html[data-theme="dark"] .trades-focus-section,
body[data-theme="dark"] .trades-focus-section,
html[data-theme="dark"] .trades-focus-truth,
body[data-theme="dark"] .trades-focus-truth,
html[data-theme="dark"] .trades-focus-kv,
body[data-theme="dark"] .trades-focus-kv,
html[data-theme="dark"] .trades-focus-report .focus-panel-executions,
body[data-theme="dark"] .trades-focus-report .focus-panel-executions,
html[data-theme="dark"] .trades-focus-next-step,
body[data-theme="dark"] .trades-focus-next-step {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
}

html[data-theme="dark"] .trades-focus-section,
body[data-theme="dark"] .trades-focus-section {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .trades-focus-section:first-child,
body[data-theme="dark"] .trades-focus-section:first-child {
  padding-top: 0;
  border-top: 0;
}

html[data-theme="dark"] .trades-focus-section--truth,
body[data-theme="dark"] .trades-focus-section--truth {
  padding: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .trades-focus-truth,
body[data-theme="dark"] .trades-focus-truth {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--border) 56%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in srgb, var(--foreground) 3.2%, transparent);
}

html[data-theme="dark"] .trades-focus-truth[data-tone="success"],
body[data-theme="dark"] .trades-focus-truth[data-tone="success"] {
  border-color: color-mix(in srgb, var(--profit) 24%, var(--border-0));
}

html[data-theme="dark"] .trades-focus-truth[data-tone="warning"],
body[data-theme="dark"] .trades-focus-truth[data-tone="warning"] {
  border-color: color-mix(in srgb, var(--warning, #f59e0b) 24%, var(--border-0));
}

html[data-theme="dark"] .trades-focus-truth[data-tone="danger"],
body[data-theme="dark"] .trades-focus-truth[data-tone="danger"] {
  border-color: color-mix(in srgb, var(--loss) 28%, var(--border-0));
}

html[data-theme="dark"] .trades-focus-truth__main,
body[data-theme="dark"] .trades-focus-truth__main {
  display: grid;
  gap: 4px;
}

html[data-theme="dark"] .trades-focus-truth__title-row,
body[data-theme="dark"] .trades-focus-truth__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

html[data-theme="dark"] .trades-focus-truth__title,
body[data-theme="dark"] .trades-focus-truth__title {
  color: var(--foreground, var(--text-0));
  font-size: 14px;
  line-height: 1.2;
  font-weight: 760;
}

html[data-theme="dark"] .trades-focus-truth[data-tone="success"] .trades-focus-truth__title,
body[data-theme="dark"] .trades-focus-truth[data-tone="success"] .trades-focus-truth__title {
  color: color-mix(in srgb, var(--profit) 84%, white);
}

html[data-theme="dark"] .trades-focus-truth[data-tone="warning"] .trades-focus-truth__title,
body[data-theme="dark"] .trades-focus-truth[data-tone="warning"] .trades-focus-truth__title {
  color: color-mix(in srgb, var(--warning, #f59e0b) 80%, white);
}

html[data-theme="dark"] .trades-focus-truth[data-tone="danger"] .trades-focus-truth__title,
body[data-theme="dark"] .trades-focus-truth[data-tone="danger"] .trades-focus-truth__title {
  color: color-mix(in srgb, var(--loss) 84%, white);
}

html[data-theme="dark"] .trades-focus-truth__action,
body[data-theme="dark"] .trades-focus-truth__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
  color: var(--foreground, var(--text-0));
  font-size: 10.5px;
  line-height: 1.2;
  font-family: inherit;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

html[data-theme="dark"] .trades-focus-truth__action:hover,
body[data-theme="dark"] .trades-focus-truth__action:hover {
  border-color: color-mix(in srgb, var(--foreground) 18%, var(--border-0));
  background: color-mix(in srgb, var(--foreground) 8%, transparent);
}

html[data-theme="dark"] .trades-focus-truth__action:focus-visible,
body[data-theme="dark"] .trades-focus-truth__action:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

html[data-theme="dark"] .trades-focus-truth[data-tone="success"] .trades-focus-truth__action,
body[data-theme="dark"] .trades-focus-truth[data-tone="success"] .trades-focus-truth__action {
  border-color: color-mix(in srgb, var(--profit) 28%, var(--border-0));
  color: color-mix(in srgb, var(--profit) 86%, white);
}

html[data-theme="dark"] .trades-focus-truth[data-tone="warning"] .trades-focus-truth__action,
body[data-theme="dark"] .trades-focus-truth[data-tone="warning"] .trades-focus-truth__action {
  border-color: color-mix(in srgb, var(--warning, #f59e0b) 30%, var(--border-0));
  color: color-mix(in srgb, var(--warning, #f59e0b) 84%, white);
}

html[data-theme="dark"] .trades-focus-truth[data-tone="danger"] .trades-focus-truth__action,
body[data-theme="dark"] .trades-focus-truth[data-tone="danger"] .trades-focus-truth__action {
  border-color: color-mix(in srgb, var(--loss) 30%, var(--border-0));
  color: color-mix(in srgb, var(--loss) 84%, white);
}

html[data-theme="dark"] .trades-focus-truth__description,
body[data-theme="dark"] .trades-focus-truth__description {
  margin: 0;
  color: var(--muted-foreground, var(--text-2));
  font-size: 11.5px;
  line-height: 1.35;
}

html[data-theme="dark"] .trades-focus-truth__summary,
body[data-theme="dark"] .trades-focus-truth__summary {
  margin: 0;
  max-width: 860px;
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.42;
  font-weight: 560;
}

html[data-theme="dark"] .trades-focus-rule-list,
body[data-theme="dark"] .trades-focus-rule-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

html[data-theme="dark"] .trades-focus-rule-pill,
body[data-theme="dark"] .trades-focus-rule-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--loss) 28%, var(--border-0));
  border-radius: 999px;
  color: color-mix(in srgb, var(--loss) 82%, white);
  background: color-mix(in srgb, var(--loss) 8%, transparent);
  font-size: 11px;
  line-height: 1;
  font-weight: 650;
}

html[data-theme="dark"] .trades-focus-truth__context,
body[data-theme="dark"] .trades-focus-truth__context {
  display: grid;
  gap: 6px;
  padding-top: 7px;
  border-top: 1px solid var(--border-0);
}

html[data-theme="dark"] .trades-focus-truth__context-item,
body[data-theme="dark"] .trades-focus-truth__context-item {
  display: grid;
  gap: 3px;
}

html[data-theme="dark"] .trades-focus-truth__context-item span,
body[data-theme="dark"] .trades-focus-truth__context-item span {
  color: var(--muted-foreground, var(--text-2));
  font-size: 10px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme="dark"] .trades-focus-truth__context-item p,
body[data-theme="dark"] .trades-focus-truth__context-item p {
  margin: 0;
  color: var(--foreground, var(--text-0));
  font-size: 12px;
  line-height: 1.35;
  font-weight: 540;
}

html[data-theme="dark"] .trades-focus-section__head,
body[data-theme="dark"] .trades-focus-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

html[data-theme="dark"] .trades-focus-section__eyebrow,
body[data-theme="dark"] .trades-focus-section__eyebrow,
html[data-theme="dark"] .trades-focus-context__label,
body[data-theme="dark"] .trades-focus-context__label,
html[data-theme="dark"] .trades-focus-stats__label,
body[data-theme="dark"] .trades-focus-stats__label,
html[data-theme="dark"] .trades-focus-kv__label,
body[data-theme="dark"] .trades-focus-kv__label,
html[data-theme="dark"] .trades-focus-next-step__label,
body[data-theme="dark"] .trades-focus-next-step__label {
  color: var(--muted-foreground, var(--text-2));
  font-size: 11px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme="dark"] .trades-focus-section__title,
body[data-theme="dark"] .trades-focus-section__title {
  margin-top: 3px;
  color: var(--foreground, var(--text-0));
  font-size: 15px;
  line-height: 1.2;
  font-weight: 720;
}

html[data-theme="dark"] .trades-focus-stats__label,
body[data-theme="dark"] .trades-focus-stats__label {
  font-size: 9px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: 0.15em;
}

html[data-theme="dark"] .trades-focus-section__description,
body[data-theme="dark"] .trades-focus-section__description {
  margin: 0;
  max-width: 360px;
  color: var(--muted-foreground, var(--text-2));
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

html[data-theme="dark"] .trades-focus-context,
body[data-theme="dark"] .trades-focus-context {
  display: grid;
  grid-template-columns: 0.8fr minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 6px;
}

html[data-theme="dark"] .trades-focus-context__item,
body[data-theme="dark"] .trades-focus-context__item {
  display: grid;
  gap: 4px;
}

html[data-theme="dark"] .trades-focus-context__value,
body[data-theme="dark"] .trades-focus-context__value,
html[data-theme="dark"] .trades-focus-kv__value,
body[data-theme="dark"] .trades-focus-kv__value {
  color: var(--foreground, var(--text-0));
  font-size: 14px;
  line-height: 1.3;
  font-weight: 560;
}

html[data-theme="dark"] .trades-focus-report__summary,
body[data-theme="dark"] .trades-focus-report__summary {
  margin: 0;
  max-width: 820px;
  color: var(--foreground, var(--text-0));
  font-size: 13.5px;
  line-height: 1.38;
  font-weight: 560;
}

html[data-theme="dark"] .trades-focus-stats,
body[data-theme="dark"] .trades-focus-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}

html[data-theme="dark"] .trades-focus-stats__item,
body[data-theme="dark"] .trades-focus-stats__item {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 54px;
  padding: 9px 16px;
  border-right: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .trades-focus-stats__item:last-child,
body[data-theme="dark"] .trades-focus-stats__item:last-child {
  border-right: 0;
}

html[data-theme="dark"] .trades-focus-stats__value,
body[data-theme="dark"] .trades-focus-stats__value {
  color: var(--foreground, var(--text-0));
  font-size: 17px;
  line-height: 1.05;
  font-weight: 740;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .trades-focus-kv,
body[data-theme="dark"] .trades-focus-kv {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border-0);
}

html[data-theme="dark"] .trades-focus-kv__item,
body[data-theme="dark"] .trades-focus-kv__item {
  display: grid;
  gap: 4px;
  padding: 8px 12px;
  border-right: 1px solid var(--border-0);
  border-bottom: 1px solid var(--border-0);
}

html[data-theme="dark"] .trades-focus-kv__item:nth-child(4n),
body[data-theme="dark"] .trades-focus-kv__item:nth-child(4n) {
  border-right: 0;
}

html[data-theme="dark"] .trades-focus-kv__item:last-child,
body[data-theme="dark"] .trades-focus-kv__item:last-child {
  border-right: 0;
}

html[data-theme="dark"] .trades-focus-report .focus-panel-executions,
body[data-theme="dark"] .trades-focus-report .focus-panel-executions {
  margin-top: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

html[data-theme="dark"] .trades-focus-report .focus-panel-executions__head,
body[data-theme="dark"] .trades-focus-report .focus-panel-executions__head {
  padding: 0 0 6px;
  border-bottom-color: color-mix(in srgb, var(--border) 56%, transparent);
}

html[data-theme="dark"] .trades-focus-report .focus-panel-execution,
body[data-theme="dark"] .trades-focus-report .focus-panel-execution {
  padding: 7px 0;
  border-bottom-color: color-mix(in srgb, var(--border) 48%, transparent);
}

html[data-theme="dark"] .trades-focus-next-step,
body[data-theme="dark"] .trades-focus-next-step {
  display: grid;
  gap: 5px;
  padding: 10px 0 0;
  border: 0;
  background: transparent;
}

html[data-theme="dark"] .trades-focus-next-step p,
body[data-theme="dark"] .trades-focus-next-step p {
  margin: 0;
  color: var(--foreground, var(--text-0));
  font-size: 13px;
  line-height: 1.4;
  font-weight: 560;
}

@media (max-width: 760px) {
  html[data-theme="dark"] .trades-focus-section__head,
  body[data-theme="dark"] .trades-focus-section__head {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  html[data-theme="dark"] .trades-focus-section__description,
  body[data-theme="dark"] .trades-focus-section__description {
    max-width: none;
    text-align: left;
  }

  html[data-theme="dark"] .trades-focus-truth__title-row,
  body[data-theme="dark"] .trades-focus-truth__title-row {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }

  html[data-theme="dark"] .trades-focus-truth__action,
  body[data-theme="dark"] .trades-focus-truth__action {
    white-space: normal;
  }

  html[data-theme="dark"] .trades-focus-context,
  body[data-theme="dark"] .trades-focus-context,
  html[data-theme="dark"] .trades-focus-stats,
  body[data-theme="dark"] .trades-focus-stats,
  html[data-theme="dark"] .trades-focus-kv,
  body[data-theme="dark"] .trades-focus-kv {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .trades-focus-stats__item,
  body[data-theme="dark"] .trades-focus-stats__item,
  html[data-theme="dark"] .trades-focus-kv__item,
  body[data-theme="dark"] .trades-focus-kv__item {
    border-right: 0;
  }

  html[data-theme="dark"] .trades-focus-stats__item:not(:last-child),
  body[data-theme="dark"] .trades-focus-stats__item:not(:last-child) {
    border-bottom: 1px solid var(--border-0);
  }
}

/* --------------------------------------------------------------------------
   Calendario — Day Focus Report
-------------------------------------------------------------------------- */

html[data-theme="dark"] .calendar-day-panel .modal-body--focus-panel,
body[data-theme="dark"] .calendar-day-panel .modal-body--focus-panel {
  max-height: min(76vh, 780px);
  margin-right: 0;
  padding-right: 0;
  scrollbar-gutter: auto;
}

html[data-theme="dark"] .calendar-day-panel,
body[data-theme="dark"] .calendar-day-panel {
  width: min(76vw, 980px);
  max-height: min(76vh, 780px);
  background: var(--popover);
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-close,
body[data-theme="dark"] .calendar-day-panel .focus-panel-close {
  top: 16px;
  right: 20px;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel__header,
body[data-theme="dark"] .calendar-day-panel .focus-panel__header {
  margin: 0;
  padding: 13px 58px 11px 26px;
  background: var(--popover);
  border-bottom-color: color-mix(in srgb, var(--border) 78%, transparent);
}

html[data-theme="dark"] .calendar-day-panel .focus-panel__title,
body[data-theme="dark"] .calendar-day-panel .focus-panel__title {
  font-size: clamp(19px, 1.75vw, 23px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel__meta,
body[data-theme="dark"] .calendar-day-panel .focus-panel__meta {
  color: var(--muted-foreground);
  font-size: 11px;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel__pnl,
body[data-theme="dark"] .calendar-day-panel .focus-panel__pnl {
  padding-top: 1px;
  font-size: clamp(21px, 1.9vw, 25px);
}

html[data-theme="dark"] .calendar-day-panel .focus-panel__metrics,
body[data-theme="dark"] .calendar-day-panel .focus-panel__metrics {
  margin: 0 24px;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel__metrics--inline,
body[data-theme="dark"] .calendar-day-panel .focus-panel__metrics--inline {
  align-items: stretch;
  grid-auto-rows: minmax(42px, max-content);
  background: transparent;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: 0;
  overflow: visible;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel__metrics--inline .focus-panel-metric,
body[data-theme="dark"] .calendar-day-panel .focus-panel__metrics--inline .focus-panel-metric {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 42px;
  padding: 5px 14px 6px;
  border-right-color: color-mix(in srgb, var(--border) 62%, transparent);
  line-height: 1;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-metric__label,
body[data-theme="dark"] .calendar-day-panel .focus-panel-metric__label {
  color: var(--muted-foreground);
  font-size: 8.5px;
  line-height: 1;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-metric__value,
body[data-theme="dark"] .calendar-day-panel .focus-panel-metric__value {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-metric__value .kmfx-ui-pnl,
body[data-theme="dark"] .calendar-day-panel .focus-panel-metric__value .kmfx-ui-pnl {
  line-height: 1;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel__content,
body[data-theme="dark"] .calendar-day-panel .focus-panel__content {
  margin: 0 26px;
  padding-bottom: 18px;
}

html[data-theme="dark"] .calendar-day-report,
body[data-theme="dark"] .calendar-day-report {
  display: grid;
  gap: 0;
}

/* --------------------------------------------------------------------------
   Calendar — Day Focus Stat Bar
-------------------------------------------------------------------------- */

html[data-theme="dark"] .calendar-day-stat-bar,
body[data-theme="dark"] .calendar-day-stat-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}

html[data-theme="dark"] .calendar-day-stat-bar__item,
body[data-theme="dark"] .calendar-day-stat-bar__item {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 54px;
  padding: 9px 16px;
  border-right: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .calendar-day-stat-bar__item:last-child,
body[data-theme="dark"] .calendar-day-stat-bar__item:last-child {
  border-right: 0;
}

html[data-theme="dark"] .calendar-day-stat-bar__label,
body[data-theme="dark"] .calendar-day-stat-bar__label {
  color: var(--muted-foreground);
  font-size: 9px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

html[data-theme="dark"] .calendar-day-stat-bar__value,
body[data-theme="dark"] .calendar-day-stat-bar__value {
  color: var(--foreground);
  font-size: 17px;
  line-height: 1.05;
  font-weight: 740;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .calendar-day-stat-bar__value .kmfx-ui-pnl,
body[data-theme="dark"] .calendar-day-stat-bar__value .kmfx-ui-pnl {
  line-height: 1;
}

html[data-theme="dark"] .calendar-day-stat-bar__meta,
body[data-theme="dark"] .calendar-day-stat-bar__meta {
  overflow: hidden;
  color: color-mix(in srgb, var(--muted-foreground) 86%, transparent);
  font-size: 10.5px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  html[data-theme="dark"] .calendar-day-stat-bar,
  body[data-theme="dark"] .calendar-day-stat-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .calendar-day-stat-bar__item,
  body[data-theme="dark"] .calendar-day-stat-bar__item {
    border-bottom: 1px solid color-mix(in srgb, var(--border) 52%, transparent);
  }

  html[data-theme="dark"] .calendar-day-stat-bar__item:nth-child(2n),
  body[data-theme="dark"] .calendar-day-stat-bar__item:nth-child(2n) {
    border-right: 0;
  }

  html[data-theme="dark"] .calendar-day-stat-bar__item:nth-last-child(-n + 2),
  body[data-theme="dark"] .calendar-day-stat-bar__item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

html[data-theme="dark"] .calendar-day-report__read-card,
body[data-theme="dark"] .calendar-day-report__read-card,
html[data-theme="dark"] .calendar-day-trades__list,
body[data-theme="dark"] .calendar-day-trades__list {
  background: transparent;
  border: 0;
  border-radius: 0;
}

html[data-theme="dark"] .calendar-day-report__read-card,
body[data-theme="dark"] .calendar-day-report__read-card {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 11px 13px;
  background: color-mix(in srgb, var(--foreground) 3.2%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 56%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
  border-radius: calc(var(--radius) + 4px);
}

html[data-theme="dark"] .calendar-day-report__eyebrow,
body[data-theme="dark"] .calendar-day-report__eyebrow {
  color: var(--muted-foreground);
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-read__summary,
body[data-theme="dark"] .calendar-day-panel .focus-panel-read__summary {
  max-width: 860px;
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.42;
  font-weight: 560;
}

html[data-theme="dark"] .calendar-day-report__action,
body[data-theme="dark"] .calendar-day-report__action {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.4;
}

html[data-theme="dark"] .calendar-day-report__section-head,
body[data-theme="dark"] .calendar-day-report__section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-section__title,
body[data-theme="dark"] .calendar-day-panel .focus-panel-section__title {
  font-size: 14px;
  line-height: 1.15;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-section__subtitle,
body[data-theme="dark"] .calendar-day-panel .focus-panel-section__subtitle {
  font-size: 11.5px;
  line-height: 1.32;
}

html[data-theme="dark"] .calendar-day-report__chart-section,
body[data-theme="dark"] .calendar-day-report__chart-section,
html[data-theme="dark"] .calendar-day-trades,
body[data-theme="dark"] .calendar-day-trades {
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .calendar-day-trades,
body[data-theme="dark"] .calendar-day-trades {
  border-bottom: 0;
  padding-bottom: 0;
}

html[data-theme="dark"] .calendar-day-report__chart,
body[data-theme="dark"] .calendar-day-report__chart {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

html[data-theme="dark"] .calendar-day-report__chart .kmfx-chart-shell,
body[data-theme="dark"] .calendar-day-report__chart .kmfx-chart-shell {
  min-height: 124px;
  padding: 2px 0 0;
}

html[data-theme="dark"] .calendar-day-trades__head,
body[data-theme="dark"] .calendar-day-trades__head {
  padding: 0 0 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 56%, transparent);
}

html[data-theme="dark"] .calendar-day-trades__list,
body[data-theme="dark"] .calendar-day-trades__list {
  overflow: visible;
  padding-bottom: 10px;
}

html[data-theme="dark"] .calendar-day-trades__item,
body[data-theme="dark"] .calendar-day-trades__item {
  border-bottom-color: color-mix(in srgb, var(--border) 48%, transparent);
}

html[data-theme="dark"] .calendar-day-trades__item--primary,
body[data-theme="dark"] .calendar-day-trades__item--primary {
  background: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure--primary .focus-panel-disclosure__summary,
body[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure--primary .focus-panel-disclosure__summary {
  background: transparent;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure__summary,
body[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure__summary {
  padding: 7px 0;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure__summary:hover,
body[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure__summary:hover {
  background: color-mix(in srgb, var(--foreground) 2.5%, transparent);
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure__body,
body[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure__body {
  padding: 0 0 9px;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-pairs--plain .focus-panel-pair-row,
body[data-theme="dark"] .calendar-day-panel .focus-panel-pairs--plain .focus-panel-pair-row {
  grid-template-columns: minmax(82px, 0.34fr) minmax(0, 1fr) minmax(82px, 0.34fr) minmax(0, 1fr);
  gap: 6px 12px;
  padding: 4px 0;
  border-bottom-color: color-mix(in srgb, var(--border) 42%, transparent);
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-pair-row strong,
body[data-theme="dark"] .calendar-day-panel .focus-panel-pair-row strong {
  color: color-mix(in srgb, var(--muted-foreground) 86%, transparent);
  font-size: 10px;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-pair-row span,
body[data-theme="dark"] .calendar-day-panel .focus-panel-pair-row span {
  font-size: 13px;
  color: color-mix(in srgb, var(--foreground) 88%, var(--muted-foreground));
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure[open] .focus-panel-disclosure__summary,
body[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure[open] .focus-panel-disclosure__summary {
  background: color-mix(in srgb, var(--foreground) 2.5%, transparent);
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure__cell,
body[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure__cell {
  font-size: 12.5px;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure__cell--symbol strong,
body[data-theme="dark"] .calendar-day-panel .focus-panel-disclosure__cell--symbol strong {
  font-size: 13px;
}

html[data-theme="dark"] .calendar-day-panel .calendar-day-primary-trade,
body[data-theme="dark"] .calendar-day-panel .calendar-day-primary-trade {
  display: block;
  margin-top: 4px;
  color: color-mix(in srgb, var(--muted-foreground) 72%, var(--foreground));
  font-size: 10px;
  line-height: 1.1;
  font-weight: 620;
  font-style: normal;
  letter-spacing: 0.02em;
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-executions,
body[data-theme="dark"] .calendar-day-panel .focus-panel-executions {
  background: color-mix(in srgb, var(--popover) 88%, var(--muted) 12%);
  border-color: color-mix(in srgb, var(--border) 78%, transparent);
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-executions__head,
body[data-theme="dark"] .calendar-day-panel .focus-panel-executions__head {
  padding: 8px 12px;
  border-bottom-color: color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .calendar-day-panel .focus-panel-execution,
body[data-theme="dark"] .calendar-day-panel .focus-panel-execution {
  padding: 9px 12px;
  font-size: 13px;
  border-bottom-color: color-mix(in srgb, var(--border) 42%, transparent);
}

@media (max-width: 980px) {
  html[data-theme="dark"] .modal-card--focus-panel,
  body[data-theme="dark"] .modal-card--focus-panel {
    width: min(92vw, 1180px);
    max-width: min(92vw, 1180px) !important;
  }

  html[data-theme="dark"] .focus-panel__header,
  body[data-theme="dark"] .focus-panel__header {
    flex-direction: column;
    align-items: flex-start;
    top: 0;
    margin: 0 -10px 0 0;
    padding: 24px 64px 18px 24px;
  }

  html[data-theme="dark"] .focus-panel__pnl,
  body[data-theme="dark"] .focus-panel__pnl {
    text-align: left;
  }

  html[data-theme="dark"] .focus-panel__metrics,
  body[data-theme="dark"] .focus-panel__metrics,
  html[data-theme="dark"] .focus-panel-fields,
  body[data-theme="dark"] .focus-panel-fields,
  html[data-theme="dark"] .focus-panel-blocks,
  body[data-theme="dark"] .focus-panel-blocks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .focus-panel-pair-row,
  body[data-theme="dark"] .focus-panel-pair-row {
    grid-template-columns: 110px minmax(0, 1fr) 110px minmax(0, 1fr);
  }

  html[data-theme="dark"] .focus-panel-trades-head,
  body[data-theme="dark"] .focus-panel-trades-head {
    display: none;
  }

  html[data-theme="dark"] .focus-panel-disclosure__grid,
  body[data-theme="dark"] .focus-panel-disclosure__grid {
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
  }

  html[data-theme="dark"] .focus-panel-disclosure__cell:nth-child(2),
  body[data-theme="dark"] .focus-panel-disclosure__cell:nth-child(2),
  html[data-theme="dark"] .focus-panel-disclosure__cell:nth-child(3),
  body[data-theme="dark"] .focus-panel-disclosure__cell:nth-child(3),
  html[data-theme="dark"] .focus-panel-disclosure__cell:nth-child(4),
  body[data-theme="dark"] .focus-panel-disclosure__cell:nth-child(4) {
    color: var(--text-2);
    font-size: 12px;
  }

  html[data-theme="dark"] .focus-panel-executions__head,
  body[data-theme="dark"] .focus-panel-executions__head,
  html[data-theme="dark"] .focus-panel-execution,
  body[data-theme="dark"] .focus-panel-execution {
    grid-template-columns: 0.9fr 0.7fr 1fr 1fr 1fr;
  }
}

@media (max-width: 640px) {
  html[data-theme="dark"] .modal-body--focus-panel,
  body[data-theme="dark"] .modal-body--focus-panel {
    padding: 0 8px 0 0;
  }

  html[data-theme="dark"] .focus-panel__header,
  body[data-theme="dark"] .focus-panel__header {
    top: 0;
    margin: 0 -8px 0 0;
    padding: 20px 56px 16px 20px;
  }

  html[data-theme="dark"] .focus-panel__metrics,
  body[data-theme="dark"] .focus-panel__metrics,
  html[data-theme="dark"] .focus-panel__content,
  body[data-theme="dark"] .focus-panel__content {
    margin: 20px 20px 0;
  }

  html[data-theme="dark"] .focus-panel__metrics,
  body[data-theme="dark"] .focus-panel__metrics,
  html[data-theme="dark"] .focus-panel-fields,
  body[data-theme="dark"] .focus-panel-fields,
  html[data-theme="dark"] .focus-panel-fields--wide,
  body[data-theme="dark"] .focus-panel-fields--wide,
  html[data-theme="dark"] .focus-panel-blocks,
  body[data-theme="dark"] .focus-panel-blocks {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .focus-panel__metrics--inline,
  body[data-theme="dark"] .focus-panel__metrics--inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

html[data-theme="dark"] .focus-panel__metrics--inline .focus-panel-metric,
body[data-theme="dark"] .focus-panel__metrics--inline .focus-panel-metric {
  border-right: 0;
  border-bottom: 1px solid #38383a;
}

  html[data-theme="dark"] .focus-panel__metrics--inline .focus-panel-metric:nth-last-child(-n + 2),
  body[data-theme="dark"] .focus-panel__metrics--inline .focus-panel-metric:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  html[data-theme="dark"] .focus-panel-pair-row,
  body[data-theme="dark"] .focus-panel-pair-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  html[data-theme="dark"] .focus-panel-executions__head,
  body[data-theme="dark"] .focus-panel-executions__head {
    display: none;
  }

  html[data-theme="dark"] .focus-panel-execution,
  body[data-theme="dark"] .focus-panel-execution {
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
  }
}
/* FIN BLOQUE: floating-surfaces-runtime */

/* --------------------------------------------------------------------------
   Operaciones — Open Position Focus Panel Final Alignment
-------------------------------------------------------------------------- */
html[data-theme="dark"] .modal-card--focus-panel:has(.trades-position-focus),
body[data-theme="dark"] .modal-card--focus-panel:has(.trades-position-focus) {
  width: min(92vw, 720px);
  max-width: min(92vw, 720px);
  max-height: min(76vh, 760px);
  background: var(--popover);
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus),
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) {
  margin-right: 0;
  padding-right: 0;
  scrollbar-gutter: auto;
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel-close,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel-close {
  top: 16px;
  right: 20px;
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__header,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__header {
  gap: 16px;
  margin: 0;
  padding: 13px 58px 11px 26px;
  background: var(--popover);
  border-bottom-color: color-mix(in srgb, var(--border) 78%, transparent);
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__identity,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__identity {
  gap: 4px;
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__title,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__title {
  font-size: clamp(19px, 1.75vw, 23px);
  line-height: 1.08;
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__meta,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__meta {
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.3;
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__status,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__status {
  min-height: 24px;
  padding: 0 10px;
  font-size: 11px;
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__pnl,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__pnl {
  padding-top: 1px;
  font-size: clamp(21px, 1.9vw, 25px);
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__content,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__content {
  box-sizing: border-box;
  width: 100%;
  margin: 0 26px;
  padding: 0 0 18px;
}

html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .trades-position-focus,
body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .trades-position-focus {
  box-sizing: border-box;
  width: 100%;
  padding: 0;
}

html[data-theme="dark"] .trades-position-focus,
body[data-theme="dark"] .trades-position-focus,
html[data-theme="dark"] .trades-position-focus__head,
body[data-theme="dark"] .trades-position-focus__head,
html[data-theme="dark"] .trades-position-state,
body[data-theme="dark"] .trades-position-state,
html[data-theme="dark"] .trades-position-risk,
body[data-theme="dark"] .trades-position-risk,
html[data-theme="dark"] .trades-position-risk__grid,
body[data-theme="dark"] .trades-position-risk__grid,
html[data-theme="dark"] .trades-position-kv,
body[data-theme="dark"] .trades-position-kv {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
}

html[data-theme="dark"] .trades-position-focus__head,
body[data-theme="dark"] .trades-position-focus__head {
  align-items: center;
  gap: 14px;
  padding: 11px 0 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .trades-position-focus__eyebrow,
body[data-theme="dark"] .trades-position-focus__eyebrow,
html[data-theme="dark"] .trades-position-focus__section-eyebrow,
body[data-theme="dark"] .trades-position-focus__section-eyebrow,
html[data-theme="dark"] .trades-position-state__label,
body[data-theme="dark"] .trades-position-state__label,
html[data-theme="dark"] .trades-position-risk__label,
body[data-theme="dark"] .trades-position-risk__label,
html[data-theme="dark"] .trades-position-kv__label,
body[data-theme="dark"] .trades-position-kv__label {
  color: var(--muted-foreground);
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 680;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

html[data-theme="dark"] .trades-position-focus__title,
body[data-theme="dark"] .trades-position-focus__title {
  margin-top: 3px;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 720;
}

html[data-theme="dark"] .trades-position-focus__description,
body[data-theme="dark"] .trades-position-focus__description {
  max-width: 300px;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.35;
}

html[data-theme="dark"] .trades-position-state,
body[data-theme="dark"] .trades-position-state {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}

html[data-theme="dark"] .trades-position-state__item,
body[data-theme="dark"] .trades-position-state__item {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 54px;
  min-width: 0;
  padding: 9px 14px;
  border-right: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .trades-position-state__item:last-child,
body[data-theme="dark"] .trades-position-state__item:last-child {
  border-right: 0;
}

html[data-theme="dark"] .trades-position-state__value,
body[data-theme="dark"] .trades-position-state__value,
html[data-theme="dark"] .trades-position-risk__value,
body[data-theme="dark"] .trades-position-risk__value,
html[data-theme="dark"] .trades-position-kv__value,
body[data-theme="dark"] .trades-position-kv__value {
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.22;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .trades-position-state__item[data-tone="profit"] .trades-position-state__value,
body[data-theme="dark"] .trades-position-state__item[data-tone="profit"] .trades-position-state__value {
  color: var(--profit);
}

html[data-theme="dark"] .trades-position-state__item[data-tone="loss"] .trades-position-state__value,
body[data-theme="dark"] .trades-position-state__item[data-tone="loss"] .trades-position-state__value {
  color: var(--loss);
}

html[data-theme="dark"] .trades-position-focus__section,
body[data-theme="dark"] .trades-position-focus__section {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
}

html[data-theme="dark"] .trades-position-focus__section:last-child,
body[data-theme="dark"] .trades-position-focus__section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

html[data-theme="dark"] .trades-position-focus__section-head,
body[data-theme="dark"] .trades-position-focus__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

html[data-theme="dark"] .trades-position-focus__section-title,
body[data-theme="dark"] .trades-position-focus__section-title {
  margin: 3px 0 0;
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 720;
}

html[data-theme="dark"] .trades-position-risk__badge,
body[data-theme="dark"] .trades-position-risk__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--warning, #f59e0b) 24%, var(--border-0));
  border-radius: 999px;
  color: color-mix(in srgb, var(--warning, #f59e0b) 82%, white);
  background: color-mix(in srgb, var(--warning, #f59e0b) 7%, transparent);
  font-size: 10.5px;
  line-height: 1;
  font-weight: 680;
  letter-spacing: 0.04em;
}

html[data-theme="dark"] .trades-position-risk__grid,
body[data-theme="dark"] .trades-position-risk__grid,
html[data-theme="dark"] .trades-position-kv,
body[data-theme="dark"] .trades-position-kv {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border-0);
}

html[data-theme="dark"] .trades-position-risk__item,
body[data-theme="dark"] .trades-position-risk__item,
html[data-theme="dark"] .trades-position-kv__item,
body[data-theme="dark"] .trades-position-kv__item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 12px;
  border-right: 1px solid var(--border-0);
  border-bottom: 1px solid var(--border-0);
}

html[data-theme="dark"] .trades-position-risk__item:nth-child(4n),
body[data-theme="dark"] .trades-position-risk__item:nth-child(4n),
html[data-theme="dark"] .trades-position-kv__item:nth-child(4n),
body[data-theme="dark"] .trades-position-kv__item:nth-child(4n) {
  border-right: 0;
}

html[data-theme="dark"] .trades-position-risk__note,
body[data-theme="dark"] .trades-position-risk__note {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__header,
  body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__header {
    align-items: flex-start;
    flex-direction: column;
    padding-right: 50px;
  }

  html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__pnl,
  body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__pnl {
    text-align: left;
  }

  html[data-theme="dark"] .trades-position-focus__head,
  body[data-theme="dark"] .trades-position-focus__head,
  html[data-theme="dark"] .trades-position-focus__section-head,
  body[data-theme="dark"] .trades-position-focus__section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  html[data-theme="dark"] .trades-position-focus__description,
  body[data-theme="dark"] .trades-position-focus__description {
    max-width: none;
    text-align: left;
  }

  html[data-theme="dark"] .trades-position-state,
  body[data-theme="dark"] .trades-position-state,
  html[data-theme="dark"] .trades-position-risk__grid,
  body[data-theme="dark"] .trades-position-risk__grid,
  html[data-theme="dark"] .trades-position-kv,
  body[data-theme="dark"] .trades-position-kv {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] .trades-position-state__item:nth-child(2n),
  body[data-theme="dark"] .trades-position-state__item:nth-child(2n),
  html[data-theme="dark"] .trades-position-risk__item:nth-child(2n),
  body[data-theme="dark"] .trades-position-risk__item:nth-child(2n),
  html[data-theme="dark"] .trades-position-kv__item:nth-child(2n),
  body[data-theme="dark"] .trades-position-kv__item:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 520px) {
  html[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__content,
  body[data-theme="dark"] .modal-body--focus-panel:has(.trades-position-focus) .focus-panel__content {
    margin: 0 18px;
  }

  html[data-theme="dark"] .trades-position-state,
  body[data-theme="dark"] .trades-position-state,
  html[data-theme="dark"] .trades-position-risk__grid,
  body[data-theme="dark"] .trades-position-risk__grid,
  html[data-theme="dark"] .trades-position-kv,
  body[data-theme="dark"] .trades-position-kv {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .trades-position-state__item,
  body[data-theme="dark"] .trades-position-state__item,
  html[data-theme="dark"] .trades-position-risk__item,
  body[data-theme="dark"] .trades-position-risk__item,
  html[data-theme="dark"] .trades-position-kv__item,
  body[data-theme="dark"] .trades-position-kv__item {
    border-right: 0;
  }
}

/* INICIO BLOQUE: topbar-date-cleanup */
html[data-theme="dark"] .content-sticky-header,
body[data-theme="dark"] .content-sticky-header,
html[data-theme="dark"] .content-sticky-header__meta,
body[data-theme="dark"] .content-sticky-header__meta,
html[data-theme="dark"] .content-sticky-header .topbar-time-stack,
body[data-theme="dark"] .content-sticky-header .topbar-time-stack,
html[data-theme="dark"] .topbar-time-stack,
body[data-theme="dark"] .topbar-time-stack {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .content-sticky-header::before,
body[data-theme="dark"] .content-sticky-header::before,
html[data-theme="dark"] .content-sticky-header::after,
body[data-theme="dark"] .content-sticky-header::after,
html[data-theme="dark"] .topbar-time-stack::before,
body[data-theme="dark"] .topbar-time-stack::before,
html[data-theme="dark"] .topbar-time-stack::after,
body[data-theme="dark"] .topbar-time-stack::after {
  content: none !important;
  display: none !important;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* FIN BLOQUE: topbar-date-cleanup */

/* INICIO BLOQUE: unified-menu-glass */
html[data-theme="dark"] .risk-select-menu,
body[data-theme="dark"] .risk-select-menu,
html[data-theme="dark"] .custom-select-dropdown,
body[data-theme="dark"] .custom-select-dropdown,
html[data-theme="dark"] .bnav-more-menu,
body[data-theme="dark"] .bnav-more-menu,
html[data-theme="dark"] .sidebar-profile-menu,
body[data-theme="dark"] .sidebar-profile-menu,
html[data-theme="dark"] .connections-account-card__menu,
body[data-theme="dark"] .connections-account-card__menu {
  padding: 8px !important;
  border-radius: 16px !important;
  background: rgba(24, 24, 28, 0.84) !important;
  border: 1px solid rgba(255, 255, 255, 0.065) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16) !important;
  backdrop-filter: blur(18px) saturate(128%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(128%) !important;
}

html[data-theme="dark"] .sidebar-profile-menu-item,
body[data-theme="dark"] .sidebar-profile-menu-item,
html[data-theme="dark"] .custom-select-option,
body[data-theme="dark"] .custom-select-option,
html[data-theme="dark"] .connections-account-card__menu-item,
body[data-theme="dark"] .connections-account-card__menu-item {
  min-height: 44px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  color: var(--text-0) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  background: transparent !important;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease !important;
}

html[data-theme="dark"] .sidebar-profile-menu-item:hover,
body[data-theme="dark"] .sidebar-profile-menu-item:hover,
html[data-theme="dark"] .sidebar-profile-menu-item:focus-visible,
body[data-theme="dark"] .sidebar-profile-menu-item:focus-visible,
html[data-theme="dark"] .custom-select-option:hover,
body[data-theme="dark"] .custom-select-option:hover,
html[data-theme="dark"] .custom-select-option:focus-visible,
body[data-theme="dark"] .custom-select-option:focus-visible,
html[data-theme="dark"] .connections-account-card__menu-item:hover:not(:disabled),
body[data-theme="dark"] .connections-account-card__menu-item:hover:not(:disabled),
html[data-theme="dark"] .connections-account-card__menu-item:focus-visible,
body[data-theme="dark"] .connections-account-card__menu-item:focus-visible,
html[data-theme="dark"] .bnav-more-item:hover,
body[data-theme="dark"] .bnav-more-item:hover,
html[data-theme="dark"] .bnav-more-item:focus-visible,
body[data-theme="dark"] .bnav-more-item:focus-visible,
html[data-theme="dark"] .bnav-more-top-item:hover,
body[data-theme="dark"] .bnav-more-top-item:hover,
html[data-theme="dark"] .bnav-more-top-item:focus-visible,
body[data-theme="dark"] .bnav-more-top-item:focus-visible {
  background: color-mix(in srgb, var(--accent) 82%, transparent) !important;
  color: #ffffff !important;
  outline: none !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item:hover,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item:hover,
html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item:focus-visible,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item:focus-visible {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-0) !important;
}

html[data-theme="dark"] .custom-select-option.is-selected,
body[data-theme="dark"] .custom-select-option.is-selected,
html[data-theme="dark"] .custom-select-option[aria-selected="true"],
body[data-theme="dark"] .custom-select-option[aria-selected="true"],
html[data-theme="dark"] .risk-session-row.checked,
body[data-theme="dark"] .risk-session-row.checked,
html[data-theme="dark"] .bnav-more-item.active,
body[data-theme="dark"] .bnav-more-item.active,
html[data-theme="dark"] .bnav-more-top-item.active,
body[data-theme="dark"] .bnav-more-top-item.active {
  background: color-mix(in srgb, var(--accent) 82%, transparent) !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .risk-session-row.checked .risk-session-name,
body[data-theme="dark"] .risk-session-row.checked .risk-session-name,
html[data-theme="dark"] .risk-session-row.checked .risk-session-utc,
body[data-theme="dark"] .risk-session-row.checked .risk-session-utc,
html[data-theme="dark"] .custom-select-option.is-selected,
body[data-theme="dark"] .custom-select-option.is-selected,
html[data-theme="dark"] .custom-select-option[aria-selected="true"],
body[data-theme="dark"] .custom-select-option[aria-selected="true"] {
  color: #ffffff !important;
}

html[data-theme="dark"] .sidebar-profile-menu-item.danger,
body[data-theme="dark"] .sidebar-profile-menu-item.danger,
html[data-theme="dark"] .connections-account-card__menu-item--danger,
body[data-theme="dark"] .connections-account-card__menu-item--danger {
  color: color-mix(in srgb, var(--negative) 90%, #ffffff 10%) !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item.danger,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item.danger {
  color: color-mix(in srgb, var(--negative) 88%, #ffffff 12%) !important;
}

html[data-theme="dark"] .sidebar-profile-menu-item.danger:hover,
body[data-theme="dark"] .sidebar-profile-menu-item.danger:hover,
html[data-theme="dark"] .sidebar-profile-menu-item.danger:focus-visible,
body[data-theme="dark"] .sidebar-profile-menu-item.danger:focus-visible,
html[data-theme="dark"] .connections-account-card__menu-item--danger:hover:not(:disabled),
body[data-theme="dark"] .connections-account-card__menu-item--danger:hover:not(:disabled),
html[data-theme="dark"] .connections-account-card__menu-item--danger:focus-visible,
body[data-theme="dark"] .connections-account-card__menu-item--danger:focus-visible {
  color: #ffffff !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item.danger:hover,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item.danger:hover,
html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item.danger:focus-visible,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-profile-menu-item.danger:focus-visible {
  background: rgba(255, 255, 255, 0.04) !important;
  color: color-mix(in srgb, var(--negative) 92%, #ffffff 8%) !important;
}
/* FIN BLOQUE: unified-menu-glass */

/* INICIO BLOQUE: connections-account-menu-compact */
html[data-theme="dark"] .connections-account-card__menu,
body[data-theme="dark"] .connections-account-card__menu {
  top: calc(100% + 6px);
  min-width: 148px !important;
  width: max-content;
  max-width: min(184px, calc(100vw - 32px));
  padding: 5px !important;
  gap: 3px;
  border-radius: 11px !important;
  background: rgba(20, 20, 23, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.075) !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18) !important;
}

html[data-theme="dark"] .connections-account-card__menu-item,
body[data-theme="dark"] .connections-account-card__menu-item {
  min-height: 32px !important;
  padding: 0 9px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  line-height: 1.1;
  font-weight: 560 !important;
}

html[data-theme="dark"] .connections-account-card__menu-item:hover:not(:disabled),
body[data-theme="dark"] .connections-account-card__menu-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.055) !important;
  color: var(--text-0) !important;
}

html[data-theme="dark"] .connections-account-card__menu-item:focus-visible,
body[data-theme="dark"] .connections-account-card__menu-item:focus-visible {
  background: rgba(10, 132, 255, 0.14) !important;
  color: var(--text-0) !important;
  outline: 1px solid rgba(10, 132, 255, 0.48) !important;
  outline-offset: 1px;
}

html[data-theme="dark"] .connections-account-card__menu-item--danger,
body[data-theme="dark"] .connections-account-card__menu-item--danger {
  color: color-mix(in srgb, var(--negative) 88%, #ffffff 12%) !important;
}

html[data-theme="dark"] .connections-account-card__menu-item--danger:hover:not(:disabled),
body[data-theme="dark"] .connections-account-card__menu-item--danger:hover:not(:disabled),
html[data-theme="dark"] .connections-account-card__menu-item--danger:focus-visible,
body[data-theme="dark"] .connections-account-card__menu-item--danger:focus-visible {
  background: rgba(255, 69, 58, 0.1) !important;
  color: color-mix(in srgb, var(--negative) 92%, #ffffff 8%) !important;
}
/* FIN BLOQUE: connections-account-menu-compact */

/* Shell tonal finish — controlled base refinement only */
html,
html[data-theme="dark"],
body,
html[data-theme="dark"] body,
body[data-theme="dark"],
.app-shell,
html[data-theme="dark"] .app-shell,
body[data-theme="dark"] .app-shell,
.main-panel,
html[data-theme="dark"] .main-panel,
body[data-theme="dark"] .main-panel,
[data-theme="dark"] .main-panel,
.content,
html[data-theme="dark"] .content,
body[data-theme="dark"] .content,
[data-theme="dark"] .content,
.topbar,
html[data-theme="dark"] .topbar,
body[data-theme="dark"] .topbar {
  background: #111111 !important;
  background-color: #111111 !important;
  background-image: none !important;
}

.sidebar,
html[data-theme="dark"] .sidebar,
body[data-theme="dark"] .sidebar,
html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar {
  background: #111111 !important;
  background-color: #111111 !important;
  background-image: none !important;
  border-right: 0 !important;
}

.app-shell.sidebar-vnext .sidebar-vnext-divider__line,
html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-vnext-divider__line,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-vnext-divider__line {
  background: rgba(255, 255, 255, 0.08) !important;
  width: 1px !important;
}

.app-shell.sidebar-vnext .sidebar-vnext-divider:hover .sidebar-vnext-divider__line,
html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-vnext-divider:hover .sidebar-vnext-divider__line,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-vnext-divider:hover .sidebar-vnext-divider__line {
  background: rgba(255, 255, 255, 0.14) !important;
  width: 1px !important;
}

.main-panel,
html[data-theme="dark"] .main-panel,
body[data-theme="dark"] .main-panel,
[data-theme="dark"] .main-panel {
  padding-bottom: 0 !important;
}

.content,
html[data-theme="dark"] .content,
body[data-theme="dark"] .content,
[data-theme="dark"] .content {
  padding-bottom: 0 !important;
}

/* Sidebar refinement — shadcn structure / Apple HIG visual discipline */
html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider {
  --sidebar-vnext-current-width: var(--sidebar-vnext-expanded-width);
  display: grid;
  grid-template-columns: var(--sidebar-vnext-current-width) minmax(0, 1fr);
  column-gap: 0;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: stretch;
  position: relative;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed {
  --sidebar-vnext-current-width: var(--sidebar-vnext-collapsed-width);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar.sidebar-panel,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: visible;
  background: #111111 !important;
  width: auto;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  padding: 16px 14px 8px 0;
  position: sticky;
  top: 0;
  align-self: start;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-section,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-section {
  min-width: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-header.sidebar-section--header,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-header.sidebar-section--header {
  flex: 0 0 auto;
  display: grid;
  gap: 16px;
  padding: 0 14px 18px 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-topbar,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-topbar {
  min-height: 40px;
  padding-left: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-account-slot,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-account-slot {
  padding-left: 0;
  padding-right: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-account-switcher__icon,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-account-switcher__icon {
  background: rgba(255, 255, 255, 0.028);
  border-color: rgba(255, 255, 255, 0.065);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-account-switcher__copy,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-account-switcher__copy {
  gap: 4px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-content.sidebar-section--content,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-content.sidebar-section--content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-nav,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 10px 0 0;
  scrollbar-width: none;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-nav::-webkit-scrollbar,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-nav::-webkit-scrollbar {
  display: none;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-list,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-list {
  display: grid;
  gap: 20px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group {
  display: grid;
  gap: 6px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group + .nav-group,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group + .nav-group {
  padding-top: 0;
  border-top: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group-trigger,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 10px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.36);
  text-align: left;
  cursor: pointer;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group-trigger:hover,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group-trigger:hover {
  color: rgba(255, 255, 255, 0.54);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group-label,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group-label {
  padding: 0;
  font-size: 10px;
  line-height: 1.1;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.34);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group-chevron,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group-chevron {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group.is-open .nav-group-chevron,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group.is-open .nav-group-chevron {
  transform: rotate(180deg);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group-items,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group-items {
  display: grid;
  gap: 4px;
  overflow: hidden;
  padding-top: 3px;
  max-height: 520px;
  opacity: 1;
  transition: max-height 0.2s ease, opacity 0.16s ease, transform 0.16s ease;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group.is-collapsed .nav-group-items,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-group.is-collapsed .nav-group-items {
  max-height: 0;
  opacity: 0;
  transform: translateY(-2px);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-item,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-item {
  min-height: 42px;
  padding: 10px 10px;
  gap: 12px;
  border-radius: 11px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-item:hover,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-item:hover {
  background: rgba(255, 255, 255, 0.032);
  color: #ffffff;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-item.active,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-item.active {
  background: rgba(255, 255, 255, 0.052) !important;
  border-radius: 11px !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-icon,
html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-item svg,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-icon,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .nav-item svg {
  opacity: 0.74;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-bottom.sidebar-footer.sidebar-section--footer,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-bottom.sidebar-footer.sidebar-section--footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 10px 10px 2px 0;
  border-top: 0;
  overflow: visible;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile {
  position: relative;
  display: grid;
  padding: 0 !important;
  gap: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile:hover,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile:hover {
  background: transparent !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-trigger,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.024);
  color: var(--text-0);
  text-align: left;
  cursor: pointer;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-trigger:hover,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-trigger:hover {
  background: rgba(255, 255, 255, 0.036);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-trigger:focus-visible,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 72%, white);
  outline-offset: 2px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-main,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-main {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-avatar,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-avatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 11px !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-copy,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-name,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-name {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text-0);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-sub,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-sub {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu-btn,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.72);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu {
  position: fixed;
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  width: min(280px, calc(100vw - 32px));
  min-width: 224px;
  max-width: min(320px, calc(100vw - 32px));
  max-height: min(320px, calc(100vh - 32px));
  overflow: auto;
  z-index: 20000;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(0.985);
  transform-origin: bottom center;
  background: #1a1a1c !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  padding: 6px !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: opacity 140ms ease, transform 140ms ease;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu.is-open,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu[data-side="bottom"],
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu[data-side="bottom"] {
  transform-origin: top center;
  transform: translateY(-4px) scale(0.985);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu[data-side="right"],
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu[data-side="right"] {
  transform-origin: left bottom;
  transform: translateX(-4px) scale(0.985);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu[data-side="left"],
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu[data-side="left"] {
  transform-origin: right bottom;
  transform: translateX(4px) scale(0.985);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu__section,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu__section {
  gap: 4px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu__section--danger,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-profile-menu__section--danger {
  padding-top: 2px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar.sidebar-panel,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar.sidebar-panel {
  gap: 0;
  padding: 16px 0 8px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-nav,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-nav {
  padding: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .nav-list,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .nav-list {
  gap: 16px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .nav-group-trigger,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .nav-group-trigger,
html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .nav-group-items,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .nav-group-items {
  padding-inline: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .nav-group-trigger,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .nav-group-trigger {
  display: none;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .nav-group,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .nav-group {
  gap: 6px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-header.sidebar-section--header,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-header.sidebar-section--header {
  padding: 0 0 14px;
  justify-items: center;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-account-slot,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-account-slot {
  display: grid;
  place-items: center;
  padding: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-account-switcher,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-account-switcher,
html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-account-switcher--empty,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-account-switcher--empty {
  display: inline-grid !important;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
  padding: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-account-switcher__copy,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-account-switcher__copy {
  display: none !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-account-switcher__icon,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-account-switcher__icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .nav-group.is-collapsed .nav-group-items,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .nav-group.is-collapsed .nav-group-items {
  max-height: none;
  opacity: 1;
  transform: none;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-bottom.sidebar-footer.sidebar-section--footer,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-bottom.sidebar-footer.sidebar-section--footer {
  padding: 10px 0 2px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-profile,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-profile {
  justify-items: center;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-profile-trigger,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-profile-trigger {
  width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
  grid-template-columns: 1fr;
  justify-items: center;
  background: transparent;
  border: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-profile-main,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-profile-main {
  grid-template-columns: 1fr;
  gap: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-profile-copy,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-profile-copy,
html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-profile-menu-btn,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-profile-menu-btn {
  display: none;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-profile-menu,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider.sidebar-vnext-collapsed .sidebar-profile-menu {
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .main-panel.sidebar-inset,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .main-panel.sidebar-inset {
  min-width: 0;
  margin-left: 0 !important;
  padding: 0 20px 0 36px !important;
  background: #111111 !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .content,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-left: 0;
  padding-right: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .page.active,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .page.active {
  flex: 0 0 auto;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-vnext-divider.sidebar-rail,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-vnext-divider.sidebar-rail {
  top: 18px;
  bottom: 18px;
  left: calc(var(--sidebar-vnext-current-width) + 8px);
  width: 14px;
  z-index: 60;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-vnext-divider__line,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-vnext-divider__line {
  background: rgba(255, 255, 255, 0.038) !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-vnext-divider:hover .sidebar-vnext-divider__line,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .sidebar-vnext-divider:hover .sidebar-vnext-divider__line {
  background: rgba(255, 255, 255, 0.1) !important;
}


/* KMFX brand mark: compact app lockup with optical wordmark */
.app-shell.sidebar-vnext {
  --sidebar-brand-slot-size: 44px;
  --sidebar-brand-expanded-width: 178px;
  --sidebar-brand-mark-width: 54px;
  --sidebar-brand-mark-height: 42px;
  --sidebar-brand-collapsed-size: 32px;
  --sidebar-brand-wordmark-gap: 10px;
}

.app-shell.sidebar-vnext .sidebar-topbar {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: var(--sidebar-brand-slot-size);
  align-items: center;
}

.app-shell.sidebar-vnext .brand-lockup--adaptive {
  width: var(--sidebar-brand-expanded-width);
  max-width: var(--sidebar-brand-expanded-width);
  height: var(--sidebar-brand-slot-size);
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--sidebar-brand-wordmark-gap);
  overflow: hidden;
}

.app-shell.sidebar-vnext .sidebar-brand-logo {
  display: block;
  flex: 0 0 auto;
  width: var(--sidebar-brand-mark-width);
  max-width: var(--sidebar-brand-mark-width);
  height: var(--sidebar-brand-mark-height);
  object-fit: contain;
}

.app-shell.sidebar-vnext .sidebar-brand-logo--expanded {
  height: var(--sidebar-brand-mark-height);
}

.app-shell.sidebar-vnext .sidebar-brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
  font-family: "Geist", Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
  transform: translateY(1px);
}

.app-shell.sidebar-vnext .sidebar-brand-wordmark__kmfx {
  color: var(--text-0);
  font-weight: 800;
}

.app-shell.sidebar-vnext .sidebar-brand-wordmark__edge {
  color: rgba(141, 151, 166, 0.96);
  font-weight: 650;
}

.app-shell.sidebar-vnext .sidebar-brand-logo--collapsed {
  display: none;
  width: var(--sidebar-brand-collapsed-size);
  height: var(--sidebar-brand-collapsed-size);
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .brand-lockup--adaptive {
  width: var(--sidebar-brand-slot-size);
  height: var(--sidebar-brand-slot-size);
  max-width: none;
  min-height: var(--sidebar-brand-slot-size);
  display: grid;
  place-items: center;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-brand-logo--expanded {
  display: none !important;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-brand-wordmark {
  display: none;
}

.app-shell.sidebar-vnext.sidebar-vnext-collapsed .sidebar-brand-logo--collapsed {
  display: block;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-topbar,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-topbar {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: var(--sidebar-brand-slot-size);
  padding-left: 12px;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .brand-lockup--adaptive,
body[data-theme="dark"] .app-shell.sidebar-vnext .brand-lockup--adaptive {
  width: var(--sidebar-brand-expanded-width);
  max-width: var(--sidebar-brand-expanded-width);
  height: var(--sidebar-brand-slot-size);
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--sidebar-brand-wordmark-gap);
  margin: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-brand-logo--expanded,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-brand-logo--expanded {
  width: var(--sidebar-brand-mark-width);
  height: var(--sidebar-brand-mark-height);
  max-width: var(--sidebar-brand-mark-width);
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-brand-wordmark__edge,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-brand-wordmark__edge {
  color: rgba(151, 160, 173, 0.95);
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .brand-lockup--adaptive,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-vnext-collapsed .brand-lockup--adaptive {
  width: var(--sidebar-brand-slot-size);
  height: var(--sidebar-brand-slot-size);
  display: grid;
  place-items: center;
  max-width: none;
  min-height: var(--sidebar-brand-slot-size);
  background: transparent;
  border: 0;
  border-radius: 0;
}

html[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-brand-logo--collapsed,
body[data-theme="dark"] .app-shell.sidebar-vnext .sidebar-brand-logo--collapsed {
  width: var(--sidebar-brand-collapsed-size);
  height: var(--sidebar-brand-collapsed-size);
}

/* === DISCIPLINE SECTION === */
html[data-theme="dark"] #section-discipline.discipline-page-stack,
body[data-theme="dark"] #section-discipline.discipline-page-stack {
  display: grid;
  gap: 24px;
}

html[data-theme="dark"] #section-discipline .execution-hero,
body[data-theme="dark"] #section-discipline .execution-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.46fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 0;
  padding: 24px;
  border: 1px solid var(--border-0);
  border-radius: 16px;
  background: var(--layer-1);
}

html[data-theme="dark"] #section-discipline .execution-hero__copy,
body[data-theme="dark"] #section-discipline .execution-hero__copy,
html[data-theme="dark"] #section-discipline .execution-hero__issue,
body[data-theme="dark"] #section-discipline .execution-hero__issue {
  display: grid;
  align-content: center;
  gap: 8px;
}

html[data-theme="dark"] #section-discipline .execution-hero__eyebrow,
body[data-theme="dark"] #section-discipline .execution-hero__eyebrow,
html[data-theme="dark"] #section-discipline .execution-hero__issue span,
body[data-theme="dark"] #section-discipline .execution-hero__issue span,
html[data-theme="dark"] #section-discipline .execution-entry-pattern span,
body[data-theme="dark"] #section-discipline .execution-entry-pattern span {
  margin: 0;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-hero h3,
body[data-theme="dark"] #section-discipline .execution-hero h3 {
  margin: 0;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .execution-hero p,
body[data-theme="dark"] #section-discipline .execution-hero p,
html[data-theme="dark"] #section-discipline .execution-entry-pattern p,
body[data-theme="dark"] #section-discipline .execution-entry-pattern p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-hero__issue,
body[data-theme="dark"] #section-discipline .execution-hero__issue {
  padding: 18px;
  border: 1px solid var(--border-0);
  border-radius: 16px;
  background: var(--layer-1);
}

html[data-theme="dark"] #section-discipline .execution-hero__issue strong,
body[data-theme="dark"] #section-discipline .execution-hero__issue strong {
  font-size: 20px;
  line-height: 1.15;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .execution-score-row,
body[data-theme="dark"] #section-discipline .execution-score-row {
  display: grid;
  gap: 18px;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid,
body[data-theme="dark"] #section-discipline .execution-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

html[data-theme="dark"] #section-discipline .execution-kpi,
body[data-theme="dark"] #section-discipline .execution-kpi {
  min-height: 150px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  border-radius: 16px;
  background: var(--layer-1) !important;
  border: 1px solid var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi p,
body[data-theme="dark"] #section-discipline .execution-kpi p {
  margin: 0;
  font-size: 12px;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-kpi span,
body[data-theme="dark"] #section-discipline .execution-kpi span {
  width: fit-content;
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.028);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.065em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-kpi.execution-tone-ok,
body[data-theme="dark"] #section-discipline .execution-kpi.execution-tone-ok {
  border-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi.execution-tone-warn,
body[data-theme="dark"] #section-discipline .execution-kpi.execution-tone-warn {
  border-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi.execution-tone-bad,
body[data-theme="dark"] #section-discipline .execution-kpi.execution-tone-bad {
  border-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi.execution-tone-ok span,
body[data-theme="dark"] #section-discipline .execution-kpi.execution-tone-ok span {
  color: color-mix(in srgb, var(--positive) 78%, var(--text-1));
}

html[data-theme="dark"] #section-discipline .execution-kpi.execution-tone-warn span,
body[data-theme="dark"] #section-discipline .execution-kpi.execution-tone-warn span {
  color: color-mix(in srgb, var(--warning) 84%, var(--text-1));
}

html[data-theme="dark"] #section-discipline .execution-kpi.execution-tone-bad span,
body[data-theme="dark"] #section-discipline .execution-kpi.execution-tone-bad span {
  color: rgba(255,92,92,0.55);
}

html[data-theme="dark"] #section-discipline .execution-main-grid,
body[data-theme="dark"] #section-discipline .execution-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  gap: 24px;
  align-items: stretch;
}

html[data-theme="dark"] #section-discipline .execution-main-grid--lower,
body[data-theme="dark"] #section-discipline .execution-main-grid--lower {
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.74fr);
}

html[data-theme="dark"] #section-discipline .execution-main-grid--lower > .execution-entry-panel,
body[data-theme="dark"] #section-discipline .execution-main-grid--lower > .execution-entry-panel {
  grid-column: 1 / -1;
}

html[data-theme="dark"] #section-discipline .execution-panel,
body[data-theme="dark"] #section-discipline .execution-panel {
  display: grid;
  gap: 18px;
  align-content: start;
  border-radius: 16px;
  background: var(--layer-1) !important;
  border: 1px solid var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-section-header,
body[data-theme="dark"] #section-discipline .execution-section-header {
  margin-bottom: 0;
}

html[data-theme="dark"] #section-discipline .execution-rule-list,
body[data-theme="dark"] #section-discipline .execution-rule-list {
  display: grid;
  gap: 14px;
}

html[data-theme="dark"] #section-discipline .execution-rule-row,
body[data-theme="dark"] #section-discipline .execution-rule-row {
  display: grid;
  gap: 8px;
}

html[data-theme="dark"] #section-discipline .execution-rule-row__head,
body[data-theme="dark"] #section-discipline .execution-rule-row__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

html[data-theme="dark"] #section-discipline .execution-rule-row__head strong,
body[data-theme="dark"] #section-discipline .execution-rule-row__head strong {
  font-size: 14px;
  line-height: 1.25;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .execution-rule-row__head span,
body[data-theme="dark"] #section-discipline .execution-rule-row__head span {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
}

html[data-theme="dark"] #section-discipline .execution-rule-row__track,
body[data-theme="dark"] #section-discipline .execution-rule-row__track,
html[data-theme="dark"] #section-discipline .execution-entry-row__bar,
body[data-theme="dark"] #section-discipline .execution-entry-row__bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
}

html[data-theme="dark"] #section-discipline .execution-rule-row__track span,
body[data-theme="dark"] #section-discipline .execution-rule-row__track span,
html[data-theme="dark"] #section-discipline .execution-entry-row__bar i,
body[data-theme="dark"] #section-discipline .execution-entry-row__bar i {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: rgba(255,255,255,0.26);
}

html[data-theme="dark"] #section-discipline .execution-rule-row small,
body[data-theme="dark"] #section-discipline .execution-rule-row small {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-history,
body[data-theme="dark"] #section-discipline .rule-history {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: var(--layer-1);
  border: 1px solid var(--border-0);
  border-radius: 16px;
}

html[data-theme="dark"] #section-discipline .rule-history__header,
body[data-theme="dark"] #section-discipline .rule-history__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-0);
}

html[data-theme="dark"] #section-discipline .rule-history__header strong,
body[data-theme="dark"] #section-discipline .rule-history__header strong {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-history__header p,
body[data-theme="dark"] #section-discipline .rule-history__header p {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-history__view-toggle,
body[data-theme="dark"] #section-discipline .rule-history__view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  background: rgba(255,255,255,0.025);
}

html[data-theme="dark"] #section-discipline .rule-history__view-toggle button,
body[data-theme="dark"] #section-discipline .rule-history__view-toggle button {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

html[data-theme="dark"] #section-discipline .rule-history__view-toggle button:hover,
body[data-theme="dark"] #section-discipline .rule-history__view-toggle button:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-history__view-toggle button.is-active,
body[data-theme="dark"] #section-discipline .rule-history__view-toggle button.is-active {
  background: var(--layer-2);
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-history__view,
body[data-theme="dark"] #section-discipline .rule-history__view {
  display: none;
  padding: 18px 24px 24px;
}

html[data-theme="dark"] #section-discipline .rule-history__view.is-active,
body[data-theme="dark"] #section-discipline .rule-history__view.is-active {
  display: block;
}

html[data-theme="dark"] #section-discipline .rule-history__legend,
body[data-theme="dark"] #section-discipline .rule-history__legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 0 12px;
}

html[data-theme="dark"] #section-discipline .rule-history__legend span,
body[data-theme="dark"] #section-discipline .rule-history__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-history__legend i,
body[data-theme="dark"] #section-discipline .rule-history__legend i {
  width: 10px;
  height: 10px;
  border-radius: 4px;
  border: 1px solid var(--border-0);
  background: rgba(255,255,255,0.045);
}

html[data-theme="dark"] #section-discipline .rule-history__legend i.is-empty,
body[data-theme="dark"] #section-discipline .rule-history__legend i.is-empty {
  background: transparent;
  border-style: dashed;
}

html[data-theme="dark"] #section-discipline .rule-history__empty,
body[data-theme="dark"] #section-discipline .rule-history__empty {
  padding: 12px;
  border: 1px solid var(--border-0);
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.4;
}

html[data-theme="dark"] #section-discipline .rule-history__body,
body[data-theme="dark"] #section-discipline .rule-history__body {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

html[data-theme="dark"] #section-discipline .rule-history__grid,
body[data-theme="dark"] #section-discipline .rule-history__grid {
  display: grid;
  grid-template-columns: minmax(190px, 230px) repeat(var(--rule-history-cols), minmax(58px, 70px));
  width: max-content;
  min-width: 100%;
  gap: 9px;
  align-items: center;
}

html[data-theme="dark"] #section-discipline .rule-history__week,
body[data-theme="dark"] #section-discipline .rule-history__week,
html[data-theme="dark"] #section-discipline .rule-history__rule,
body[data-theme="dark"] #section-discipline .rule-history__rule {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-history__week,
body[data-theme="dark"] #section-discipline .rule-history__week {
  text-align: center;
  overflow: visible;
  text-overflow: clip;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] #section-discipline .rule-history__rule,
body[data-theme="dark"] #section-discipline .rule-history__rule {
  text-transform: none;
  padding-right: 8px;
}

html[data-theme="dark"] #section-discipline .rule-history__rule--total,
body[data-theme="dark"] #section-discipline .rule-history__rule--total {
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-history__cell,
body[data-theme="dark"] #section-discipline .rule-history__cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 34px;
  border: 1px solid var(--cell-border, var(--border-0));
  border-radius: 6px;
  background: var(--cell-bg, rgba(255,255,255,0.045));
  color: var(--cell-color, var(--text-2));
  cursor: pointer;
  padding: 0;
  appearance: none;
  font-size: 11px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  transition: border-color 140ms ease, filter 140ms ease, transform 140ms ease;
}

html[data-theme="dark"] #section-discipline .rule-history__cell:hover,
body[data-theme="dark"] #section-discipline .rule-history__cell:hover {
  filter: brightness(1.14);
  transform: translateY(-1px);
}

html[data-theme="dark"] #section-discipline .rule-history__cell.is-selected,
body[data-theme="dark"] #section-discipline .rule-history__cell.is-selected {
  border-color: rgba(47,107,255,0.48);
  box-shadow: inset 0 0 0 1px rgba(47,107,255,0.22);
}

html[data-theme="dark"] #section-discipline .rule-history__cell.is-empty,
body[data-theme="dark"] #section-discipline .rule-history__cell.is-empty {
  border-style: dashed;
}

html[data-theme="dark"] #section-discipline .rule-history__cell--total,
body[data-theme="dark"] #section-discipline .rule-history__cell--total {
  min-height: 38px;
  font-weight: 900;
}

html[data-theme="dark"] #section-discipline .rule-history-detail,
body[data-theme="dark"] #section-discipline .rule-history-detail {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--border-0);
  border-radius: 14px;
  background: var(--layer-1);
}

html[data-theme="dark"] #section-discipline .rule-history-detail__header,
body[data-theme="dark"] #section-discipline .rule-history-detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__header button,
body[data-theme="dark"] #section-discipline .rule-history-detail__header button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  color: var(--text-1);
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__header strong,
body[data-theme="dark"] #section-discipline .rule-history-detail__header strong {
  display: block;
  font-size: 14px;
  font-weight: 850;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-history-detail__header p,
body[data-theme="dark"] #section-discipline .rule-history-detail__header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-history-detail__empty,
body[data-theme="dark"] #section-discipline .rule-history-detail__empty {
  padding: 12px;
  border-radius: 12px;
  background: rgba(52,217,123,0.06);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 750;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__score,
body[data-theme="dark"] #section-discipline .rule-history-detail__score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 30px;
  border: 1px solid var(--score-border);
  border-radius: 999px;
  background: var(--score-bg);
  color: var(--score-color);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__list,
body[data-theme="dark"] #section-discipline .rule-history-detail__list {
  display: grid;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__row,
body[data-theme="dark"] #section-discipline .rule-history-detail__row {
  display: grid;
  gap: 7px;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.07);
  transition: background 140ms ease;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__row:hover,
body[data-theme="dark"] #section-discipline .rule-history-detail__row:hover {
  background: rgba(255,255,255,0.025);
}

html[data-theme="dark"] #section-discipline .rule-history-detail__meta,
body[data-theme="dark"] #section-discipline .rule-history-detail__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-history-detail__direction,
body[data-theme="dark"] #section-discipline .rule-history-detail__direction {
  padding: 3px 8px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  color: var(--text-1);
}

html[data-theme="dark"] #section-discipline .rule-history-detail__meta b,
body[data-theme="dark"] #section-discipline .rule-history-detail__meta b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__meta b.is-positive,
body[data-theme="dark"] #section-discipline .rule-history-detail__meta b.is-positive {
  color: var(--positive);
}

html[data-theme="dark"] #section-discipline .rule-history-detail__meta b.is-negative,
body[data-theme="dark"] #section-discipline .rule-history-detail__meta b.is-negative {
  color: rgba(255,92,92,0.8);
}

html[data-theme="dark"] #section-discipline .rule-history-detail__row > strong,
body[data-theme="dark"] #section-discipline .rule-history-detail__row > strong {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-history-detail__row em,
body[data-theme="dark"] #section-discipline .rule-history-detail__row em {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-history-detail__link,
body[data-theme="dark"] #section-discipline .rule-history-detail__link {
  width: fit-content;
  color: var(--text-1);
  font-size: 12px;
  font-weight: 800;
  opacity: 0.72;
}

html[data-theme="dark"] #section-discipline .rule-history-chart,
body[data-theme="dark"] #section-discipline .rule-history-chart {
  position: relative;
  display: grid;
  gap: 0;
}

html[data-theme="dark"] #section-discipline .compliance-chart-wrap,
body[data-theme="dark"] #section-discipline .compliance-chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
  padding: 18px 20px 8px;
}

html[data-theme="dark"] #section-discipline .rule-history-chart canvas,
body[data-theme="dark"] #section-discipline .rule-history-chart canvas {
  display: block;
  width: 100% !important;
  height: 260px !important;
  max-height: 260px;
}

html[data-theme="dark"] #section-discipline .rule-history-chart__fallback,
body[data-theme="dark"] #section-discipline .rule-history-chart__fallback {
  display: none;
  place-items: center;
  min-height: 100%;
  padding: 18px;
  border: 1px dashed var(--border-0);
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
  color: var(--text-2);
  font-size: 13px;
}

html[data-theme="dark"] #section-discipline .compliance-chart-legend,
body[data-theme="dark"] #section-discipline .compliance-chart-legend {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 8px 20px 18px;
}

html[data-theme="dark"] #section-discipline .compliance-chart-legend span,
body[data-theme="dark"] #section-discipline .compliance-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

html[data-theme="dark"] #section-discipline .compliance-chart-legend i,
body[data-theme="dark"] #section-discipline .compliance-chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  opacity: 0.85;
}

html[data-theme="dark"] #section-discipline .rule-history__legend i.is-bad,
body[data-theme="dark"] #section-discipline .rule-history__legend i.is-bad {
  background: rgba(255,92,92,0.22);
  border-color: rgba(255,92,92,0.28);
}

html[data-theme="dark"] #section-discipline .rule-history__legend i.is-warn,
body[data-theme="dark"] #section-discipline .rule-history__legend i.is-warn {
  background: rgba(245,166,35,0.22);
  border-color: rgba(245,166,35,0.28);
}

html[data-theme="dark"] #section-discipline .rule-history__legend i.is-ok,
body[data-theme="dark"] #section-discipline .rule-history__legend i.is-ok {
  background: rgba(52,217,123,0.18);
  border-color: rgba(52,217,123,0.22);
}

html[data-theme="dark"] #section-discipline .rule-history__legend i.is-strong,
body[data-theme="dark"] #section-discipline .rule-history__legend i.is-strong {
  background: rgba(52,217,123,0.35);
  border-color: rgba(52,217,123,0.32);
}

html[data-theme="dark"] #section-discipline .execution-heatmap,
body[data-theme="dark"] #section-discipline .execution-heatmap {
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] #section-discipline .execution-heatmap__weekdays,
body[data-theme="dark"] #section-discipline .execution-heatmap__weekdays,
html[data-theme="dark"] #section-discipline .execution-heatmap__row,
body[data-theme="dark"] #section-discipline .execution-heatmap__row {
  display: grid;
  grid-template-columns: 34px repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

html[data-theme="dark"] #section-discipline .execution-heatmap__weekdays span,
body[data-theme="dark"] #section-discipline .execution-heatmap__weekdays span,
html[data-theme="dark"] #section-discipline .execution-heatmap__row strong,
body[data-theme="dark"] #section-discipline .execution-heatmap__row strong {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-heatmap__cell,
body[data-theme="dark"] #section-discipline .execution-heatmap__cell {
  min-height: 42px;
  border-radius: 11px;
  border: 1px solid var(--border-0);
  background: var(--layer-1);
}

html[data-theme="dark"] #section-discipline .execution-heatmap__cell.is-today,
body[data-theme="dark"] #section-discipline .execution-heatmap__cell.is-today {
  border-color: var(--accent) !important;
  outline: 1px solid color-mix(in srgb, var(--accent) 72%, transparent);
  outline-offset: 2px;
}

html[data-theme="dark"] #section-discipline .execution-heatmap__legend,
body[data-theme="dark"] #section-discipline .execution-heatmap__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
}

html[data-theme="dark"] #section-discipline .execution-heatmap__legend span,
body[data-theme="dark"] #section-discipline .execution-heatmap__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-heatmap__legend i,
body[data-theme="dark"] #section-discipline .execution-heatmap__legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}

html[data-theme="dark"] #section-discipline .execution-entry-table,
body[data-theme="dark"] #section-discipline .execution-entry-table {
  display: grid;
  gap: 8px;
}

html[data-theme="dark"] #section-discipline .execution-entry-pattern,
body[data-theme="dark"] #section-discipline .execution-entry-pattern {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border-0);
  border-radius: 16px;
  background: var(--layer-1);
}

html[data-theme="dark"] #section-discipline .execution-entry-table__head,
body[data-theme="dark"] #section-discipline .execution-entry-table__head,
html[data-theme="dark"] #section-discipline .execution-entry-row,
body[data-theme="dark"] #section-discipline .execution-entry-row {
  display: grid;
  grid-template-columns: 0.75fr 0.85fr 0.8fr minmax(110px, 1fr) 0.8fr;
  gap: 12px;
  align-items: center;
}

html[data-theme="dark"] #section-discipline .execution-entry-table__head span,
body[data-theme="dark"] #section-discipline .execution-entry-table__head span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-entry-row,
body[data-theme="dark"] #section-discipline .execution-entry-row {
  min-height: 42px;
  padding: 9px 0;
  border-top: 1px solid rgba(255,255,255,0.045);
}

html[data-theme="dark"] #section-discipline .execution-entry-row span,
body[data-theme="dark"] #section-discipline .execution-entry-row span,
html[data-theme="dark"] #section-discipline .execution-entry-row em,
body[data-theme="dark"] #section-discipline .execution-entry-row em {
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-entry-row strong,
body[data-theme="dark"] #section-discipline .execution-entry-row strong {
  font-size: 13px;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .execution-score-panel,
body[data-theme="dark"] #section-discipline .execution-score-panel {
  align-content: start;
}

html[data-theme="dark"] #section-discipline .execution-score-body,
body[data-theme="dark"] #section-discipline .execution-score-body {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

html[data-theme="dark"] #section-discipline .execution-score-gauge,
body[data-theme="dark"] #section-discipline .execution-score-gauge {
  position: relative;
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
}

html[data-theme="dark"] #section-discipline .execution-score-gauge svg,
body[data-theme="dark"] #section-discipline .execution-score-gauge svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

html[data-theme="dark"] #section-discipline .execution-score-gauge circle,
body[data-theme="dark"] #section-discipline .execution-score-gauge circle {
  fill: none;
  stroke-width: 11;
  stroke-linecap: round;
}

html[data-theme="dark"] #section-discipline .execution-score-gauge__track,
body[data-theme="dark"] #section-discipline .execution-score-gauge__track {
  stroke: rgba(255,255,255,0.065);
}

html[data-theme="dark"] #section-discipline .execution-score-gauge__arc,
body[data-theme="dark"] #section-discipline .execution-score-gauge__arc {
  stroke: var(--execution-score-color, rgba(255,255,255,0.28));
}

html[data-theme="dark"] #section-discipline .execution-score-gauge div,
body[data-theme="dark"] #section-discipline .execution-score-gauge div {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

html[data-theme="dark"] #section-discipline .execution-score-gauge strong,
body[data-theme="dark"] #section-discipline .execution-score-gauge strong {
  font-size: 42px;
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .execution-score-gauge span,
body[data-theme="dark"] #section-discipline .execution-score-gauge span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-subscore-list,
body[data-theme="dark"] #section-discipline .execution-subscore-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

html[data-theme="dark"] #section-discipline .execution-subscore,
body[data-theme="dark"] #section-discipline .execution-subscore {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.045);
}

html[data-theme="dark"] #section-discipline .execution-subscore span,
body[data-theme="dark"] #section-discipline .execution-subscore span {
  font-size: 12px;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-subscore strong,
body[data-theme="dark"] #section-discipline .execution-subscore strong {
  font-size: 13px;
  margin-left: auto;
  text-align: right;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .execution-system-insight,
body[data-theme="dark"] #section-discipline .execution-system-insight {
  display: grid;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

html[data-theme="dark"] #section-discipline .execution-system-insight strong,
body[data-theme="dark"] #section-discipline .execution-system-insight strong {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-system-insight p,
body[data-theme="dark"] #section-discipline .execution-system-insight p,
html[data-theme="dark"] #section-discipline .execution-empty,
body[data-theme="dark"] #section-discipline .execution-empty {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-tone-ok,
body[data-theme="dark"] #section-discipline .execution-tone-ok {
  --execution-score-color: color-mix(in srgb, var(--positive) 78%, var(--text-1));
}

html[data-theme="dark"] #section-discipline .execution-tone-warn,
body[data-theme="dark"] #section-discipline .execution-tone-warn {
  --execution-score-color: color-mix(in srgb, var(--warning) 82%, var(--text-1));
}

html[data-theme="dark"] #section-discipline .execution-tone-bad,
body[data-theme="dark"] #section-discipline .execution-tone-bad {
  --execution-score-color: rgba(255,92,92,0.55);
}

html[data-theme="dark"] #section-discipline .execution-tone-ok .execution-rule-row__track span,
body[data-theme="dark"] #section-discipline .execution-tone-ok .execution-rule-row__track span,
html[data-theme="dark"] #section-discipline .execution-tone-ok .execution-entry-row__bar i,
body[data-theme="dark"] #section-discipline .execution-tone-ok .execution-entry-row__bar i,
html[data-theme="dark"] #section-discipline .execution-heatmap__cell.execution-tone-ok,
body[data-theme="dark"] #section-discipline .execution-heatmap__cell.execution-tone-ok,
html[data-theme="dark"] #section-discipline .execution-heatmap__legend .execution-tone-ok,
body[data-theme="dark"] #section-discipline .execution-heatmap__legend .execution-tone-ok {
  background: color-mix(in srgb, var(--positive) 70%, #1a1a1a);
  border-color: rgba(52,199,89,0.18);
}

html[data-theme="dark"] #section-discipline .execution-tone-warn .execution-rule-row__track span,
body[data-theme="dark"] #section-discipline .execution-tone-warn .execution-rule-row__track span,
html[data-theme="dark"] #section-discipline .execution-tone-warn .execution-entry-row__bar i,
body[data-theme="dark"] #section-discipline .execution-tone-warn .execution-entry-row__bar i,
html[data-theme="dark"] #section-discipline .execution-heatmap__cell.execution-tone-warn,
body[data-theme="dark"] #section-discipline .execution-heatmap__cell.execution-tone-warn,
html[data-theme="dark"] #section-discipline .execution-heatmap__legend .execution-tone-warn,
body[data-theme="dark"] #section-discipline .execution-heatmap__legend .execution-tone-warn {
  background: color-mix(in srgb, var(--warning) 60%, #1a1a1a);
  border-color: rgba(255,159,10,0.18);
}

html[data-theme="dark"] #section-discipline .execution-tone-bad .execution-rule-row__track span,
body[data-theme="dark"] #section-discipline .execution-tone-bad .execution-rule-row__track span,
html[data-theme="dark"] #section-discipline .execution-tone-bad .execution-entry-row__bar i,
body[data-theme="dark"] #section-discipline .execution-tone-bad .execution-entry-row__bar i,
html[data-theme="dark"] #section-discipline .execution-heatmap__cell.execution-tone-bad,
body[data-theme="dark"] #section-discipline .execution-heatmap__cell.execution-tone-bad,
html[data-theme="dark"] #section-discipline .execution-heatmap__legend .execution-tone-bad,
body[data-theme="dark"] #section-discipline .execution-heatmap__legend .execution-tone-bad {
  background: rgba(255,92,92,0.55);
  border-color: rgba(255,92,92,0.18);
}

html[data-theme="dark"] #section-discipline .execution-heatmap__cell.execution-tone-empty,
body[data-theme="dark"] #section-discipline .execution-heatmap__cell.execution-tone-empty,
html[data-theme="dark"] #section-discipline .execution-heatmap__legend .execution-tone-empty,
body[data-theme="dark"] #section-discipline .execution-heatmap__legend .execution-tone-empty {
  background: rgba(255,255,255,0.045);
  border-color: rgba(255,255,255,0.04);
}

html[data-theme="dark"] #section-discipline .execution-tone-pending .execution-rule-row__track span,
body[data-theme="dark"] #section-discipline .execution-tone-pending .execution-rule-row__track span,
html[data-theme="dark"] #section-discipline .execution-tone-pending .execution-entry-row__bar i,
body[data-theme="dark"] #section-discipline .execution-tone-pending .execution-entry-row__bar i {
  background: rgba(255,255,255,0.16);
}

@media (max-width: 1180px) {
  html[data-theme="dark"] #section-discipline .execution-hero,
  body[data-theme="dark"] #section-discipline .execution-hero {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] #section-discipline .execution-kpi-grid,
  body[data-theme="dark"] #section-discipline .execution-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] #section-discipline .execution-main-grid,
  body[data-theme="dark"] #section-discipline .execution-main-grid,
  html[data-theme="dark"] #section-discipline .execution-main-grid--lower,
  body[data-theme="dark"] #section-discipline .execution-main-grid--lower {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  html[data-theme="dark"] #section-discipline .execution-kpi-grid,
  body[data-theme="dark"] #section-discipline .execution-kpi-grid,
  html[data-theme="dark"] #section-discipline .execution-score-body,
  body[data-theme="dark"] #section-discipline .execution-score-body {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] #section-discipline .execution-entry-table,
  body[data-theme="dark"] #section-discipline .execution-entry-table {
    overflow-x: auto;
  }

  html[data-theme="dark"] #section-discipline .execution-entry-table__head,
  body[data-theme="dark"] #section-discipline .execution-entry-table__head,
  html[data-theme="dark"] #section-discipline .execution-entry-row,
  body[data-theme="dark"] #section-discipline .execution-entry-row {
    min-width: 640px;
  }
}

/* === POST TRADE TAG === */
html[data-theme="dark"] #section-discipline .posttrade-tag-alert,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border-0);
  border-radius: 16px;
  background: var(--layer-1);
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert.has-pending,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert.has-pending {
  border-color: rgba(245,166,35,0.18);
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert span,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert span,
html[data-theme="dark"] #kmfx-posttrade-modal .ptt-header span,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-header span,
html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question > span,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question > span,
html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-note span,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-note span {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert strong,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert p,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert__actions,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert button,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert button,
html[data-theme="dark"] #kmfx-posttrade-modal button,
body[data-theme="dark"] #kmfx-posttrade-modal button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--text-0);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert button:hover,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert button:hover,
html[data-theme="dark"] #kmfx-posttrade-modal button:hover,
body[data-theme="dark"] #kmfx-posttrade-modal button:hover {
  background: rgba(255,255,255,0.065);
}

html[data-theme="dark"] #kmfx-posttrade-modal,
body[data-theme="dark"] #kmfx-posttrade-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

html[data-theme="dark"] #kmfx-posttrade-modal.is-open,
body[data-theme="dark"] #kmfx-posttrade-modal.is-open {
  pointer-events: auto;
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-overlay,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.58);
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-dialog,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  width: min(520px, calc(100vw - 32px));
  max-height: min(82vh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  row-gap: 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.105);
  border-radius: 24px;
  background: #111111;
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
  transform: translate(-50%, -50%);
  outline: none;
  overflow: hidden;
  overscroll-behavior: contain;
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar {
  width: 6px;
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar-track,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar-track {
  background: transparent;
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar-thumb,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-header,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 24px 32px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.115);
  background: #1c1c1e;
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-header h3,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-header h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  color: var(--text-0);
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-header b,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-header b {
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-header b.is-positive,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-header b.is-positive {
  color: color-mix(in srgb, var(--positive) 76%, var(--text-0));
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-header b.is-negative,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-header b.is-negative {
  color: rgba(255,92,92,0.72);
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-header p,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-header p {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--text-2);
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-header > button,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-header > button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 12px;
  font-size: 20px;
  line-height: 1;
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-body,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-body {
  min-height: 0;
  overflow-y: auto;
  margin-right: 6px;
  padding: 18px 10px 18px 32px;
  display: grid;
  gap: 10px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-quick,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-quick {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-quick strong,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-quick strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
  color: var(--text-0);
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-quick p,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-quick p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-quick__actions,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-quick__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-progress,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-progress {
  justify-self: start;
  padding: 5px 9px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-partial-notice,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-partial-notice {
  padding: 9px 11px;
  border: 1px solid rgba(245,166,35,0.18);
  border-radius: 12px;
  background: rgba(245,166,35,0.07);
  color: color-mix(in srgb, var(--warning) 76%, var(--text-0));
  font-size: 12px;
  line-height: 1.35;
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question-list,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question-list {
  display: grid;
  gap: 10px;
}

html[data-theme="dark"] #kmfx-posttrade-modal .is-hidden,
body[data-theme="dark"] #kmfx-posttrade-modal .is-hidden {
  display: none !important;
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question,
html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-note,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-note,
html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-empty,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-empty {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--border-0);
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question > span,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question > span {
  margin-bottom: 3px;
  max-width: 42ch;
  font-size: 10px;
  line-height: 1.35;
  letter-spacing: 0.08em;
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-choice-group,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-choice-group button,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-choice-group button {
  min-height: 32px;
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-choice-group--enum,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-choice-group--enum {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-choice-group button.is-selected,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-choice-group button.is-selected,
html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-quick__actions button.is-selected,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-quick__actions button.is-selected {
  border-color: color-mix(in srgb, var(--posttrade-choice-color, var(--positive)) 36%, transparent);
  background: color-mix(in srgb, var(--posttrade-choice-color, var(--positive)) 14%, transparent);
  color: color-mix(in srgb, var(--posttrade-choice-color, var(--positive)) 80%, var(--text-0));
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question--numeric div,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question--numeric div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question input,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question input,
html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-note textarea,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-note textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border-0);
  border-radius: 11px;
  background: rgba(255,255,255,0.04);
  color: var(--text-0);
  font: inherit;
  font-size: 13px;
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-note textarea,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-note textarea {
  min-height: 76px;
  padding-top: 10px;
  resize: vertical;
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question em,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-question em,
html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-empty p,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] #kmfx-posttrade-modal .posttrade-empty strong,
body[data-theme="dark"] #kmfx-posttrade-modal .posttrade-empty strong {
  font-size: 13px;
  color: var(--text-0);
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-footer,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 16px 32px 20px;
  border-top: 1px solid rgba(255,255,255,0.095);
  background: #161616;
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-queue-actions,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-queue-actions,
html[data-theme="dark"] #kmfx-posttrade-modal .ptt-save-actions,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

html[data-theme="dark"] #kmfx-posttrade-modal button:disabled,
body[data-theme="dark"] #kmfx-posttrade-modal button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

html[data-theme="dark"] #kmfx-posttrade-modal .ptt-footer .primary,
body[data-theme="dark"] #kmfx-posttrade-modal .ptt-footer .primary {
  border-color: rgba(52,217,123,0.24);
  background: rgba(52,217,123,0.14);
  color: color-mix(in srgb, var(--positive) 80%, var(--text-0));
}

@media (max-width: 720px) {
  html[data-theme="dark"] #section-discipline .posttrade-tag-alert,
  body[data-theme="dark"] #section-discipline .posttrade-tag-alert,
  html[data-theme="dark"] #kmfx-posttrade-modal .ptt-footer,
  body[data-theme="dark"] #kmfx-posttrade-modal .ptt-footer {
    display: grid;
  }

  html[data-theme="dark"] #section-discipline .posttrade-tag-alert__actions,
  body[data-theme="dark"] #section-discipline .posttrade-tag-alert__actions {
    justify-content: stretch;
  }
}

/* === KMFX DESIGN SYSTEM NORMALIZATION === */
:root,
[data-theme="dark"] {
  --layer-0: var(--kmfx-page-bg) !important;
  --layer-1: var(--kmfx-card-bg) !important;
  --layer-2: var(--kmfx-card-bg-soft) !important;
  --border-0: var(--kmfx-border) !important;
  --border-1: var(--kmfx-border) !important;
  --border-2: var(--kmfx-border-strong) !important;
  --radius-section: var(--kmfx-card-radius);
  --radius-card: var(--kmfx-card-radius);
  --card-surface: var(--kmfx-card-bg);
  --card-border: var(--kmfx-border);
  --card-radius: var(--kmfx-card-radius);
  --chart-plot-bg: var(--kmfx-card-bg-soft);
  --chart-plot-border: var(--kmfx-border);
  --chart-grid: rgba(255,255,255,0.06);
  --chart-axis-text: var(--text-2);
  --chart-tooltip-bg: color-mix(in srgb, var(--kmfx-card-bg-soft) 94%, #000 6%);
  --chart-tooltip-border: var(--kmfx-border);
  --chart-radius: var(--kmfx-card-radius);
  --chart-inner-gap: var(--kmfx-gap-card);
}

html[data-theme="dark"],
body[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] .app-shell,
body[data-theme="dark"] .app-shell,
html[data-theme="dark"] .main-panel,
body[data-theme="dark"] .main-panel,
html[data-theme="dark"] .content,
body[data-theme="dark"] .content {
  background: var(--kmfx-shell-bg) !important;
  background-image: none !important;
}

html[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .main-panel.sidebar-inset,
body[data-theme="dark"] .app-shell.sidebar-vnext.sidebar-provider .main-panel.sidebar-inset {
  background: var(--kmfx-shell-bg) !important;
}

html[data-theme="dark"] .dashboard-page-flow,
body[data-theme="dark"] .dashboard-page-flow,
html[data-theme="dark"] .dashboard-premium-grid,
body[data-theme="dark"] .dashboard-premium-grid,
html[data-theme="dark"] .calendar-screen,
body[data-theme="dark"] .calendar-screen,
html[data-theme="dark"] .trades-screen,
body[data-theme="dark"] .trades-screen,
html[data-theme="dark"] .strategies-page-stack,
body[data-theme="dark"] .strategies-page-stack,
html[data-theme="dark"] .analytics-page-flow,
body[data-theme="dark"] .analytics-page-flow,
html[data-theme="dark"] .risk-page-stack,
body[data-theme="dark"] .risk-page-stack,
html[data-theme="dark"] .discipline-page-stack,
body[data-theme="dark"] .discipline-page-stack,
html[data-theme="dark"] .connections-shell,
body[data-theme="dark"] .connections-shell,
html[data-theme="dark"] .funded-page-stack,
body[data-theme="dark"] .funded-page-stack,
html[data-theme="dark"] .kmfx-mt5-page,
body[data-theme="dark"] .kmfx-mt5-page {
  display: grid;
  gap: var(--kmfx-gap-section);
}

html[data-theme="dark"] .tl-page-header,
body[data-theme="dark"] .tl-page-header,
html[data-theme="dark"] .calendar-screen__header,
body[data-theme="dark"] .calendar-screen__header,
html[data-theme="dark"] .connections-shell__header,
body[data-theme="dark"] .connections-shell__header,
html[data-theme="dark"] .kmfx-mt5-header,
body[data-theme="dark"] .kmfx-mt5-header {
  margin: 0 0 var(--kmfx-gap-page);
}

html[data-theme="dark"] .tl-page-title,
body[data-theme="dark"] .tl-page-title,
html[data-theme="dark"] .calendar-screen__title,
body[data-theme="dark"] .calendar-screen__title,
html[data-theme="dark"] .connections-shell__title,
body[data-theme="dark"] .connections-shell__title,
html[data-theme="dark"] .kmfx-mt5-header__title,
body[data-theme="dark"] .kmfx-mt5-header__title {
  margin: 0;
  font-size: var(--kmfx-title-size) !important;
  line-height: var(--kmfx-title-line) !important;
  font-weight: 780 !important;
  letter-spacing: -0.045em !important;
  color: var(--text-0) !important;
}

html[data-theme="dark"] .calendar-screen__eyebrow,
body[data-theme="dark"] .calendar-screen__eyebrow,
html[data-theme="dark"] .risk-data-state__eyebrow,
body[data-theme="dark"] .risk-data-state__eyebrow {
  margin: 0 0 8px;
  font-size: var(--kmfx-label-size) !important;
  line-height: 1.1;
  font-weight: 800 !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase;
  color: var(--text-2) !important;
}

html[data-theme="dark"] .calendar-screen__subtitle,
body[data-theme="dark"] .calendar-screen__subtitle,
html[data-theme="dark"] .connections-shell__subtitle,
body[data-theme="dark"] .connections-shell__subtitle,
html[data-theme="dark"] .kmfx-mt5-header__subtitle,
body[data-theme="dark"] .kmfx-mt5-header__subtitle,
html[data-theme="dark"] .tl-page-header .row-sub,
body[data-theme="dark"] .tl-page-header .row-sub {
  margin: 8px 0 0;
  font-size: var(--kmfx-subtitle-size) !important;
  line-height: 1.45 !important;
  color: var(--text-2) !important;
}

.kmfx-card,
html[data-theme="dark"] .tl-section-card,
body[data-theme="dark"] .tl-section-card,
html[data-theme="dark"] .widget-card,
body[data-theme="dark"] .widget-card,
html[data-theme="dark"] .chart-card,
body[data-theme="dark"] .chart-card,
html[data-theme="dark"] .pnlcal-card,
body[data-theme="dark"] .pnlcal-card,
html[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .widget-table-wrap,
body[data-theme="dark"] .widget-table-wrap,
html[data-theme="dark"] .calendar-summary-card,
body[data-theme="dark"] .calendar-summary-card,
html[data-theme="dark"] .calendar-week-chip,
body[data-theme="dark"] .calendar-week-chip,
html[data-theme="dark"] .analytics-insight-card,
body[data-theme="dark"] .analytics-insight-card,
html[data-theme="dark"] .analytics-pattern-card,
body[data-theme="dark"] .analytics-pattern-card,
html[data-theme="dark"] .analytics-winloss-card,
body[data-theme="dark"] .analytics-winloss-card,
html[data-theme="dark"] .analytics-risk-kpi,
body[data-theme="dark"] .analytics-risk-kpi,
html[data-theme="dark"] .risk-metric-card,
body[data-theme="dark"] .risk-metric-card,
html[data-theme="dark"] .risk-rule-card,
body[data-theme="dark"] .risk-rule-card,
html[data-theme="dark"] .risk-policy-card,
body[data-theme="dark"] .risk-policy-card,
html[data-theme="dark"] .strategies-setup-item,
body[data-theme="dark"] .strategies-setup-item,
html[data-theme="dark"] .open-position-summary,
body[data-theme="dark"] .open-position-summary,
html[data-theme="dark"] .connections-account-card,
body[data-theme="dark"] .connections-account-card,
html[data-theme="dark"] .settings-status-card,
body[data-theme="dark"] .settings-status-card,
html[data-theme="dark"] #section-discipline .execution-hero,
body[data-theme="dark"] #section-discipline .execution-hero,
html[data-theme="dark"] #section-discipline .execution-hero__issue,
body[data-theme="dark"] #section-discipline .execution-hero__issue,
html[data-theme="dark"] #section-discipline .execution-panel,
body[data-theme="dark"] #section-discipline .execution-panel,
html[data-theme="dark"] #section-discipline .execution-entry-pattern,
body[data-theme="dark"] #section-discipline .execution-entry-pattern {
  background: var(--kmfx-card-bg) !important;
  background-image: none !important;
  border: 1px solid var(--kmfx-border) !important;
  border-radius: var(--kmfx-card-radius) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .tl-section-card,
body[data-theme="dark"] .tl-section-card,
html[data-theme="dark"] .widget-card,
body[data-theme="dark"] .widget-card,
html[data-theme="dark"] .chart-card,
body[data-theme="dark"] .chart-card,
html[data-theme="dark"] .pnlcal-card,
body[data-theme="dark"] .pnlcal-card,
html[data-theme="dark"] .analytics-pattern-card,
body[data-theme="dark"] .analytics-pattern-card,
html[data-theme="dark"] .risk-policy-card,
body[data-theme="dark"] .risk-policy-card {
  padding: var(--kmfx-card-padding) !important;
}

.kmfx-kpi-card,
html[data-theme="dark"] .tl-kpi-card,
body[data-theme="dark"] .tl-kpi-card,
html[data-theme="dark"] .widget-card--kpi,
body[data-theme="dark"] .widget-card--kpi,
html[data-theme="dark"] .calendar-summary-card,
body[data-theme="dark"] .calendar-summary-card,
html[data-theme="dark"] .risk-core-kpi,
body[data-theme="dark"] .risk-core-kpi,
html[data-theme="dark"] .analytics-risk-kpi,
body[data-theme="dark"] .analytics-risk-kpi,
html[data-theme="dark"] #section-discipline .execution-kpi,
body[data-theme="dark"] #section-discipline .execution-kpi {
  min-height: 148px;
  padding: var(--kmfx-card-padding) !important;
  background: var(--kmfx-card-bg) !important;
  border: 1px solid var(--kmfx-border) !important;
  border-radius: var(--kmfx-card-radius) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .tl-kpi-label,
body[data-theme="dark"] .tl-kpi-label,
html[data-theme="dark"] .calendar-summary-card__label,
body[data-theme="dark"] .calendar-summary-card__label,
html[data-theme="dark"] .risk-metric-card__label,
body[data-theme="dark"] .risk-metric-card__label,
html[data-theme="dark"] .analytics-risk-kpi__label,
body[data-theme="dark"] .analytics-risk-kpi__label,
html[data-theme="dark"] #section-discipline .execution-kpi p:first-child,
body[data-theme="dark"] #section-discipline .execution-kpi p:first-child {
  margin: 0;
  font-size: var(--kmfx-label-size) !important;
  line-height: 1.1;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase;
  color: var(--text-2) !important;
}

html[data-theme="dark"] .tl-kpi-val,
body[data-theme="dark"] .tl-kpi-val,
html[data-theme="dark"] .calendar-summary-card__value,
body[data-theme="dark"] .calendar-summary-card__value,
html[data-theme="dark"] .risk-metric-card__value,
body[data-theme="dark"] .risk-metric-card__value,
html[data-theme="dark"] .analytics-risk-kpi__value,
body[data-theme="dark"] .analytics-risk-kpi__value,
html[data-theme="dark"] #section-discipline .execution-kpi strong,
body[data-theme="dark"] #section-discipline .execution-kpi strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em !important;
  line-height: 1.02 !important;
}

html[data-theme="dark"] .tl-kpi-row,
body[data-theme="dark"] .tl-kpi-row,
html[data-theme="dark"] .tl-kpi-row.five,
body[data-theme="dark"] .tl-kpi-row.five,
html[data-theme="dark"] .dashboard-summary-kpis,
body[data-theme="dark"] .dashboard-summary-kpis,
html[data-theme="dark"] .calendar-summary-strip,
body[data-theme="dark"] .calendar-summary-strip,
html[data-theme="dark"] #section-discipline .execution-kpi-grid,
body[data-theme="dark"] #section-discipline .execution-kpi-grid {
  gap: var(--kmfx-gap-card) !important;
  margin-bottom: 0 !important;
}

html[data-theme="dark"] .grid-2,
body[data-theme="dark"] .grid-2,
html[data-theme="dark"] .grid-2.equal,
body[data-theme="dark"] .grid-2.equal,
html[data-theme="dark"] .grid-3,
body[data-theme="dark"] .grid-3,
html[data-theme="dark"] .dashboard-main-grid,
body[data-theme="dark"] .dashboard-main-grid,
html[data-theme="dark"] .dashboard-secondary-grid,
body[data-theme="dark"] .dashboard-secondary-grid,
html[data-theme="dark"] .dashboard-tertiary-grid,
body[data-theme="dark"] .dashboard-tertiary-grid,
html[data-theme="dark"] .calendar-analytics-stack,
body[data-theme="dark"] .calendar-analytics-stack,
html[data-theme="dark"] #section-discipline .execution-main-grid,
body[data-theme="dark"] #section-discipline .execution-main-grid {
  gap: var(--kmfx-gap-section) !important;
}

html[data-theme="dark"] .tl-section-header,
body[data-theme="dark"] .tl-section-header,
html[data-theme="dark"] .calendar-panel-head,
body[data-theme="dark"] .calendar-panel-head,
html[data-theme="dark"] .widget-card-head,
body[data-theme="dark"] .widget-card-head {
  gap: 12px !important;
  margin-bottom: var(--kmfx-gap-card) !important;
}

html[data-theme="dark"] .tl-section-title,
body[data-theme="dark"] .tl-section-title,
html[data-theme="dark"] .calendar-panel-title,
body[data-theme="dark"] .calendar-panel-title,
html[data-theme="dark"] .dashboard-risk-block__title,
body[data-theme="dark"] .dashboard-risk-block__title,
html[data-theme="dark"] .widget-title,
body[data-theme="dark"] .widget-title {
  font-size: 17px !important;
  line-height: 1.15 !important;
  font-weight: 750 !important;
  letter-spacing: -0.025em !important;
  color: var(--text-0) !important;
}

html[data-theme="dark"] .calendar-panel-sub,
body[data-theme="dark"] .calendar-panel-sub,
html[data-theme="dark"] .row-sub,
body[data-theme="dark"] .row-sub,
html[data-theme="dark"] .widget-card-meta,
body[data-theme="dark"] .widget-card-meta,
html[data-theme="dark"] .goal-card-sub,
body[data-theme="dark"] .goal-card-sub {
  color: var(--text-2) !important;
}

.kmfx-pill,
html[data-theme="dark"] .pill,
body[data-theme="dark"] .pill,
html[data-theme="dark"] .ui-badge,
body[data-theme="dark"] .ui-badge,
html[data-theme="dark"] .widget-pill,
body[data-theme="dark"] .widget-pill,
html[data-theme="dark"] .row-chip,
body[data-theme="dark"] .row-chip,
html[data-theme="dark"] .calc-chip,
body[data-theme="dark"] .calc-chip,
html[data-theme="dark"] .trade-side,
body[data-theme="dark"] .trade-side,
html[data-theme="dark"] .risk-status-badge,
body[data-theme="dark"] .risk-status-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.045) !important;
  border: 1px solid var(--kmfx-border) !important;
  color: var(--text-1) !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.kmfx-pill--positive,
html[data-theme="dark"] .ui-badge--ok,
body[data-theme="dark"] .ui-badge--ok,
html[data-theme="dark"] .trade-side--buy,
body[data-theme="dark"] .trade-side--buy {
  color: var(--positive) !important;
  background: rgba(52,217,123,0.10) !important;
  border-color: rgba(52,217,123,0.22) !important;
}

.kmfx-pill--warning,
html[data-theme="dark"] .ui-badge--warn,
body[data-theme="dark"] .ui-badge--warn {
  color: var(--warning) !important;
  background: rgba(245,166,35,0.10) !important;
  border-color: rgba(245,166,35,0.22) !important;
}

.kmfx-pill--danger,
html[data-theme="dark"] .ui-badge--error,
body[data-theme="dark"] .ui-badge--error,
html[data-theme="dark"] .trade-side--sell,
body[data-theme="dark"] .trade-side--sell {
  color: color-mix(in srgb, var(--negative) 72%, var(--text-0)) !important;
  background: rgba(255,92,92,0.10) !important;
  border-color: rgba(255,92,92,0.20) !important;
}

html[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .widget-table-wrap,
body[data-theme="dark"] .widget-table-wrap {
  padding: 0 !important;
  overflow: hidden;
}

html[data-theme="dark"] .table-wrap table,
body[data-theme="dark"] .table-wrap table,
html[data-theme="dark"] .widget-table-wrap table,
body[data-theme="dark"] .widget-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .table-wrap th,
body[data-theme="dark"] .table-wrap th,
html[data-theme="dark"] .widget-table-wrap th,
body[data-theme="dark"] .widget-table-wrap th {
  font-size: var(--kmfx-label-size) !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase;
  color: var(--text-2) !important;
  background: transparent !important;
  border-bottom: 1px solid var(--kmfx-border) !important;
}

html[data-theme="dark"] .table-wrap td,
body[data-theme="dark"] .table-wrap td,
html[data-theme="dark"] .widget-table-wrap td,
body[data-theme="dark"] .widget-table-wrap td {
  border-bottom: 1px solid rgba(255,255,255,0.055) !important;
  background: transparent !important;
}

html[data-theme="dark"] .table-wrap tbody tr:hover td,
body[data-theme="dark"] .table-wrap tbody tr:hover td,
html[data-theme="dark"] .widget-table-wrap tbody tr:hover td,
body[data-theme="dark"] .widget-table-wrap tbody tr:hover td,
html[data-theme="dark"] .strategies-table-card tbody tr:hover td,
body[data-theme="dark"] .strategies-table-card tbody tr:hover td {
  background: rgba(255,255,255,0.035) !important;
}

html[data-theme="dark"] .kmfx-chart-shell,
body[data-theme="dark"] .kmfx-chart-shell,
html[data-theme="dark"] .chart-shell,
body[data-theme="dark"] .chart-shell,
html[data-theme="dark"] .weekly-chart-shell,
body[data-theme="dark"] .weekly-chart-shell {
  background: transparent !important;
  border: 1px solid var(--kmfx-border) !important;
  border-radius: var(--kmfx-card-radius) !important;
}

/* --------------------------------------------------------------------------
   Calendario — Lower Analytics
-------------------------------------------------------------------------- */

html[data-theme="dark"] .calendar-cumulative,
body[data-theme="dark"] .calendar-cumulative,
html[data-theme="dark"] .calendar-returns-table,
body[data-theme="dark"] .calendar-returns-table {
  overflow: hidden;
}

html[data-theme="dark"] .calendar-cumulative .calendar-panel-head,
body[data-theme="dark"] .calendar-cumulative .calendar-panel-head,
html[data-theme="dark"] .calendar-returns-table .calendar-panel-head,
body[data-theme="dark"] .calendar-returns-table .calendar-panel-head {
  align-items: start;
  margin-bottom: 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
}

html[data-theme="dark"] .calendar-cumulative .calendar-panel-title,
body[data-theme="dark"] .calendar-cumulative .calendar-panel-title,
html[data-theme="dark"] .calendar-returns-table .calendar-panel-title,
body[data-theme="dark"] .calendar-returns-table .calendar-panel-title {
  font-size: 16px;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

html[data-theme="dark"] .calendar-cumulative .calendar-panel-sub,
body[data-theme="dark"] .calendar-cumulative .calendar-panel-sub,
html[data-theme="dark"] .calendar-returns-table .calendar-panel-sub,
body[data-theme="dark"] .calendar-returns-table .calendar-panel-sub {
  max-width: 720px;
  color: var(--muted-foreground);
}

html[data-theme="dark"] .calendar-cumulative__chart,
body[data-theme="dark"] .calendar-cumulative__chart {
  min-width: 0;
  padding: 6px 2px 0;
}

html[data-theme="dark"] .calendar-cumulative__chart .kmfx-chart-shell,
body[data-theme="dark"] .calendar-cumulative__chart .kmfx-chart-shell {
  min-height: 220px;
  border-color: color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: var(--radius-lg);
}

html[data-theme="dark"] .calendar-returns-table__wrap,
body[data-theme="dark"] .calendar-returns-table__wrap {
  border-radius: var(--radius-lg);
  overflow: auto;
}

html[data-theme="dark"] .calendar-returns-table__table,
body[data-theme="dark"] .calendar-returns-table__table {
  min-width: 860px;
}

html[data-theme="dark"] .calendar-returns-table__table th,
body[data-theme="dark"] .calendar-returns-table__table th {
  height: 38px;
  white-space: nowrap;
}

html[data-theme="dark"] .calendar-returns-table__table td,
body[data-theme="dark"] .calendar-returns-table__table td {
  height: 40px;
  white-space: nowrap;
}

html[data-theme="dark"] .calendar-returns-table__table th:first-child,
body[data-theme="dark"] .calendar-returns-table__table th:first-child,
html[data-theme="dark"] .calendar-returns-table__table td:first-child,
body[data-theme="dark"] .calendar-returns-table__table td:first-child {
  color: var(--foreground);
  font-weight: 700;
}

html[data-theme="dark"] .calendar-returns-table__table th:last-child,
body[data-theme="dark"] .calendar-returns-table__table th:last-child,
html[data-theme="dark"] .calendar-returns-table__table td:last-child,
body[data-theme="dark"] .calendar-returns-table__table td:last-child {
  text-align: right;
}

html[data-theme="dark"] .calendar-returns-table__table tbody tr:hover td,
body[data-theme="dark"] .calendar-returns-table__table tbody tr:hover td {
  background: color-mix(in srgb, var(--foreground) 2.5%, transparent);
}

html[data-theme="dark"] .calendar-returns-table__table tfoot th,
body[data-theme="dark"] .calendar-returns-table__table tfoot th,
html[data-theme="dark"] .calendar-returns-table__table tfoot td,
body[data-theme="dark"] .calendar-returns-table__table tfoot td {
  height: 42px;
  border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}

/* === EXECUTION FINAL POLISH === */
html[data-theme="dark"] #section-discipline.discipline-page-stack,
body[data-theme="dark"] #section-discipline.discipline-page-stack {
  gap: 24px !important;
}

html[data-theme="dark"] #section-discipline .execution-score-row,
body[data-theme="dark"] #section-discipline .execution-score-row,
html[data-theme="dark"] #section-discipline .execution-main-grid,
body[data-theme="dark"] #section-discipline .execution-main-grid,
html[data-theme="dark"] #section-discipline .execution-main-grid--lower,
body[data-theme="dark"] #section-discipline .execution-main-grid--lower {
  gap: 24px !important;
}

html[data-theme="dark"] #section-discipline .execution-hero,
body[data-theme="dark"] #section-discipline .execution-hero {
  gap: 20px !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid,
body[data-theme="dark"] #section-discipline .execution-kpi-grid {
  gap: 16px !important;
}

html[data-theme="dark"] #section-discipline .execution-score-panel,
body[data-theme="dark"] #section-discipline .execution-score-panel {
  min-height: 0;
}

html[data-theme="dark"] #section-discipline .execution-score-gauge span,
body[data-theme="dark"] #section-discipline .execution-score-gauge span {
  margin-top: 5px;
  color: var(--execution-score-color, var(--text-2));
}

html[data-theme="dark"] #section-discipline .execution-kpi--support,
body[data-theme="dark"] #section-discipline .execution-kpi--support {
  border-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi--support span,
body[data-theme="dark"] #section-discipline .execution-kpi--support span {
  background: rgba(255,255,255,0.035) !important;
  border-color: rgba(255,255,255,0.065) !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi--critical.execution-tone-bad,
body[data-theme="dark"] #section-discipline .execution-kpi--critical.execution-tone-bad {
  border-color: rgba(255,92,92,0.22) !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi--critical.execution-tone-bad span,
body[data-theme="dark"] #section-discipline .execution-kpi--critical.execution-tone-bad span {
  color: rgba(255,92,92,0.55) !important;
  background: rgba(255,92,92,0.08) !important;
  border-color: rgba(255,92,92,0.18) !important;
}

/* === EXECUTION FINAL SCALE === */
html[data-theme="dark"] #section-discipline .execution-hero,
body[data-theme="dark"] #section-discipline .execution-hero {
  padding: 20px !important;
  gap: 16px !important;
}

html[data-theme="dark"] #section-discipline .execution-hero__copy,
body[data-theme="dark"] #section-discipline .execution-hero__copy,
html[data-theme="dark"] #section-discipline .execution-hero__issue,
body[data-theme="dark"] #section-discipline .execution-hero__issue {
  gap: 7px !important;
}

html[data-theme="dark"] #section-discipline .execution-hero__eyebrow,
body[data-theme="dark"] #section-discipline .execution-hero__eyebrow,
html[data-theme="dark"] #section-discipline .execution-hero__issue span,
body[data-theme="dark"] #section-discipline .execution-hero__issue span {
  font-size: 11px !important;
  letter-spacing: 0.18em !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] #section-discipline .execution-hero h3,
body[data-theme="dark"] #section-discipline .execution-hero h3 {
  font-size: 24px !important;
  line-height: 1.15 !important;
  font-weight: 750 !important;
  letter-spacing: -0.025em !important;
}

html[data-theme="dark"] #section-discipline .execution-hero p,
body[data-theme="dark"] #section-discipline .execution-hero p {
  font-size: 15px !important;
  line-height: 1.42 !important;
}

html[data-theme="dark"] #section-discipline .execution-hero__issue,
body[data-theme="dark"] #section-discipline .execution-hero__issue {
  padding: 16px !important;
}

html[data-theme="dark"] #section-discipline .execution-hero__issue strong,
body[data-theme="dark"] #section-discipline .execution-hero__issue strong {
  font-size: 18px !important;
  line-height: 1.18 !important;
}

html[data-theme="dark"] #section-discipline .execution-score-body,
body[data-theme="dark"] #section-discipline .execution-score-body {
  grid-template-columns: 132px minmax(240px, 360px) minmax(220px, 1fr) !important;
  gap: 18px !important;
  justify-content: stretch;
  align-items: center;
}

html[data-theme="dark"] #section-discipline .execution-subscore-list,
body[data-theme="dark"] #section-discipline .execution-subscore-list {
  max-width: 360px;
  gap: 7px 12px !important;
}

html[data-theme="dark"] #section-discipline .execution-subscore,
body[data-theme="dark"] #section-discipline .execution-subscore {
  gap: 12px !important;
  padding-bottom: 5px !important;
}

html[data-theme="dark"] #section-discipline .execution-data-pill,
body[data-theme="dark"] #section-discipline .execution-data-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(245,166,35,0.18);
  border-radius: 999px;
  background: rgba(245,166,35,0.08);
  color: color-mix(in srgb, var(--warning) 72%, var(--text-1));
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

html[data-theme="dark"] #section-discipline .execution-score-reading,
body[data-theme="dark"] #section-discipline .execution-score-reading {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--border-0);
  border-radius: 16px;
  background: var(--layer-1);
}

html[data-theme="dark"] #section-discipline .execution-score-reading span,
body[data-theme="dark"] #section-discipline .execution-score-reading span {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-score-reading p,
body[data-theme="dark"] #section-discipline .execution-score-reading p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-system-insight,
body[data-theme="dark"] #section-discipline .execution-system-insight {
  gap: 4px !important;
  padding-top: 12px !important;
}

html[data-theme="dark"] #section-discipline .execution-system-insight p,
body[data-theme="dark"] #section-discipline .execution-system-insight p {
  font-size: 12px !important;
  line-height: 1.45 !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty,
body[data-theme="dark"] #section-discipline .execution-entry-empty {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--border-0);
  border-radius: 16px;
  background: var(--layer-1);
}

html[data-theme="dark"] #section-discipline .execution-entry-empty strong,
body[data-theme="dark"] #section-discipline .execution-entry-empty strong {
  font-size: 15px;
  line-height: 1.2;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .execution-entry-empty p,
body[data-theme="dark"] #section-discipline .execution-entry-empty p,
html[data-theme="dark"] #section-discipline .execution-entry-empty small,
body[data-theme="dark"] #section-discipline .execution-entry-empty small {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .execution-entry-empty small,
body[data-theme="dark"] #section-discipline .execution-entry-empty small {
  color: var(--text-3);
}

/* === RULE PROFILES === */
html[data-theme="dark"] #section-discipline #discipline-profile-manager,
body[data-theme="dark"] #section-discipline #discipline-profile-manager {
  position: relative;
  z-index: 20;
  display: grid;
}

html[data-theme="dark"] #section-discipline .rule-profile-manager,
body[data-theme="dark"] #section-discipline .rule-profile-manager {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--border-0);
  border-radius: 16px;
  background: var(--layer-1);
}

html[data-theme="dark"] #section-discipline .rule-profile-manager__head,
body[data-theme="dark"] #section-discipline .rule-profile-manager__head,
html[data-theme="dark"] #section-discipline .rule-profile-editor__head,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head,
html[data-theme="dark"] #section-discipline .rule-profile-accounts,
body[data-theme="dark"] #section-discipline .rule-profile-accounts {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

html[data-theme="dark"] #section-discipline .rule-profile-manager__head span,
body[data-theme="dark"] #section-discipline .rule-profile-manager__head span,
html[data-theme="dark"] #section-discipline .rule-profile-editor__head span,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head span,
html[data-theme="dark"] #section-discipline .rule-profile-accounts span,
body[data-theme="dark"] #section-discipline .rule-profile-accounts span {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-manager__head strong,
body[data-theme="dark"] #section-discipline .rule-profile-manager__head strong,
html[data-theme="dark"] #section-discipline .rule-profile-editor__head strong,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head strong,
html[data-theme="dark"] #section-discipline .rule-profile-accounts strong,
body[data-theme="dark"] #section-discipline .rule-profile-accounts strong {
  display: block;
  font-size: 18px;
  line-height: 1.15;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-manager__head p,
body[data-theme="dark"] #section-discipline .rule-profile-manager__head p,
html[data-theme="dark"] #section-discipline .rule-profile-editor__head p,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head p,
html[data-theme="dark"] #section-discipline .rule-profile-accounts p,
body[data-theme="dark"] #section-discipline .rule-profile-accounts p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-action,
body[data-theme="dark"] #section-discipline .rule-profile-action,
html[data-theme="dark"] #section-discipline .rule-profile-account-form button,
body[data-theme="dark"] #section-discipline .rule-profile-account-form button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--text-0);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-cards,
body[data-theme="dark"] #section-discipline .rule-profile-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

html[data-theme="dark"] #section-discipline .rule-profile-card,
body[data-theme="dark"] #section-discipline .rule-profile-card {
  position: relative;
  min-height: 112px;
  display: grid;
  gap: 7px;
  align-content: start;
  text-align: left;
  padding: 14px;
  border: 1px solid var(--border-0);
  border-radius: 16px;
  background: var(--layer-1);
  color: inherit;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-card__select,
body[data-theme="dark"] #section-discipline .rule-profile-card__select {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-menu-trigger,
body[data-theme="dark"] #section-discipline .rule-profile-menu-trigger {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-menu-trigger:hover,
body[data-theme="dark"] #section-discipline .rule-profile-menu-trigger:hover,
html[data-theme="dark"] #section-discipline .rule-profile-card.menu-open .rule-profile-menu-trigger,
body[data-theme="dark"] #section-discipline .rule-profile-card.menu-open .rule-profile-menu-trigger {
  border-color: var(--border-0);
  background: rgba(255,255,255,0.045);
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-menu,
body[data-theme="dark"] #section-discipline .rule-profile-menu {
  position: absolute;
  top: 42px;
  right: 10px;
  z-index: 6;
  min-width: 180px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--border-0);
  border-radius: 12px;
  background: var(--layer-1);
  box-shadow: none;
}

html[data-theme="dark"] #section-discipline .rule-profile-menu button,
body[data-theme="dark"] #section-discipline .rule-profile-menu button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-1);
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-menu button:hover,
body[data-theme="dark"] #section-discipline .rule-profile-menu button:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-menu button.danger,
body[data-theme="dark"] #section-discipline .rule-profile-menu button.danger {
  color: rgba(255,92,92,0.72);
}

html[data-theme="dark"] #section-discipline .rule-profile-menu button.danger:hover,
body[data-theme="dark"] #section-discipline .rule-profile-menu button.danger:hover {
  background: rgba(255,92,92,0.08);
}

html[data-theme="dark"] #section-discipline .rule-profile-add-rule,
body[data-theme="dark"] #section-discipline .rule-profile-add-rule {
  position: relative;
}

html[data-theme="dark"] #section-discipline .rule-profile-add-menu,
body[data-theme="dark"] #section-discipline .rule-profile-add-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 8;
  width: min(360px, 78vw);
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--border-0);
  border-radius: 12px;
  background: var(--layer-1);
  box-shadow: none;
}

html[data-theme="dark"] #section-discipline .rule-profile-add-separator,
body[data-theme="dark"] #section-discipline .rule-profile-add-separator {
  height: 1px;
  margin: 4px 8px;
  background: var(--border-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-add-menu > span,
body[data-theme="dark"] #section-discipline .rule-profile-add-menu > span {
  padding: 8px 9px 3px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-add-menu button,
body[data-theme="dark"] #section-discipline .rule-profile-add-menu button {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  align-items: center;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-1);
  text-align: left;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-add-menu button:hover,
body[data-theme="dark"] #section-discipline .rule-profile-add-menu button:hover {
  background: rgba(255,255,255,0.04);
}

html[data-theme="dark"] #section-discipline .rule-profile-add-menu .rule-profile-add-create,
body[data-theme="dark"] #section-discipline .rule-profile-add-menu .rule-profile-add-create {
  min-height: 44px;
}

html[data-theme="dark"] #section-discipline .rule-profile-add-menu button:disabled,
body[data-theme="dark"] #section-discipline .rule-profile-add-menu button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

html[data-theme="dark"] #section-discipline .rule-profile-add-menu strong,
body[data-theme="dark"] #section-discipline .rule-profile-add-menu strong {
  font-size: 13px;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-add-menu small,
body[data-theme="dark"] #section-discipline .rule-profile-add-menu small {
  grid-column: 1 / -1;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-add-menu em,
body[data-theme="dark"] #section-discipline .rule-profile-add-menu em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] #section-discipline .rule-profile-add-menu p,
body[data-theme="dark"] #section-discipline .rule-profile-add-menu p {
  margin: 0;
  padding: 9px 10px;
  font-size: 12px;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-menu button:disabled,
body[data-theme="dark"] #section-discipline .rule-profile-menu button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

html[data-theme="dark"] #section-discipline .rule-profile-confirm,
body[data-theme="dark"] #section-discipline .rule-profile-confirm {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 10px;
  border-top: 1px solid var(--border-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-confirm strong,
body[data-theme="dark"] #section-discipline .rule-profile-confirm strong {
  font-size: 13px;
  line-height: 1.2;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-confirm p,
body[data-theme="dark"] #section-discipline .rule-profile-confirm p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-confirm div,
body[data-theme="dark"] #section-discipline .rule-profile-confirm div {
  display: flex;
  gap: 8px;
}

html[data-theme="dark"] #section-discipline .rule-profile-name-input,
body[data-theme="dark"] #section-discipline .rule-profile-name-input {
  min-height: 32px;
  width: min(100%, 220px);
  padding: 0 9px;
  border: 1px solid var(--border-0);
  border-radius: 10px;
  background: rgba(255,255,255,0.045);
  color: var(--text-0);
  font-size: 14px;
  font-weight: 750;
}

html[data-theme="dark"] #section-discipline .rule-profile-card.is-active,
body[data-theme="dark"] #section-discipline .rule-profile-card.is-active {
  border-color: color-mix(in srgb, var(--rule-profile-color) 62%, rgba(255,255,255,0.12));
}

html[data-theme="dark"] #section-discipline .rule-profile-card--new,
body[data-theme="dark"] #section-discipline .rule-profile-card--new {
  border-style: dashed;
  background: rgba(255,255,255,0.025);
}

html[data-theme="dark"] #section-discipline .rule-profile-card span,
body[data-theme="dark"] #section-discipline .rule-profile-card span,
html[data-theme="dark"] #section-discipline .rule-profile-badge,
body[data-theme="dark"] #section-discipline .rule-profile-badge {
  width: fit-content;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-card strong,
body[data-theme="dark"] #section-discipline .rule-profile-card strong {
  font-size: 15px;
  line-height: 1.2;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-card small,
body[data-theme="dark"] #section-discipline .rule-profile-card small {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-editor,
body[data-theme="dark"] #section-discipline .rule-profile-editor {
  display: grid;
  gap: 14px;
  padding-top: 2px;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-list,
body[data-theme="dark"] #section-discipline .rule-profile-rule-list {
  display: grid;
  gap: 14px;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-group,
body[data-theme="dark"] #section-discipline .rule-profile-rule-group {
  display: grid;
  gap: 8px;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-group > span,
body[data-theme="dark"] #section-discipline .rule-profile-rule-group > span {
  padding-left: 2px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

html[data-theme="dark"] #section-discipline .rule-profile-rule,
body[data-theme="dark"] #section-discipline .rule-profile-rule {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 132px 30px 30px;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
  overflow: visible;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule.is-weight-open,
body[data-theme="dark"] #section-discipline .rule-profile-rule.is-weight-open,
html[data-theme="dark"] #section-discipline .rule-profile-rule.custom-menu-open,
body[data-theme="dark"] #section-discipline .rule-profile-rule.custom-menu-open {
  z-index: 30;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule.is-absolute,
body[data-theme="dark"] #section-discipline .rule-profile-rule.is-absolute {
  border-color: rgba(255,45,45,0.5);
  background: rgba(255,45,45,0.05);
}

html[data-theme="dark"] #section-discipline .rule-profile-rule.is-critical,
body[data-theme="dark"] #section-discipline .rule-profile-rule.is-critical {
  border-color: rgba(255,92,92,0.35);
}

html[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet,
body[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet {
  border-color: rgba(255,255,255,0.045);
}

html[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet .rule-profile-toggle,
body[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet .rule-profile-toggle,
html[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet .rule-profile-rule__copy,
body[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet .rule-profile-rule__copy,
html[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet .rule-profile-badge,
body[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet .rule-profile-badge,
html[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet .rule-profile-weight__trigger,
body[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet .rule-profile-weight__trigger,
html[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet .rule-profile-remove,
body[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet .rule-profile-remove {
  opacity: 0.85;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet.is-weight-open .rule-profile-weight__trigger,
body[data-theme="dark"] #section-discipline .rule-profile-rule.is-quiet.is-weight-open .rule-profile-weight__trigger {
  opacity: 1;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-form,
body[data-theme="dark"] #section-discipline .rule-profile-custom-form {
  display: grid;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--border-0);
  border-radius: 16px;
  background: rgba(255,255,255,0.026);
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-form__head,
body[data-theme="dark"] #section-discipline .rule-profile-custom-form__head,
html[data-theme="dark"] #section-discipline .rule-profile-custom-form__footer,
body[data-theme="dark"] #section-discipline .rule-profile-custom-form__footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-form__head span,
body[data-theme="dark"] #section-discipline .rule-profile-custom-form__head span,
html[data-theme="dark"] #section-discipline .rule-profile-custom-grid label > span,
body[data-theme="dark"] #section-discipline .rule-profile-custom-grid label > span {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-form__head strong,
body[data-theme="dark"] #section-discipline .rule-profile-custom-form__head strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-form__head p,
body[data-theme="dark"] #section-discipline .rule-profile-custom-form__head p,
html[data-theme="dark"] #section-discipline .rule-profile-custom-form__footer p,
body[data-theme="dark"] #section-discipline .rule-profile-custom-form__footer p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-grid,
body[data-theme="dark"] #section-discipline .rule-profile-custom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-grid__wide,
body[data-theme="dark"] #section-discipline .rule-profile-custom-grid__wide,
html[data-theme="dark"] #section-discipline .rule-profile-custom-numeric,
body[data-theme="dark"] #section-discipline .rule-profile-custom-numeric {
  grid-column: 1 / -1;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-numeric,
body[data-theme="dark"] #section-discipline .rule-profile-custom-numeric {
  display: none;
  grid-template-columns: 0.65fr 1fr 1fr;
  gap: 10px;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-numeric.is-visible,
body[data-theme="dark"] #section-discipline .rule-profile-custom-numeric.is-visible {
  display: grid;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-grid input,
body[data-theme="dark"] #section-discipline .rule-profile-custom-grid input,
html[data-theme="dark"] #section-discipline .rule-profile-custom-grid select,
body[data-theme="dark"] #section-discipline .rule-profile-custom-grid select,
html[data-theme="dark"] #section-discipline .rule-profile-custom-grid textarea,
body[data-theme="dark"] #section-discipline .rule-profile-custom-grid textarea {
  width: 100%;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border-0);
  border-radius: 11px;
  background: rgba(255,255,255,0.035);
  color: var(--text-0);
  font: inherit;
  font-size: 13px;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-grid textarea,
body[data-theme="dark"] #section-discipline .rule-profile-custom-grid textarea {
  min-height: 58px;
  padding-top: 9px;
  resize: vertical;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-form button,
body[data-theme="dark"] #section-discipline .rule-profile-custom-form button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-0);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--text-0);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-form__footer button,
body[data-theme="dark"] #section-discipline .rule-profile-custom-form__footer button {
  background: rgba(52,217,123,0.13);
  border-color: rgba(52,217,123,0.22);
  color: color-mix(in srgb, var(--positive) 76%, var(--text-0));
}

html[data-theme="dark"] #section-discipline .rule-profile-rule.is-disabled,
body[data-theme="dark"] #section-discipline .rule-profile-rule.is-disabled {
  opacity: 0.4;
}

html[data-theme="dark"] #section-discipline .rule-profile-toggle,
body[data-theme="dark"] #section-discipline .rule-profile-toggle {
  position: relative;
  display: inline-grid;
  width: 34px;
  height: 22px;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-toggle input,
body[data-theme="dark"] #section-discipline .rule-profile-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

html[data-theme="dark"] #section-discipline .rule-profile-toggle span,
body[data-theme="dark"] #section-discipline .rule-profile-toggle span {
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
}

html[data-theme="dark"] #section-discipline .rule-profile-toggle span::after,
body[data-theme="dark"] #section-discipline .rule-profile-toggle span::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 3px;
  left: 3px;
  border-radius: 999px;
  background: var(--text-1);
  transition: transform 160ms ease;
}

html[data-theme="dark"] #section-discipline .rule-profile-toggle input:checked + span,
body[data-theme="dark"] #section-discipline .rule-profile-toggle input:checked + span {
  background: rgba(52,217,123,0.28);
}

html[data-theme="dark"] #section-discipline .rule-profile-toggle input:checked + span::after,
body[data-theme="dark"] #section-discipline .rule-profile-toggle input:checked + span::after {
  transform: translateX(12px);
  background: color-mix(in srgb, var(--positive) 82%, var(--text-1));
}

html[data-theme="dark"] #section-discipline .rule-profile-rule__copy strong,
body[data-theme="dark"] #section-discipline .rule-profile-rule__copy strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-rule__copy p,
body[data-theme="dark"] #section-discipline .rule-profile-rule__copy p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-badge,
body[data-theme="dark"] #section-discipline .rule-profile-badge {
  padding: 6px 8px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
}

html[data-theme="dark"] #section-discipline .rule-profile-badge--auto,
body[data-theme="dark"] #section-discipline .rule-profile-badge--auto {
  border-color: rgba(47,107,255,0.35);
  background: rgba(47,107,255,0.08);
  color: rgba(120,160,255,0.95);
}

html[data-theme="dark"] #section-discipline .rule-profile-badge--manual,
body[data-theme="dark"] #section-discipline .rule-profile-badge--manual {
  border-color: rgba(245,166,35,0.30);
  background: rgba(245,166,35,0.08);
  color: rgba(245,166,35,0.95);
}

html[data-theme="dark"] #section-discipline .rule-profile-badge--mixed,
body[data-theme="dark"] #section-discipline .rule-profile-badge--mixed {
  border-color: rgba(160,120,255,0.30);
  background: rgba(160,120,255,0.08);
  color: rgba(190,165,255,0.95);
}

html[data-theme="dark"] #section-discipline .rule-profile-weight,
body[data-theme="dark"] #section-discipline .rule-profile-weight {
  position: relative;
  z-index: 2;
}

html[data-theme="dark"] #section-discipline .rule-profile-weight__trigger,
body[data-theme="dark"] #section-discipline .rule-profile-weight__trigger {
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  color: var(--text-1);
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-weight__trigger:hover,
body[data-theme="dark"] #section-discipline .rule-profile-weight__trigger:hover {
  background: rgba(255,255,255,0.04);
}

html[data-theme="dark"] #section-discipline .rule-profile-weight__trigger b,
body[data-theme="dark"] #section-discipline .rule-profile-weight__trigger b {
  font-size: 12px;
  color: var(--rule-weight-color, var(--text-1));
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] #section-discipline .rule-profile-weight__trigger span,
body[data-theme="dark"] #section-discipline .rule-profile-weight__trigger span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-weight__trigger i,
body[data-theme="dark"] #section-discipline .rule-profile-weight__trigger i {
  font-style: normal;
  color: var(--text-3);
}

html[data-theme="dark"] #section-discipline .rule-profile-weight-menu,
body[data-theme="dark"] #section-discipline .rule-profile-weight-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  min-width: 260px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: #181818;
  box-shadow: 0 12px 32px rgba(0,0,0,0.28);
  overflow: hidden;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-group:last-child .rule-profile-weight-menu,
body[data-theme="dark"] #section-discipline .rule-profile-rule-group:last-child .rule-profile-weight-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

html[data-theme="dark"] #section-discipline .rule-profile-weight-menu button,
body[data-theme="dark"] #section-discipline .rule-profile-weight-menu button {
  height: 40px;
  min-height: 40px;
  display: grid;
  grid-template-columns: 8px auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: #181818;
  color: var(--text-1);
  text-align: left;
  white-space: nowrap;
  line-height: 1;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-weight-menu button:hover,
body[data-theme="dark"] #section-discipline .rule-profile-weight-menu button:hover {
  background: #202020;
}

html[data-theme="dark"] #section-discipline .rule-profile-weight-menu button.is-selected,
body[data-theme="dark"] #section-discipline .rule-profile-weight-menu button.is-selected {
  background: #242424;
}

html[data-theme="dark"] #section-discipline .rule-profile-weight-menu i,
body[data-theme="dark"] #section-discipline .rule-profile-weight-menu i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--rule-weight-option-color, var(--text-2));
}

html[data-theme="dark"] #section-discipline .rule-profile-weight-menu strong,
body[data-theme="dark"] #section-discipline .rule-profile-weight-menu strong {
  font-size: 12px;
  color: var(--text-0);
  line-height: 1;
}

html[data-theme="dark"] #section-discipline .rule-profile-weight-menu b,
body[data-theme="dark"] #section-discipline .rule-profile-weight-menu b {
  font-size: 12px;
  color: var(--rule-weight-option-color, var(--text-1));
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

html[data-theme="dark"] #section-discipline .rule-profile-weight-menu span,
body[data-theme="dark"] #section-discipline .rule-profile-weight-menu span {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-actions,
body[data-theme="dark"] #section-discipline .rule-profile-custom-actions {
  position: relative;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-menu-trigger,
body[data-theme="dark"] #section-discipline .rule-profile-custom-menu-trigger {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-menu-trigger:hover,
body[data-theme="dark"] #section-discipline .rule-profile-custom-menu-trigger:hover,
html[data-theme="dark"] #section-discipline .rule-profile-rule.custom-menu-open .rule-profile-custom-menu-trigger,
body[data-theme="dark"] #section-discipline .rule-profile-rule.custom-menu-open .rule-profile-custom-menu-trigger {
  border-color: var(--border-0);
  background: rgba(255,255,255,0.045);
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-menu,
body[data-theme="dark"] #section-discipline .rule-profile-custom-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 8;
  min-width: 184px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--border-0);
  border-radius: 12px;
  background: var(--layer-1);
  box-shadow: none;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-menu > button,
body[data-theme="dark"] #section-discipline .rule-profile-custom-menu > button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-1);
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-menu > button:hover,
body[data-theme="dark"] #section-discipline .rule-profile-custom-menu > button:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-menu > button.danger,
body[data-theme="dark"] #section-discipline .rule-profile-custom-menu > button.danger {
  color: rgba(255,92,92,0.72);
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-menu > button.danger:hover,
body[data-theme="dark"] #section-discipline .rule-profile-custom-menu > button.danger:hover {
  background: rgba(255,92,92,0.08);
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-confirm,
body[data-theme="dark"] #section-discipline .rule-profile-custom-confirm {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 10px;
  border-top: 1px solid var(--border-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-confirm strong,
body[data-theme="dark"] #section-discipline .rule-profile-custom-confirm strong {
  font-size: 13px;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-confirm p,
body[data-theme="dark"] #section-discipline .rule-profile-custom-confirm p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-confirm div,
body[data-theme="dark"] #section-discipline .rule-profile-custom-confirm div {
  display: grid;
  gap: 6px;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-confirm button,
body[data-theme="dark"] #section-discipline .rule-profile-custom-confirm button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-0);
  border-radius: 9px;
  background: rgba(255,255,255,0.035);
  color: var(--text-1);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-custom-confirm button.danger,
body[data-theme="dark"] #section-discipline .rule-profile-custom-confirm button.danger {
  border-color: rgba(255,92,92,0.18);
  background: rgba(255,92,92,0.08);
  color: rgba(255,92,92,0.72);
}

html[data-theme="dark"] #section-discipline .rule-profile-remove,
body[data-theme="dark"] #section-discipline .rule-profile-remove {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-remove:hover,
body[data-theme="dark"] #section-discipline .rule-profile-remove:hover {
  border-color: rgba(255,92,92,0.16);
  background: rgba(255,92,92,0.08);
  color: rgba(255,92,92,0.72);
}

html[data-theme="dark"] #section-discipline .rule-profile-remove:disabled,
body[data-theme="dark"] #section-discipline .rule-profile-remove:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-confirm,
body[data-theme="dark"] #section-discipline .rule-profile-rule-confirm {
  grid-column: 2 / -1;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.065);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-confirm strong,
body[data-theme="dark"] #section-discipline .rule-profile-rule-confirm strong {
  font-size: 13px;
  color: var(--text-0);
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-confirm p,
body[data-theme="dark"] #section-discipline .rule-profile-rule-confirm p {
  margin: 0;
  font-size: 12px;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-confirm div,
body[data-theme="dark"] #section-discipline .rule-profile-rule-confirm div {
  display: flex;
  gap: 8px;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-confirm button,
body[data-theme="dark"] #section-discipline .rule-profile-rule-confirm button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-0);
  border-radius: 9px;
  background: rgba(255,255,255,0.035);
  color: var(--text-1);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-confirm button.danger,
body[data-theme="dark"] #section-discipline .rule-profile-rule-confirm button.danger {
  border-color: rgba(255,92,92,0.18);
  color: rgba(255,92,92,0.72);
  background: rgba(255,92,92,0.08);
}

html[data-theme="dark"] #section-discipline .rule-profile-warnings,
body[data-theme="dark"] #section-discipline .rule-profile-warnings {
  display: grid;
  gap: 6px;
}

html[data-theme="dark"] #section-discipline .rule-profile-warnings p,
body[data-theme="dark"] #section-discipline .rule-profile-warnings p {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid rgba(245,166,35,0.18);
  border-radius: 12px;
  background: rgba(245,166,35,0.08);
  color: color-mix(in srgb, var(--warning) 72%, var(--text-1));
  font-size: 12px;
  line-height: 1.4;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs,
body[data-theme="dark"] #section-discipline .rule-profile-pairs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-0);
  border-radius: 14px;
  background: rgba(255,255,255,0.018);
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs span,
body[data-theme="dark"] #section-discipline .rule-profile-pairs span {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs p,
body[data-theme="dark"] #section-discipline .rule-profile-pairs p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__control,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__control {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills span,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0 8px 0 9px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--text-1);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills button,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills button {
  border: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs input,
body[data-theme="dark"] #section-discipline .rule-profile-pairs input {
  width: min(180px, 100%);
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-0);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
  color: var(--text-0);
}

@media (max-width: 780px) {
  html[data-theme="dark"] #section-discipline .rule-profile-pairs,
  body[data-theme="dark"] #section-discipline .rule-profile-pairs {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  html[data-theme="dark"] #section-discipline .rule-profile-pairs__control,
  body[data-theme="dark"] #section-discipline .rule-profile-pairs__control,
  html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills,
  body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills {
    justify-content: flex-start;
  }
}

html[data-theme="dark"] #section-discipline .rule-profile-account-form input,
body[data-theme="dark"] #section-discipline .rule-profile-account-form input {
  min-height: 34px;
  border: 1px solid var(--border-0);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
  color: var(--text-0);
  padding: 0 10px;
}

html[data-theme="dark"] #section-discipline .rule-profile-account-form,
body[data-theme="dark"] #section-discipline .rule-profile-account-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

html[data-theme="dark"] #section-discipline .rule-profile-account-form button,
body[data-theme="dark"] #section-discipline .rule-profile-account-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  html[data-theme="dark"] #section-discipline .rule-profile-cards,
  body[data-theme="dark"] #section-discipline .rule-profile-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="dark"] #section-discipline .rule-profile-rule,
  body[data-theme="dark"] #section-discipline .rule-profile-rule {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  html[data-theme="dark"] #section-discipline .rule-profile-badge,
  body[data-theme="dark"] #section-discipline .rule-profile-badge,
  html[data-theme="dark"] #section-discipline .rule-profile-weight,
  body[data-theme="dark"] #section-discipline .rule-profile-weight,
  html[data-theme="dark"] #section-discipline .rule-profile-custom-actions,
  body[data-theme="dark"] #section-discipline .rule-profile-custom-actions,
  html[data-theme="dark"] #section-discipline .rule-profile-rule-confirm,
  body[data-theme="dark"] #section-discipline .rule-profile-rule-confirm {
    grid-column: 2 / -1;
  }
}

@media (max-width: 720px) {
  html[data-theme="dark"] #section-discipline .rule-profile-cards,
  body[data-theme="dark"] #section-discipline .rule-profile-cards,
  html[data-theme="dark"] #section-discipline .rule-profile-manager__head,
  body[data-theme="dark"] #section-discipline .rule-profile-manager__head,
  html[data-theme="dark"] #section-discipline .rule-profile-editor__head,
  body[data-theme="dark"] #section-discipline .rule-profile-editor__head,
  html[data-theme="dark"] #section-discipline .rule-profile-accounts,
  body[data-theme="dark"] #section-discipline .rule-profile-accounts {
    grid-template-columns: 1fr;
    display: grid;
  }
}

/* === VISUAL CONSISTENCY FIXES === */
html[data-theme="dark"] #section-discipline #discipline-score-card,
body[data-theme="dark"] #section-discipline #discipline-score-card,
html[data-theme="dark"] #section-discipline #entry-precision-card,
body[data-theme="dark"] #section-discipline #entry-precision-card {
  padding: 16px 20px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-body,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-body {
  gap: 14px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore-list,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore-list {
  row-gap: 6px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight {
  margin-top: 12px !important;
  padding-top: 10px !important;
}

html[data-theme="dark"] #section-discipline #entry-precision-card,
body[data-theme="dark"] #section-discipline #entry-precision-card {
  gap: 8px !important;
}

html[data-theme="dark"] #section-discipline #entry-precision-card .execution-entry-pattern,
body[data-theme="dark"] #section-discipline #entry-precision-card .execution-entry-pattern,
html[data-theme="dark"] #section-discipline #entry-precision-card .execution-entry-empty,
body[data-theme="dark"] #section-discipline #entry-precision-card .execution-entry-empty {
  padding: 12px 14px !important;
}

html[data-theme="dark"] #section-discipline #kpi-rule-adherence,
body[data-theme="dark"] #section-discipline #kpi-rule-adherence,
html[data-theme="dark"] #section-discipline #kpi-entry-precision,
body[data-theme="dark"] #section-discipline #kpi-entry-precision,
html[data-theme="dark"] #section-discipline #kpi-sl-violations,
body[data-theme="dark"] #section-discipline #kpi-sl-violations,
html[data-theme="dark"] #section-discipline #kpi-off-hours,
body[data-theme="dark"] #section-discipline #kpi-off-hours {
  min-height: 0 !important;
  padding: 14px 16px !important;
}

html[data-theme="dark"] #section-discipline .kpi-card .kpi-value,
body[data-theme="dark"] #section-discipline .kpi-card .kpi-value {
  font-size: 28px !important;
  font-weight: 500 !important;
  line-height: 1.1 !important;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] #section-discipline .kpi-card .kpi-label,
body[data-theme="dark"] #section-discipline .kpi-card .kpi-label {
  font-size: 10px !important;
  text-transform: uppercase;
  letter-spacing: 0.06em !important;
  color: var(--color-text-tertiary, var(--text-2)) !important;
}

html[data-theme="dark"] #section-discipline .kpi-card .kpi-sub,
body[data-theme="dark"] #section-discipline .kpi-card .kpi-sub {
  margin-top: 4px !important;
  font-size: 11px !important;
  color: var(--color-text-tertiary, var(--text-2)) !important;
}

html[data-theme="dark"] #section-discipline .discipline-hero-card,
body[data-theme="dark"] #section-discipline .discipline-hero-card {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 20px !important;
  padding: 16px 20px !important;
}

html[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__eyebrow,
body[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__eyebrow {
  font-size: 10px !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase;
  color: var(--color-text-tertiary, var(--text-2)) !important;
}

html[data-theme="dark"] #section-discipline .discipline-hero-card h3,
body[data-theme="dark"] #section-discipline .discipline-hero-card h3 {
  font-size: 22px !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.02em !important;
}

html[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__copy > p:last-child,
body[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__copy > p:last-child {
  margin-top: 4px !important;
  font-size: 12px !important;
  color: var(--color-text-tertiary, var(--text-2)) !important;
}

html[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__issue,
body[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__issue {
  max-width: 260px !important;
  padding: 10px 14px !important;
  border: 1px solid #2a2a2a !important;
  border-radius: 10px !important;
  background: #1a1a1a !important;
  box-shadow: none !important;
}

html[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__issue span,
body[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__issue span {
  font-size: 10px !important;
  letter-spacing: 0.18em !important;
  color: var(--color-text-tertiary, var(--text-2)) !important;
}

html[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__issue strong,
body[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__issue strong {
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  color: var(--color-text-primary, var(--text-0)) !important;
}

html[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__issue p,
body[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__issue p {
  margin-top: 3px !important;
  font-size: 11px !important;
  color: var(--color-text-tertiary, var(--text-2)) !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending {
  opacity: 0.45;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-name,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-name {
  font-weight: 400;
  color: var(--color-text-secondary, var(--text-2));
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-status,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-status {
  color: var(--color-text-tertiary, var(--text-2));
  font-size: 11px;
  font-weight: 400;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-bar-fill,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-bar-fill {
  width: 0% !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-bar-track,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-bar-track {
  background: #1a1a1a;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row:not(.pending),
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row:not(.pending) {
  opacity: 1;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row:not(.pending) .rule-name,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row:not(.pending) .rule-name {
  font-weight: 500;
  color: var(--color-text-primary, var(--text-0));
}

html[data-theme="dark"] #section-discipline .rule-profile-weight__trigger,
body[data-theme="dark"] #section-discipline .rule-profile-weight__trigger {
  min-width: 0 !important;
  gap: 4px !important;
  padding: 4px 8px !important;
  border: 1px solid #2a2a2a !important;
  border-radius: 6px !important;
  background: transparent !important;
  font-size: 12px !important;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .rule-profile-weight__trigger i,
body[data-theme="dark"] #section-discipline .rule-profile-weight__trigger i {
  font-size: 8px !important;
  color: var(--color-text-tertiary, var(--text-2)) !important;
  opacity: 0.5;
}

html[data-theme="dark"] #section-discipline .execution-heatmap,
body[data-theme="dark"] #section-discipline .execution-heatmap {
  gap: 4px !important;
}

html[data-theme="dark"] #section-discipline .execution-heatmap__weekdays,
body[data-theme="dark"] #section-discipline .execution-heatmap__weekdays,
html[data-theme="dark"] #section-discipline .execution-heatmap__row,
body[data-theme="dark"] #section-discipline .execution-heatmap__row {
  gap: 4px !important;
}

html[data-theme="dark"] #section-discipline .execution-heatmap__cell,
body[data-theme="dark"] #section-discipline .execution-heatmap__cell {
  min-height: 0 !important;
  height: 36px !important;
  border-radius: 8px !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

html[data-theme="dark"] #section-discipline .execution-heatmap__cell.is-today,
body[data-theme="dark"] #section-discipline .execution-heatmap__cell.is-today {
  outline: 2px solid #2F6BFF !important;
}

html[data-theme="dark"] #section-discipline .execution-heatmap__count,
body[data-theme="dark"] #section-discipline .execution-heatmap__count {
  font-size: 10px;
  line-height: 1;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-group--strategy > span,
body[data-theme="dark"] #section-discipline .rule-profile-rule-group--strategy > span,
html[data-theme="dark"] #section-discipline .rule-profile-rule-group--process > span,
body[data-theme="dark"] #section-discipline .rule-profile-rule-group--process > span {
  padding: 14px 0 8px 0 !important;
  border-top: 1px solid #1e1e1e;
  margin-top: 4px;
  font-size: 10px !important;
  text-transform: uppercase;
  letter-spacing: 0.07em !important;
  color: var(--color-text-tertiary, var(--text-2)) !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-group--strategy > span,
body[data-theme="dark"] #section-discipline .rule-profile-rule-group--strategy > span {
  padding-top: 8px !important;
  border-top: 0;
}

@media (max-width: 760px) {
  html[data-theme="dark"] #section-discipline .discipline-hero-card,
  body[data-theme="dark"] #section-discipline .discipline-hero-card {
    align-items: stretch !important;
    flex-direction: column;
  }

  html[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__issue,
  body[data-theme="dark"] #section-discipline .discipline-hero-card .execution-hero__issue {
    max-width: none !important;
  }
}

/* === DISCIPLINE LAYOUT RESTRUCTURE === */
html[data-theme="dark"] #section-discipline,
body[data-theme="dark"] #section-discipline {
  gap: 10px !important;
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 11px 16px !important;
  border: 1px solid #1e1e1e !important;
  border-radius: 10px !important;
  background: #111111 !important;
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert > i,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert > i {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #F5A623;
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert > div:first-of-type,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert > div:first-of-type {
  flex: 1;
  min-width: 0;
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert p,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert p {
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  color: #F5A623 !important;
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert__actions,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert__actions {
  display: inline-flex;
  gap: 8px;
  flex: 0 0 auto;
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert__actions button,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert__actions button {
  padding: 5px 11px !important;
  border: 1px solid #2a2a2a !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #cccccc !important;
  font-size: 11px !important;
  line-height: 1.2;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row,
body[data-theme="dark"] #section-discipline .execution-hero-score-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 10px;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex !important;
  flex-direction: column;
  justify-content: center !important;
  align-items: stretch !important;
  gap: 3px !important;
  margin: 0 !important;
  padding: 14px 16px !important;
  border: 1px solid #1e1e1e !important;
  border-radius: 12px !important;
  background: #111111 !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero__copy,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero__copy {
  gap: 0 !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero__eyebrow,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero__eyebrow {
  margin: 0 0 5px !important;
  font-size: 10px !important;
  letter-spacing: 0.07em !important;
  color: #555555 !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero h3,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero h3 {
  margin: 0 0 3px !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero p,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero p {
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  color: #555555 !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero p span,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero p span {
  color: #FF5C5C;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card,
body[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card {
  flex: 0 0 340px;
  width: auto;
  min-width: 0;
  margin: 0 !important;
  padding: 14px 16px !important;
  border: 1px solid #1e1e1e !important;
  border-radius: 12px !important;
  background: #111111 !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-section-header,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px !important;
  padding: 0 !important;
  border: 0 !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .tl-section-title,
body[data-theme="dark"] #section-discipline #discipline-score-card .tl-section-title {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #cccccc !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-data-pill,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-data-pill {
  min-height: 0 !important;
  padding: 2px 7px !important;
  border: 1px solid rgba(245,166,35,0.2) !important;
  border-radius: 20px !important;
  background: rgba(245,166,35,0.12) !important;
  color: #F5A623 !important;
  font-size: 9px !important;
  line-height: 1.15;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-body,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-body {
  display: flex !important;
  align-items: center !important;
  grid-template-columns: none !important;
  gap: 14px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge {
  flex: 0 0 64px;
  width: 64px !important;
  height: 64px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge circle,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge circle {
  stroke-width: 6 !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge__track,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge__track {
  stroke: #1a1a1a !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge__arc,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge__arc {
  stroke-linecap: round;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge strong,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge strong {
  font-size: 18px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge span,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge span {
  margin-top: 1px !important;
  font-size: 9px !important;
  letter-spacing: 0.03em !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore-list,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore-list {
  flex: 1;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 2px 16px !important;
  max-width: none !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore {
  gap: 8px !important;
  padding: 0 !important;
  border: 0 !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore span,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore span {
  font-size: 11px !important;
  color: #555555 !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore strong,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore strong {
  font-size: 11px !important;
  color: #cccccc !important;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore strong:is(:not(:empty)),
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore strong:is(:not(:empty)) {
  font-weight: 500;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-reading,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-reading {
  display: none !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight {
  display: block !important;
  margin-top: 10px !important;
  padding-top: 10px !important;
  border-top: 1px solid #1a1a1a !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight strong,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight strong,
html[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight p,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight p {
  display: inline;
  margin: 0;
  font-size: 11px !important;
  line-height: 1.35 !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight strong,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight strong {
  color: #555555 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight p,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight p {
  color: #888888 !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight strong::after,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight strong::after {
  content: ": ";
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid,
body[data-theme="dark"] #section-discipline .execution-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0 !important;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid #1e1e1e;
  border-radius: 12px;
  background: #111111;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card {
  min-height: 0 !important;
  padding: 12px 14px !important;
  border: 0 !important;
  border-right: 1px solid #1a1a1a !important;
  border-radius: 0 !important;
  background: transparent !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card:last-child,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card:last-child {
  border-right: 0 !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-label,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-label {
  margin-bottom: 4px !important;
  font-size: 9px !important;
  letter-spacing: 0.06em !important;
  color: #444444 !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-value,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-value {
  font-size: 22px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-value:not(:has(+ *)),
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-value:not(:has(+ *)) {
  font-size: 22px !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-sub,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-sub {
  margin-top: 3px !important;
  font-size: 10px !important;
  color: #444444 !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card > span,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card > span {
  width: fit-content;
  margin-top: 6px;
  padding: 2px 7px;
  font-size: 9px !important;
  border-radius: 999px;
}

html[data-theme="dark"] #section-discipline .execution-main-grid,
body[data-theme="dark"] #section-discipline .execution-main-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: stretch;
  gap: 10px !important;
  margin-bottom: 10px;
}

html[data-theme="dark"] #section-discipline .execution-rules-panel,
body[data-theme="dark"] #section-discipline .execution-rules-panel,
html[data-theme="dark"] #section-discipline .execution-calendar-panel,
body[data-theme="dark"] #section-discipline .execution-calendar-panel {
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid #1e1e1e !important;
  border-radius: 12px !important;
  background: #111111 !important;
}

html[data-theme="dark"] #section-discipline .execution-rules-panel .execution-section-header,
body[data-theme="dark"] #section-discipline .execution-rules-panel .execution-section-header,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-section-header,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-section-header {
  padding: 12px 14px !important;
  border-bottom: 1px solid #1a1a1a !important;
}

html[data-theme="dark"] #section-discipline .execution-rules-panel .tl-section-title,
body[data-theme="dark"] #section-discipline .execution-rules-panel .tl-section-title,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .tl-section-title,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .tl-section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #cccccc !important;
}

html[data-theme="dark"] #section-discipline .execution-rules-panel .tl-section-title::before,
body[data-theme="dark"] #section-discipline .execution-rules-panel .tl-section-title::before,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .tl-section-title::before,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .tl-section-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #2F6BFF;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars,
body[data-theme="dark"] #section-discipline #rule-compliance-bars {
  display: grid;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row {
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid #111111;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row:last-child,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .execution-rule-row__head,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .execution-rule-row__head {
  display: contents !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-name,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px !important;
  font-weight: 500;
  color: #cccccc !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-track,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-track {
  height: 3px !important;
  border-radius: 2px !important;
  background: #1a1a1a !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-fill,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-fill {
  height: 3px !important;
  border-radius: 2px !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-status,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-status {
  width: 36px;
  text-align: right;
  font-size: 11px !important;
  color: #cccccc !important;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row small,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row small {
  display: none !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending {
  opacity: 0.4 !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-name,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-name {
  font-weight: 400;
  color: #444444 !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-status,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-status {
  color: #333333 !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap {
  gap: 0 !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row {
  grid-template-columns: 28px repeat(6, minmax(0, 1fr)) !important;
  gap: 3px !important;
  padding: 0 12px;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays {
  padding-top: 10px;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row {
  margin-top: 3px;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays span,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays span,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row strong,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row strong {
  font-size: 9px !important;
  color: #444444 !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row strong,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row strong {
  text-align: right;
  padding-right: 4px;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell {
  height: 28px !important;
  border-radius: 5px !important;
  border: 0 !important;
  font-size: 9px !important;
  font-weight: 500 !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-ok,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-ok {
  background: rgba(52,217,123,0.65) !important;
  color: #0a2a18;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-warn,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-warn {
  background: rgba(245,166,35,0.60) !important;
  color: #2a1e08;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-bad,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-bad {
  background: rgba(255,92,92,0.55) !important;
  color: #2a0808;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-empty,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-empty {
  background: #161616 !important;
  color: transparent;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.is-today,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.is-today {
  outline: 2px solid #2F6BFF !important;
  outline-offset: 1px !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__legend,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__legend {
  gap: 10px !important;
  padding: 6px 12px 10px !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__legend span,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__legend span {
  gap: 5px;
  font-size: 10px !important;
  color: #444444 !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__legend i,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__legend i {
  width: 7px !important;
  height: 7px !important;
  border-radius: 2px !important;
}

html[data-theme="dark"] #section-discipline .rule-history,
body[data-theme="dark"] #section-discipline .rule-history {
  width: 100%;
}

html[data-theme="dark"] #section-discipline .rule-history__body,
body[data-theme="dark"] #section-discipline .rule-history__body {
  overflow-x: auto !important;
}

html[data-theme="dark"] #section-discipline .rule-history__grid,
body[data-theme="dark"] #section-discipline .rule-history__grid {
  grid-template-columns: minmax(180px, max-content) repeat(var(--rule-history-cols), 52px) !important;
  width: max-content !important;
  min-width: 0 !important;
}

html[data-theme="dark"] #section-discipline .rule-history__cell,
body[data-theme="dark"] #section-discipline .rule-history__cell,
html[data-theme="dark"] #section-discipline .rule-history__week,
body[data-theme="dark"] #section-discipline .rule-history__week {
  min-width: 52px !important;
  max-width: 52px !important;
}

html[data-theme="dark"] #section-discipline .rule-history-detail,
body[data-theme="dark"] #section-discipline .rule-history-detail {
  max-height: 380px;
  overflow-y: auto;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__header,
body[data-theme="dark"] #section-discipline .rule-history-detail__header {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: -16px -16px 0;
  padding: 16px;
  background: #0f0f0f;
  border-bottom: 1px solid #1a1a1a;
}

@media (max-width: 700px) {
  html[data-theme="dark"] #section-discipline .execution-hero-score-row,
  body[data-theme="dark"] #section-discipline .execution-hero-score-row {
    flex-wrap: wrap;
  }

  html[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card,
  body[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card {
    flex: 1 1 100%;
  }

  html[data-theme="dark"] #section-discipline .execution-main-grid,
  body[data-theme="dark"] #section-discipline .execution-main-grid {
    grid-template-columns: 1fr !important;
  }

  html[data-theme="dark"] #section-discipline .execution-kpi-grid,
  body[data-theme="dark"] #section-discipline .execution-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card:nth-child(2n),
  body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card:nth-child(2n) {
    border-right: 0 !important;
  }

  html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card:nth-child(-n+2),
  body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card:nth-child(-n+2) {
    border-bottom: 1px solid #1a1a1a !important;
  }
}

/* KMFX system alignment for the execution layout restructure */
html[data-theme="dark"] #section-discipline .posttrade-tag-alert,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert,
html[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card,
html[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card,
body[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card,
html[data-theme="dark"] #section-discipline .execution-kpi-grid,
body[data-theme="dark"] #section-discipline .execution-kpi-grid,
html[data-theme="dark"] #section-discipline .execution-rules-panel,
body[data-theme="dark"] #section-discipline .execution-rules-panel,
html[data-theme="dark"] #section-discipline .execution-calendar-panel,
body[data-theme="dark"] #section-discipline .execution-calendar-panel {
  background: var(--layer-1) !important;
  border-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-rules-panel .execution-section-header,
body[data-theme="dark"] #section-discipline .execution-rules-panel .execution-section-header,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-section-header,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-section-header,
html[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight,
html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card,
html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row {
  border-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert > i,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert > i,
html[data-theme="dark"] #section-discipline .execution-data-pill,
body[data-theme="dark"] #section-discipline .execution-data-pill {
  background: color-mix(in srgb, var(--warning) 14%, transparent) !important;
  border-color: color-mix(in srgb, var(--warning) 24%, transparent) !important;
  color: var(--warning) !important;
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert > i,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert > i {
  background: var(--warning) !important;
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert p,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert p {
  color: color-mix(in srgb, var(--warning) 76%, var(--text-1)) !important;
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert__actions button,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert__actions button,
html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card > span,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card > span {
  border-color: var(--border-0) !important;
  color: var(--text-1) !important;
}

html[data-theme="dark"] #section-discipline .posttrade-tag-alert__actions button:hover,
body[data-theme="dark"] #section-discipline .posttrade-tag-alert__actions button:hover {
  background: var(--layer-2) !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero__eyebrow,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero__eyebrow,
html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-label,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-label,
html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-sub,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-sub,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays span,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays span,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row strong,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row strong,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__legend span,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__legend span,
html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore span,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore span,
html[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight strong,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight strong,
html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-name,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-name,
html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-status,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row.pending .rule-status {
  color: var(--text-3) !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero h3,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero h3,
html[data-theme="dark"] #section-discipline #discipline-score-card .tl-section-title,
body[data-theme="dark"] #section-discipline #discipline-score-card .tl-section-title,
html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge strong,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge strong,
html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore strong,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore strong,
html[data-theme="dark"] #section-discipline .execution-rules-panel .tl-section-title,
body[data-theme="dark"] #section-discipline .execution-rules-panel .tl-section-title,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .tl-section-title,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .tl-section-title,
html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-name,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-name,
html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-status,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-status {
  color: var(--text-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero p,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero p,
html[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight p,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight p {
  color: var(--text-2) !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero p span,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero p span {
  color: color-mix(in srgb, var(--negative) 78%, var(--text-1)) !important;
}

html[data-theme="dark"] #section-discipline .execution-rules-panel .tl-section-title::before,
body[data-theme="dark"] #section-discipline .execution-rules-panel .tl-section-title::before,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .tl-section-title::before,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .tl-section-title::before {
  background: var(--accent) !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge__track,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge__track,
html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-track,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-track {
  background: var(--layer-2) !important;
  stroke: var(--layer-2) !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-ok,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-ok {
  background: color-mix(in srgb, var(--positive) 64%, var(--layer-2)) !important;
  color: color-mix(in srgb, var(--positive) 16%, #07140d) !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-warn,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-warn {
  background: color-mix(in srgb, var(--warning) 58%, var(--layer-2)) !important;
  color: #211804 !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-bad,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-bad {
  background: color-mix(in srgb, var(--negative) 48%, var(--layer-2)) !important;
  color: #230707 !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-empty,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.execution-tone-empty {
  background: var(--layer-2) !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.is-today,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell.is-today {
  outline-color: var(--accent) !important;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__header,
body[data-theme="dark"] #section-discipline .rule-history-detail__header {
  background: var(--layer-1) !important;
  border-color: var(--border-0) !important;
}

/* === DISCIPLINE LAYOUT REFINEMENT === */
html[data-theme="dark"] #section-discipline .execution-hero-score-row,
body[data-theme="dark"] #section-discipline .execution-hero-score-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 390px) !important;
  gap: 12px !important;
  align-items: stretch !important;
  margin-bottom: 12px !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card,
html[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card,
body[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card {
  min-height: 210px !important;
  height: 100% !important;
  padding: 20px 22px !important;
  border: 1px solid var(--border-0) !important;
  border-radius: 16px !important;
  background: var(--layer-1) !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card {
  display: flex !important;
  align-items: center !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero__copy,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero__copy {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 0 !important;
  max-width: 560px;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero__eyebrow,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero__eyebrow {
  margin-bottom: 8px !important;
  font-size: 11px !important;
  letter-spacing: 0.12em !important;
  color: var(--text-3) !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero h3,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero h3 {
  margin-bottom: 8px !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  line-height: 1.12 !important;
  color: var(--text-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero p,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero p {
  max-width: 520px;
  margin-bottom: 14px !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] #section-discipline .execution-hero__deviation,
body[data-theme="dark"] #section-discipline .execution-hero__deviation {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--negative) 22%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--negative) 8%, transparent);
  color: color-mix(in srgb, var(--negative) 78%, var(--text-1));
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

html[data-theme="dark"] #section-discipline .execution-hero__deviation strong,
body[data-theme="dark"] #section-discipline .execution-hero__deviation strong {
  color: var(--text-2);
  font-weight: 500;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero small,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero small {
  max-width: 520px;
  margin-top: 9px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.4;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card,
body[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card {
  display: flex !important;
  flex-direction: column !important;
  width: auto !important;
  min-width: 0 !important;
  flex: initial !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-section-header,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-section-header {
  margin-bottom: 16px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .tl-section-title,
body[data-theme="dark"] #section-discipline #discipline-score-card .tl-section-title {
  font-size: 13px !important;
  color: var(--text-1) !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-body,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-body {
  gap: 18px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge {
  flex: 0 0 76px !important;
  width: 76px !important;
  height: 76px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge strong,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge strong {
  font-size: 21px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge span,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge span {
  font-size: 10px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore-list,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore-list {
  gap: 7px 16px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore span,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore span,
html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore strong,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore strong {
  font-size: 12px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight {
  margin-top: auto !important;
  padding-top: 14px !important;
  border-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid,
body[data-theme="dark"] #section-discipline .execution-kpi-grid {
  margin-bottom: 12px !important;
  border-color: var(--border-0) !important;
  border-radius: 16px !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card {
  min-height: 112px !important;
  padding: 16px 18px !important;
  border-right-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-label,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-label {
  font-size: 10px !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-value,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-value {
  font-size: 26px !important;
  line-height: 1.08 !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-value[data-value-type="text"],
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-value[data-value-type="text"] {
  font-size: 20px !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-sub,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-sub {
  margin-top: 6px !important;
  font-size: 12px !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card > span,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card > span {
  margin-top: 8px !important;
}

html[data-theme="dark"] #section-discipline .execution-main-grid,
body[data-theme="dark"] #section-discipline .execution-main-grid {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr) !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

html[data-theme="dark"] #section-discipline .execution-rules-panel,
body[data-theme="dark"] #section-discipline .execution-rules-panel,
html[data-theme="dark"] #section-discipline .execution-calendar-panel,
body[data-theme="dark"] #section-discipline .execution-calendar-panel {
  border-radius: 16px !important;
  border-color: var(--border-0) !important;
  background: var(--layer-1) !important;
}

html[data-theme="dark"] #section-discipline .execution-rules-panel .execution-section-header,
body[data-theme="dark"] #section-discipline .execution-rules-panel .execution-section-header,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-section-header,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-section-header {
  padding: 14px 18px !important;
  border-bottom-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row {
  grid-template-columns: minmax(150px, 220px) minmax(120px, 1fr) 42px !important;
  gap: 12px !important;
  padding: 10px 18px !important;
  border-bottom-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-status,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-status {
  width: 42px !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-track,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-track,
html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-fill,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-fill {
  height: 4px !important;
  border-radius: 999px !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap {
  padding: 18px 20px 16px !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row {
  grid-template-columns: 34px repeat(6, minmax(58px, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  padding: 0 !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays {
  padding-top: 0 !important;
  margin-bottom: 8px !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row {
  margin-top: 6px !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays span,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays span,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row strong,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row strong {
  font-size: 10px !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell {
  height: 44px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__legend,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__legend {
  gap: 14px !important;
  margin-top: 12px !important;
  padding: 0 !important;
}

html[data-theme="dark"] #section-discipline .rule-history__body,
body[data-theme="dark"] #section-discipline .rule-history__body {
  display: flex !important;
  justify-content: center !important;
  overflow-x: auto !important;
}

html[data-theme="dark"] #section-discipline .rule-history__grid,
body[data-theme="dark"] #section-discipline .rule-history__grid {
  width: fit-content !important;
  max-width: 100% !important;
  justify-self: center !important;
}

@media (max-width: 900px) {
  html[data-theme="dark"] #section-discipline .execution-hero-score-row,
  body[data-theme="dark"] #section-discipline .execution-hero-score-row,
  html[data-theme="dark"] #section-discipline .execution-main-grid,
  body[data-theme="dark"] #section-discipline .execution-main-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 700px) {
  html[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card,
  body[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card,
  html[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card,
  body[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card {
    min-height: 0 !important;
  }

  html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card,
  body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card {
    min-height: 104px !important;
  }

  html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays,
  body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays,
  html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row,
  body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row {
    grid-template-columns: 30px repeat(6, minmax(42px, 1fr)) !important;
  }

  html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell,
  body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell {
    height: 36px !important;
  }
}

/* KMFX system consolidation pass */
html[data-theme="dark"] #section-discipline.discipline-page-stack,
body[data-theme="dark"] #section-discipline.discipline-page-stack {
  gap: 16px !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row,
body[data-theme="dark"] #section-discipline .execution-hero-score-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  margin-bottom: 16px !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card,
html[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card,
body[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card {
  min-height: 196px !important;
  padding: 22px 24px !important;
  border-radius: 18px !important;
  background: var(--layer-1) !important;
  border-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero__eyebrow,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero__eyebrow {
  margin-bottom: 10px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  letter-spacing: 0.16em !important;
  color: var(--text-3) !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero h3,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero h3 {
  margin-bottom: 8px !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  color: var(--text-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero p,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero p {
  margin-bottom: 14px !important;
  max-width: 36rem !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] #section-discipline .execution-hero__deviation,
body[data-theme="dark"] #section-discipline .execution-hero__deviation {
  padding: 7px 11px !important;
  border-color: color-mix(in srgb, var(--negative) 20%, transparent) !important;
  background: color-mix(in srgb, var(--negative) 7%, transparent) !important;
  color: color-mix(in srgb, var(--negative) 72%, var(--text-1)) !important;
  font-size: 12px !important;
  font-weight: 650;
  white-space: normal !important;
}

html[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero small,
body[data-theme="dark"] #section-discipline .execution-hero-score-row .execution-hero small {
  max-width: 34rem !important;
  color: var(--text-3) !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-section-header,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-section-header {
  margin-bottom: 18px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .tl-section-title,
body[data-theme="dark"] #section-discipline #discipline-score-card .tl-section-title {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--text-1) !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-body,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-body {
  align-items: center !important;
  gap: 20px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge {
  flex-basis: 78px !important;
  width: 78px !important;
  height: 78px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore-list,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore-list {
  gap: 8px 18px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore {
  align-items: baseline !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore span,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore span,
html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore strong,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore strong {
  font-size: 12px !important;
  line-height: 1.2 !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-system-insight {
  margin-top: auto !important;
  padding-top: 16px !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid,
body[data-theme="dark"] #section-discipline .execution-kpi-grid {
  margin-bottom: 16px !important;
  border-radius: 18px !important;
  background: var(--layer-1) !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card {
  min-height: 116px !important;
  padding: 17px 18px !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-label,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-label {
  margin-bottom: 8px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  letter-spacing: 0.12em !important;
  color: var(--text-3) !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-value,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-value {
  font-size: 26px !important;
  font-weight: 650 !important;
  line-height: 1.05 !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-value[data-value-type="text"],
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-value[data-value-type="text"] {
  font-size: 20px !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-sub,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-sub {
  margin-top: 7px !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  color: var(--text-3) !important;
}

html[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card > span,
body[data-theme="dark"] #section-discipline .execution-kpi-grid .kpi-card > span {
  margin-top: 9px !important;
}

html[data-theme="dark"] #section-discipline .execution-main-grid,
body[data-theme="dark"] #section-discipline .execution-main-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 16px !important;
  margin-bottom: 16px !important;
}

html[data-theme="dark"] #section-discipline .execution-rules-panel,
body[data-theme="dark"] #section-discipline .execution-rules-panel,
html[data-theme="dark"] #section-discipline .execution-calendar-panel,
body[data-theme="dark"] #section-discipline .execution-calendar-panel,
html[data-theme="dark"] #section-discipline .rule-history,
body[data-theme="dark"] #section-discipline .rule-history {
  border-radius: 18px !important;
  background: var(--layer-1) !important;
  border-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-row {
  grid-template-columns: minmax(160px, 230px) minmax(160px, 1fr) 44px !important;
  gap: 14px !important;
  padding: 11px 18px !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-name,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-name {
  font-size: 12px !important;
  font-weight: 650 !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-status,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-status {
  width: 44px !important;
  font-size: 11px !important;
}

html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-track,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-track,
html[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-fill,
body[data-theme="dark"] #section-discipline #rule-compliance-bars .rule-bar-fill {
  height: 5px !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap {
  padding: 18px 20px 17px !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row {
  grid-template-columns: 36px repeat(6, minmax(52px, 1fr)) !important;
  gap: 7px !important;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays span,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__weekdays span,
html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row strong,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__row strong {
  font-size: 10px !important;
  letter-spacing: 0.08em;
}

html[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell,
body[data-theme="dark"] #section-discipline .execution-calendar-panel .execution-heatmap__cell {
  height: 42px !important;
  border-radius: 9px !important;
  font-size: 11px !important;
}

html[data-theme="dark"] #section-discipline .rule-history__header,
body[data-theme="dark"] #section-discipline .rule-history__header {
  padding: 20px 22px !important;
}

html[data-theme="dark"] #section-discipline .rule-history__view,
body[data-theme="dark"] #section-discipline .rule-history__view {
  padding: 18px 22px 22px !important;
}

html[data-theme="dark"] #section-discipline .rule-history__legend,
body[data-theme="dark"] #section-discipline .rule-history__legend {
  padding-bottom: 14px !important;
}

html[data-theme="dark"] #section-discipline .rule-history__body,
body[data-theme="dark"] #section-discipline .rule-history__body {
  display: block !important;
  justify-content: initial !important;
  overflow: visible !important;
  padding-bottom: 0 !important;
}

html[data-theme="dark"] #section-discipline .rule-history__workspace,
body[data-theme="dark"] #section-discipline .rule-history__workspace {
  display: block;
  min-width: 0;
}

html[data-theme="dark"] #section-discipline .rule-history__body.has-detail .rule-history__workspace,
body[data-theme="dark"] #section-discipline .rule-history__body.has-detail .rule-history__workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: start;
  gap: 16px;
}

html[data-theme="dark"] #section-discipline .rule-history__grid-shell,
body[data-theme="dark"] #section-discipline .rule-history__grid-shell {
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

html[data-theme="dark"] #section-discipline .rule-history__grid,
body[data-theme="dark"] #section-discipline .rule-history__grid {
  grid-template-columns: minmax(180px, 1.25fr) repeat(var(--rule-history-cols), minmax(68px, 1fr)) !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 760px !important;
  gap: 8px !important;
  justify-self: stretch !important;
}

html[data-theme="dark"] #section-discipline .rule-history__cell,
body[data-theme="dark"] #section-discipline .rule-history__cell {
  min-width: 0 !important;
  min-height: 36px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
}

html[data-theme="dark"] #section-discipline .rule-history-detail,
body[data-theme="dark"] #section-discipline .rule-history-detail {
  max-height: 420px !important;
  margin-top: 0 !important;
  overflow-y: auto !important;
  border-radius: 16px !important;
  background: color-mix(in srgb, var(--layer-1) 86%, var(--layer-2)) !important;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__header,
body[data-theme="dark"] #section-discipline .rule-history-detail__header {
  position: sticky !important;
  top: 0 !important;
  margin: -16px -16px 0 !important;
  padding: 16px !important;
  background: var(--layer-1) !important;
  border-bottom: 1px solid var(--border-0) !important;
}

@media (max-width: 1100px) {
  html[data-theme="dark"] #section-discipline .execution-hero-score-row,
  body[data-theme="dark"] #section-discipline .execution-hero-score-row,
  html[data-theme="dark"] #section-discipline .execution-main-grid,
  body[data-theme="dark"] #section-discipline .execution-main-grid,
  html[data-theme="dark"] #section-discipline .rule-history__body.has-detail .rule-history__workspace,
  body[data-theme="dark"] #section-discipline .rule-history__body.has-detail .rule-history__workspace {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 700px) {
  html[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card,
  body[data-theme="dark"] #section-discipline .execution-hero-score-row .discipline-hero-card,
  html[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card,
  body[data-theme="dark"] #section-discipline .execution-hero-score-row #discipline-score-card {
    min-height: 0 !important;
    padding: 18px !important;
  }

  html[data-theme="dark"] #section-discipline .execution-kpi-grid,
  body[data-theme="dark"] #section-discipline .execution-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html[data-theme="dark"] #section-discipline .rule-history__grid,
  body[data-theme="dark"] #section-discipline .rule-history__grid {
    min-width: 640px !important;
  }
}

/* === EXECUTION SYSTEM FINISH === */
html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-body,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-body {
  gap: 26px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge {
  flex: 0 0 118px !important;
  width: 118px !important;
  height: 118px !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge circle,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge circle {
  stroke-width: 10 !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge__backdrop,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge__backdrop {
  fill: var(--layer-2) !important;
  opacity: 0.55;
  stroke: none !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge__track,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge__track {
  stroke: color-mix(in srgb, var(--text-0) 7%, transparent) !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge strong,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge strong {
  font-size: 34px !important;
  font-weight: 800 !important;
  letter-spacing: -0.04em !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge span,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-score-gauge span {
  margin-top: 4px !important;
  font-size: 10px !important;
  font-weight: 750 !important;
  letter-spacing: 0.1em !important;
}

html[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore-list,
body[data-theme="dark"] #section-discipline #discipline-score-card .execution-subscore-list {
  gap: 9px 18px !important;
}

html[data-theme="dark"] #section-discipline .rule-history__body,
body[data-theme="dark"] #section-discipline .rule-history__body {
  overflow: visible !important;
}

html[data-theme="dark"] #section-discipline .rule-history__body.has-detail .rule-history__workspace,
body[data-theme="dark"] #section-discipline .rule-history__body.has-detail .rule-history__workspace {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 400px) !important;
  gap: 20px !important;
}

html[data-theme="dark"] #section-discipline .rule-history__grid-shell,
body[data-theme="dark"] #section-discipline .rule-history__grid-shell {
  overflow-x: visible !important;
  padding-bottom: 0 !important;
}

html[data-theme="dark"] #section-discipline .rule-history__grid,
body[data-theme="dark"] #section-discipline .rule-history__grid {
  grid-template-columns: minmax(172px, 1.12fr) repeat(var(--rule-history-cols), minmax(64px, 1fr)) !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  gap: 9px 12px !important;
}

html[data-theme="dark"] #section-discipline .rule-history__rule,
body[data-theme="dark"] #section-discipline .rule-history__rule {
  font-size: 12px !important;
  font-weight: 760 !important;
  letter-spacing: 0.015em !important;
}

html[data-theme="dark"] #section-discipline .rule-history__cell,
body[data-theme="dark"] #section-discipline .rule-history__cell {
  min-height: 38px !important;
}

html[data-theme="dark"] #section-discipline .rule-history-detail,
body[data-theme="dark"] #section-discipline .rule-history-detail {
  display: flex !important;
  flex-direction: column !important;
  height: 360px !important;
  max-height: 360px !important;
  overflow: hidden !important;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__header,
body[data-theme="dark"] #section-discipline .rule-history-detail__header {
  flex: 0 0 auto;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__list,
body[data-theme="dark"] #section-discipline .rule-history-detail__list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__row,
body[data-theme="dark"] #section-discipline .rule-history-detail__row {
  padding: 14px 0 !important;
}

html[data-theme="dark"] #section-discipline #entry-precision-card,
body[data-theme="dark"] #section-discipline #entry-precision-card,
html[data-theme="dark"] #section-discipline .rule-profile-manager,
body[data-theme="dark"] #section-discipline .rule-profile-manager {
  border-radius: 18px !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-card__header strong,
body[data-theme="dark"] #section-discipline .execution-entry-card__header strong,
html[data-theme="dark"] #section-discipline .rule-profile-manager__head strong,
body[data-theme="dark"] #section-discipline .rule-profile-manager__head strong,
html[data-theme="dark"] #section-discipline .rule-profile-editor__head strong,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head strong {
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-card__header > span,
body[data-theme="dark"] #section-discipline .execution-entry-card__header > span,
html[data-theme="dark"] #section-discipline .execution-entry-preview > p,
body[data-theme="dark"] #section-discipline .execution-entry-preview > p,
html[data-theme="dark"] #section-discipline .execution-entry-preview__head span,
body[data-theme="dark"] #section-discipline .execution-entry-preview__head span,
html[data-theme="dark"] #section-discipline .rule-profile-editor__head span,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head span,
html[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child span,
body[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child span,
html[data-theme="dark"] #section-discipline .rule-profile-rule-group > span,
body[data-theme="dark"] #section-discipline .rule-profile-rule-group > span,
html[data-theme="dark"] #section-discipline .rule-profile-accounts span,
body[data-theme="dark"] #section-discipline .rule-profile-accounts span {
  font-size: 10px !important;
  letter-spacing: 0.12em !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy strong,
body[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy strong,
html[data-theme="dark"] #section-discipline .rule-profile-rule__copy strong,
body[data-theme="dark"] #section-discipline .rule-profile-rule__copy strong {
  font-size: 13px !important;
  font-weight: 650 !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy p,
body[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy p,
html[data-theme="dark"] #section-discipline .execution-entry-pattern-bar p,
body[data-theme="dark"] #section-discipline .execution-entry-pattern-bar p,
html[data-theme="dark"] #section-discipline .rule-profile-editor__head p,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head p,
html[data-theme="dark"] #section-discipline .rule-profile-rule__copy p,
body[data-theme="dark"] #section-discipline .rule-profile-rule__copy p {
  font-size: 12px !important;
  line-height: 1.42 !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview__head,
body[data-theme="dark"] #section-discipline .execution-entry-preview__head,
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row {
  grid-template-columns: 86px 92px minmax(160px, 1fr) 92px 74px !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row span,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row span,
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row strong,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row strong,
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row em,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row em {
  font-size: 12px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs,
body[data-theme="dark"] #section-discipline .rule-profile-pairs {
  align-items: center !important;
  gap: 14px !important;
  padding: 12px 16px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child,
body[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child {
  flex: 0 0 150px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__control,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__control {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap;
  gap: 6px !important;
  min-height: 40px;
  padding: 5px;
  border: 1px solid var(--border-0);
  border-radius: 14px;
  background: color-mix(in srgb, var(--layer-2) 72%, transparent);
  transition: border-color 140ms ease, background 140ms ease;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__control:focus-within,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__control:focus-within {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-0));
  background: var(--layer-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills {
  gap: 6px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills span,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  letter-spacing: 0.08em !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs input,
body[data-theme="dark"] #section-discipline .rule-profile-pairs input {
  flex: 1 1 120px !important;
  max-width: 190px !important;
  min-height: 28px !important;
  padding: 0 6px !important;
  outline: none !important;
  font-size: 12px !important;
  color: var(--text-1) !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs input::placeholder,
body[data-theme="dark"] #section-discipline .rule-profile-pairs input::placeholder {
  color: var(--text-3) !important;
}

@media (max-width: 1100px) {
  html[data-theme="dark"] #section-discipline .rule-history__grid-shell,
  body[data-theme="dark"] #section-discipline .rule-history__grid-shell {
    overflow-x: auto !important;
  }
}

@media (max-width: 760px) {
  html[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child,
  body[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child {
    flex: 1 1 100% !important;
  }
}

/* === BOTTOM SECTIONS === */
html[data-theme="dark"] #section-discipline #entry-precision-card,
body[data-theme="dark"] #section-discipline #entry-precision-card {
  display: grid;
  gap: 0 !important;
  overflow: hidden;
  padding: 0 !important;
  border: 1px solid #1e1e1e !important;
  border-radius: 12px !important;
  background: #111111 !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-card__header,
body[data-theme="dark"] #section-discipline .execution-entry-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid #1a1a1a;
}

html[data-theme="dark"] #section-discipline .execution-entry-card__header > div,
body[data-theme="dark"] #section-discipline .execution-entry-card__header > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

html[data-theme="dark"] #section-discipline .execution-entry-card__header i,
body[data-theme="dark"] #section-discipline .execution-entry-card__header i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #2F6BFF;
}

html[data-theme="dark"] #section-discipline .execution-entry-card__header strong,
body[data-theme="dark"] #section-discipline .execution-entry-card__header strong {
  font-size: 12px;
  font-weight: 500;
  color: #cccccc;
}

html[data-theme="dark"] #section-discipline .execution-entry-card__header > span,
body[data-theme="dark"] #section-discipline .execution-entry-card__header > span {
  flex: 0 0 auto;
  font-size: 10px;
  color: #333333;
  white-space: nowrap;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty-row,
body[data-theme="dark"] #section-discipline .execution-entry-empty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty-row__icon,
body[data-theme="dark"] #section-discipline .execution-entry-empty-row__icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border: 1px solid #222222;
  border-radius: 8px;
  background: #1a1a1a;
  color: #444444;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy,
body[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy {
  flex: 1;
  min-width: 0;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy strong,
body[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #666666;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy p,
body[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy p {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: #333333;
}

html[data-theme="dark"] #section-discipline #entry-precision-card code,
body[data-theme="dark"] #section-discipline #entry-precision-card code {
  padding: 1px 4px;
  border-radius: 3px;
  background: #1a1a1a;
  color: #555555;
  font-size: 10px;
  font-family: inherit;
}

html[data-theme="dark"] #section-discipline .execution-entry-config,
body[data-theme="dark"] #section-discipline .execution-entry-config {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #2F6BFF;
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview,
body[data-theme="dark"] #section-discipline .execution-entry-preview {
  padding: 8px 14px 10px;
  border-top: 1px solid #151515;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview > p,
body[data-theme="dark"] #section-discipline .execution-entry-preview > p {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #333333;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview__head,
body[data-theme="dark"] #section-discipline .execution-entry-preview__head,
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row {
  display: grid;
  grid-template-columns: 80px 80px minmax(0, 1fr) 90px 70px;
  align-items: center;
  gap: 10px;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview__head,
body[data-theme="dark"] #section-discipline .execution-entry-preview__head {
  padding: 8px 14px;
  border-bottom: 1px solid #1a1a1a;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview__head span,
body[data-theme="dark"] #section-discipline .execution-entry-preview__head span {
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #444444;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview__body,
body[data-theme="dark"] #section-discipline .execution-entry-preview__body {
  opacity: 0.35;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview.is-live .execution-entry-preview__body,
body[data-theme="dark"] #section-discipline .execution-entry-preview.is-live .execution-entry-preview__body {
  opacity: 1;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row {
  min-height: 0 !important;
  padding: 8px 14px !important;
  border-top: 0 !important;
  border-bottom: 1px solid #151515;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row:last-child,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row span,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row span,
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row strong,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row strong,
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row em,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row em {
  font-size: 11px !important;
  line-height: 1.2 !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row span:nth-of-type(2),
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row span:nth-of-type(2),
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row em,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row em {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row__bar,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row__bar {
  height: 3px !important;
  border-radius: 2px;
  background: #1a1a1a;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row__bar i,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row__bar i {
  height: 3px !important;
  border-radius: 2px;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-ok span:nth-of-type(2),
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-ok span:nth-of-type(2),
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-ok em,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-ok em {
  color: #34D97B !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-warn span:nth-of-type(2),
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-warn span:nth-of-type(2),
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-warn em,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-warn em {
  color: #F5A623 !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-bad span:nth-of-type(2),
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-bad span:nth-of-type(2),
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-bad em,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-bad em {
  color: #FF5C5C !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-pattern-bar,
body[data-theme="dark"] #section-discipline .execution-entry-pattern-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #1a1a1a;
}

html[data-theme="dark"] #section-discipline .execution-entry-pattern-bar span,
body[data-theme="dark"] #section-discipline .execution-entry-pattern-bar span {
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #444444;
  white-space: nowrap;
}

html[data-theme="dark"] #section-discipline .execution-entry-pattern-bar p,
body[data-theme="dark"] #section-discipline .execution-entry-pattern-bar p {
  flex: 1;
  margin: 0;
  font-size: 11px;
  color: #555555;
}

html[data-theme="dark"] #section-discipline .execution-entry-pattern-bar strong,
body[data-theme="dark"] #section-discipline .execution-entry-pattern-bar strong {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  color: #333333;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

html[data-theme="dark"] #section-discipline .rule-profile-manager,
body[data-theme="dark"] #section-discipline .rule-profile-manager {
  overflow: hidden;
}

html[data-theme="dark"] #section-discipline .rule-profile-cards,
body[data-theme="dark"] #section-discipline .rule-profile-cards {
  gap: 8px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-card,
body[data-theme="dark"] #section-discipline .rule-profile-card {
  padding: 10px 12px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-card strong,
body[data-theme="dark"] #section-discipline .rule-profile-card strong {
  font-size: 13px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-card small,
body[data-theme="dark"] #section-discipline .rule-profile-card small {
  margin-top: 3px !important;
  font-size: 10px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-card span,
body[data-theme="dark"] #section-discipline .rule-profile-card span {
  margin-top: 5px;
}

html[data-theme="dark"] #section-discipline .rule-profile-editor__head,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head {
  padding: 10px 14px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-editor__head span,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head span {
  font-size: 9px !important;
  letter-spacing: 0.06em !important;
  color: #444444 !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-editor__head strong,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head strong {
  margin-top: 1px;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #cccccc !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-editor__head p,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head p {
  margin-top: 1px !important;
  font-size: 11px !important;
  color: #444444 !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-action,
body[data-theme="dark"] #section-discipline .rule-profile-action,
html[data-theme="dark"] #section-discipline .rule-profile-add-rule > button,
body[data-theme="dark"] #section-discipline .rule-profile-add-rule > button,
html[data-theme="dark"] #section-discipline .rule-profile-account-form button,
body[data-theme="dark"] #section-discipline .rule-profile-account-form button {
  min-height: 0 !important;
  padding: 5px 11px !important;
  border: 1px solid #2a2a2a !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #cccccc !important;
  font-size: 10px !important;
  white-space: nowrap;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs,
body[data-theme="dark"] #section-discipline .rule-profile-pairs {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 14px !important;
  border: 0 !important;
  border-bottom: 1px solid #1a1a1a !important;
  border-radius: 0 !important;
  background: transparent !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child,
body[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child {
  flex: 0 0 110px;
  min-width: 0;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child span,
body[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child span {
  font-size: 9px !important;
  letter-spacing: 0.06em !important;
  color: #444444 !important;
  white-space: nowrap;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child p,
body[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child p {
  display: none;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__control,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__control {
  flex: 1;
  min-width: 0;
  display: flex !important;
  align-items: center;
  gap: 5px !important;
  justify-content: flex-start !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills {
  display: flex;
  flex: 0 1 auto;
  gap: 5px !important;
  flex-wrap: wrap;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills span,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills span {
  padding: 2px 8px !important;
  border: 1px solid #2a2a2a !important;
  border-radius: 20px !important;
  background: #1a1a1a !important;
  color: #888888 !important;
  font-size: 10px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills button,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills button {
  font-size: 9px !important;
  color: #555555 !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs input,
body[data-theme="dark"] #section-discipline .rule-profile-pairs input {
  flex: 1 1 80px;
  max-width: 160px;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #555555 !important;
  font-family: var(--font-sans);
  font-size: 11px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs input::placeholder,
body[data-theme="dark"] #section-discipline .rule-profile-pairs input::placeholder {
  color: #333333;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-group > span,
body[data-theme="dark"] #section-discipline .rule-profile-rule-group > span {
  padding: 8px 14px 4px !important;
  border-top: 1px solid #151515 !important;
  font-size: 9px !important;
  letter-spacing: 0.07em !important;
  color: #333333 !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-group:first-child > span,
body[data-theme="dark"] #section-discipline .rule-profile-rule-group:first-child > span {
  padding-top: 4px !important;
  border-top: 0 !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule,
body[data-theme="dark"] #section-discipline .rule-profile-rule {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  padding: 7px 14px !important;
  border: 0 !important;
  border-bottom: 1px solid #111111 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule-group .rule-profile-rule:last-child,
body[data-theme="dark"] #section-discipline .rule-profile-rule-group .rule-profile-rule:last-child {
  border-bottom: 0 !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-toggle,
body[data-theme="dark"] #section-discipline .rule-profile-toggle {
  flex: 0 0 28px;
  width: 28px !important;
  height: 16px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-toggle span,
body[data-theme="dark"] #section-discipline .rule-profile-toggle span {
  border: 1px solid #222222;
  background: #1a1a1a !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-toggle span::after,
body[data-theme="dark"] #section-discipline .rule-profile-toggle span::after {
  width: 10px !important;
  height: 10px !important;
  top: 2px !important;
  left: 2px !important;
  background: #333333 !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-toggle input:checked + span,
body[data-theme="dark"] #section-discipline .rule-profile-toggle input:checked + span {
  border-color: rgba(52,217,123,0.55);
  background: rgba(52,217,123,0.13) !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-toggle input:checked + span::after,
body[data-theme="dark"] #section-discipline .rule-profile-toggle input:checked + span::after {
  transform: translateX(13px) !important;
  background: #34D97B !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule__copy,
body[data-theme="dark"] #section-discipline .rule-profile-rule__copy {
  flex: 1;
  min-width: 0;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule__copy strong,
body[data-theme="dark"] #section-discipline .rule-profile-rule__copy strong,
html[data-theme="dark"] #section-discipline .rule-profile-rule__copy p,
body[data-theme="dark"] #section-discipline .rule-profile-rule__copy p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule__copy strong,
body[data-theme="dark"] #section-discipline .rule-profile-rule__copy strong {
  font-size: 12px !important;
  color: #cccccc !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-rule__copy p,
body[data-theme="dark"] #section-discipline .rule-profile-rule__copy p {
  margin-top: 1px !important;
  font-size: 10px !important;
  color: #444444 !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-badge,
body[data-theme="dark"] #section-discipline .rule-profile-badge {
  flex: 0 0 auto;
  padding: 2px 6px !important;
  border-radius: 20px !important;
  font-size: 9px !important;
  white-space: nowrap;
}

html[data-theme="dark"] #section-discipline .rule-profile-badge--auto,
body[data-theme="dark"] #section-discipline .rule-profile-badge--auto {
  border-color: rgba(47,107,255,0.3) !important;
  color: rgba(47,107,255,0.55) !important;
  background: transparent !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-badge--manual,
body[data-theme="dark"] #section-discipline .rule-profile-badge--manual {
  border-color: rgba(245,166,35,0.3) !important;
  color: rgba(245,166,35,0.55) !important;
  background: transparent !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-badge--mixed,
body[data-theme="dark"] #section-discipline .rule-profile-badge--mixed {
  border-color: rgba(160,130,250,0.3) !important;
  color: rgba(167,139,250,0.55) !important;
  background: transparent !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-weight,
body[data-theme="dark"] #section-discipline .rule-profile-weight {
  flex: 0 0 auto;
}

html[data-theme="dark"] #section-discipline .rule-profile-weight__trigger,
body[data-theme="dark"] #section-discipline .rule-profile-weight__trigger {
  width: auto !important;
  min-height: 0 !important;
  padding: 3px 7px !important;
  border: 1px solid #222222 !important;
  border-radius: 5px !important;
  background: transparent !important;
  gap: 3px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-weight__trigger b,
body[data-theme="dark"] #section-discipline .rule-profile-weight__trigger b {
  font-size: 11px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-weight__trigger i,
body[data-theme="dark"] #section-discipline .rule-profile-weight__trigger i {
  font-size: 8px !important;
  opacity: 0.5;
}

html[data-theme="dark"] #section-discipline .rule-profile-remove,
body[data-theme="dark"] #section-discipline .rule-profile-remove {
  flex: 0 0 auto;
  padding: 2px 5px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: transparent !important;
  color: #2a2a2a !important;
  font-size: 11px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-remove:hover,
body[data-theme="dark"] #section-discipline .rule-profile-remove:hover {
  background: #1a1a1a !important;
  color: #555555 !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-accounts,
body[data-theme="dark"] #section-discipline .rule-profile-accounts {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px !important;
  border: 0 !important;
  border-top: 1px solid #1a1a1a !important;
  border-radius: 0 !important;
  background: transparent !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-accounts span,
body[data-theme="dark"] #section-discipline .rule-profile-accounts span {
  font-size: 9px !important;
  letter-spacing: 0.06em !important;
  color: #444444 !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-accounts strong,
body[data-theme="dark"] #section-discipline .rule-profile-accounts strong {
  margin-top: 2px;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #888888 !important;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] #section-discipline .rule-profile-account-form,
body[data-theme="dark"] #section-discipline .rule-profile-account-form {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  html[data-theme="dark"] #section-discipline .execution-entry-empty-row,
  body[data-theme="dark"] #section-discipline .execution-entry-empty-row,
  html[data-theme="dark"] #section-discipline .rule-profile-pairs,
  body[data-theme="dark"] #section-discipline .rule-profile-pairs,
  html[data-theme="dark"] #section-discipline .rule-profile-accounts,
  body[data-theme="dark"] #section-discipline .rule-profile-accounts {
    align-items: flex-start !important;
    flex-wrap: wrap;
  }

  html[data-theme="dark"] #section-discipline .execution-entry-preview__head,
  body[data-theme="dark"] #section-discipline .execution-entry-preview__head,
  html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row,
  body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row {
    grid-template-columns: 60px 70px minmax(80px, 1fr) 62px 58px;
  }
}

/* KMFX system alignment for the bottom execution blocks */
html[data-theme="dark"] #section-discipline #entry-precision-card,
body[data-theme="dark"] #section-discipline #entry-precision-card,
html[data-theme="dark"] #section-discipline .rule-profile-manager,
body[data-theme="dark"] #section-discipline .rule-profile-manager {
  background: var(--layer-1) !important;
  border-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-card__header,
body[data-theme="dark"] #section-discipline .execution-entry-card__header,
html[data-theme="dark"] #section-discipline .execution-entry-pattern-bar,
body[data-theme="dark"] #section-discipline .execution-entry-pattern-bar,
html[data-theme="dark"] #section-discipline .rule-profile-pairs,
body[data-theme="dark"] #section-discipline .rule-profile-pairs,
html[data-theme="dark"] #section-discipline .rule-profile-accounts,
body[data-theme="dark"] #section-discipline .rule-profile-accounts {
  border-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-card__header i,
body[data-theme="dark"] #section-discipline .execution-entry-card__header i {
  background: var(--accent);
}

html[data-theme="dark"] #section-discipline .execution-entry-card__header strong,
body[data-theme="dark"] #section-discipline .execution-entry-card__header strong,
html[data-theme="dark"] #section-discipline .rule-profile-editor__head strong,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head strong,
html[data-theme="dark"] #section-discipline .rule-profile-rule__copy strong,
body[data-theme="dark"] #section-discipline .rule-profile-rule__copy strong {
  color: var(--text-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-card__header > span,
body[data-theme="dark"] #section-discipline .execution-entry-card__header > span,
html[data-theme="dark"] #section-discipline .execution-entry-preview > p,
body[data-theme="dark"] #section-discipline .execution-entry-preview > p,
html[data-theme="dark"] #section-discipline .execution-entry-preview__head span,
body[data-theme="dark"] #section-discipline .execution-entry-preview__head span,
html[data-theme="dark"] #section-discipline .execution-entry-pattern-bar span,
body[data-theme="dark"] #section-discipline .execution-entry-pattern-bar span,
html[data-theme="dark"] #section-discipline .rule-profile-editor__head span,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head span,
html[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child span,
body[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child span,
html[data-theme="dark"] #section-discipline .rule-profile-rule-group > span,
body[data-theme="dark"] #section-discipline .rule-profile-rule-group > span,
html[data-theme="dark"] #section-discipline .rule-profile-accounts span,
body[data-theme="dark"] #section-discipline .rule-profile-accounts span {
  color: var(--text-3) !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy strong,
body[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy strong,
html[data-theme="dark"] #section-discipline .execution-entry-pattern-bar p,
body[data-theme="dark"] #section-discipline .execution-entry-pattern-bar p,
html[data-theme="dark"] #section-discipline .rule-profile-editor__head p,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head p,
html[data-theme="dark"] #section-discipline .rule-profile-rule__copy p,
body[data-theme="dark"] #section-discipline .rule-profile-rule__copy p {
  color: var(--text-2) !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy p,
body[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy p,
html[data-theme="dark"] #section-discipline .execution-entry-pattern-bar strong,
body[data-theme="dark"] #section-discipline .execution-entry-pattern-bar strong {
  color: var(--text-3) !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty-row__icon,
body[data-theme="dark"] #section-discipline .execution-entry-empty-row__icon,
html[data-theme="dark"] #section-discipline #entry-precision-card code,
body[data-theme="dark"] #section-discipline #entry-precision-card code,
html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills span,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills span {
  background: var(--layer-2) !important;
  border-color: var(--border-0) !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty-row__icon,
body[data-theme="dark"] #section-discipline .execution-entry-empty-row__icon,
html[data-theme="dark"] #section-discipline #entry-precision-card code,
body[data-theme="dark"] #section-discipline #entry-precision-card code,
html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills span,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills span,
html[data-theme="dark"] #section-discipline .rule-profile-pairs input,
body[data-theme="dark"] #section-discipline .rule-profile-pairs input,
html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills button,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills button {
  color: var(--text-2) !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-config,
body[data-theme="dark"] #section-discipline .execution-entry-config {
  color: var(--accent) !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview,
body[data-theme="dark"] #section-discipline .execution-entry-preview,
html[data-theme="dark"] #section-discipline .execution-entry-preview__head,
body[data-theme="dark"] #section-discipline .execution-entry-preview__head,
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row,
html[data-theme="dark"] #section-discipline .rule-profile-rule,
body[data-theme="dark"] #section-discipline .rule-profile-rule,
html[data-theme="dark"] #section-discipline .rule-profile-rule-group > span {
  border-color: rgba(255,255,255,0.055) !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row__bar,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row__bar,
html[data-theme="dark"] #section-discipline .rule-profile-toggle span {
  background: var(--layer-2) !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-ok span:nth-of-type(2),
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-ok span:nth-of-type(2),
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-ok em,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-ok em {
  color: var(--positive) !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-warn span:nth-of-type(2),
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-warn span:nth-of-type(2),
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-warn em,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-warn em {
  color: var(--warning) !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-bad span:nth-of-type(2),
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-bad span:nth-of-type(2),
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-bad em,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-tone-bad em {
  color: var(--negative) !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-action,
body[data-theme="dark"] #section-discipline .rule-profile-action,
html[data-theme="dark"] #section-discipline .rule-profile-add-rule > button,
body[data-theme="dark"] #section-discipline .rule-profile-add-rule > button,
html[data-theme="dark"] #section-discipline .rule-profile-account-form button,
body[data-theme="dark"] #section-discipline .rule-profile-account-form button,
html[data-theme="dark"] #section-discipline .rule-profile-weight__trigger,
body[data-theme="dark"] #section-discipline .rule-profile-weight__trigger {
  border-color: var(--border-0) !important;
  color: var(--text-1) !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-remove,
body[data-theme="dark"] #section-discipline .rule-profile-remove {
  color: var(--text-3) !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-remove:hover,
body[data-theme="dark"] #section-discipline .rule-profile-remove:hover {
  background: var(--layer-2) !important;
  color: var(--text-1) !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-toggle input:checked + span,
body[data-theme="dark"] #section-discipline .rule-profile-toggle input:checked + span {
  border-color: color-mix(in srgb, var(--positive) 42%, transparent) !important;
  background: color-mix(in srgb, var(--positive) 14%, transparent) !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-toggle input:checked + span::after,
body[data-theme="dark"] #section-discipline .rule-profile-toggle input:checked + span::after {
  background: var(--positive) !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-accounts strong,
body[data-theme="dark"] #section-discipline .rule-profile-accounts strong {
  color: var(--text-1) !important;
}

/* === EXECUTION FINAL VISUAL FIXES === */
html[data-theme="dark"] #section-discipline .rule-history__grid-shell,
body[data-theme="dark"] #section-discipline .rule-history__grid-shell {
  overflow-x: visible !important;
  padding-bottom: 0 !important;
}

html[data-theme="dark"] #section-discipline .rule-history__grid,
body[data-theme="dark"] #section-discipline .rule-history__grid {
  grid-template-columns: minmax(172px, 1.12fr) repeat(var(--rule-history-cols), minmax(64px, 1fr)) !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  gap: 9px 12px !important;
}

html[data-theme="dark"] #section-discipline .rule-history-detail,
body[data-theme="dark"] #section-discipline .rule-history-detail {
  display: flex !important;
  flex-direction: column !important;
  height: 360px !important;
  max-height: 360px !important;
  overflow: hidden !important;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__header,
body[data-theme="dark"] #section-discipline .rule-history-detail__header {
  flex: 0 0 auto;
}

html[data-theme="dark"] #section-discipline .rule-history-detail__list,
body[data-theme="dark"] #section-discipline .rule-history-detail__list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}

html[data-theme="dark"] #section-discipline .execution-entry-card__header strong,
body[data-theme="dark"] #section-discipline .execution-entry-card__header strong,
html[data-theme="dark"] #section-discipline .rule-profile-manager__head strong,
body[data-theme="dark"] #section-discipline .rule-profile-manager__head strong,
html[data-theme="dark"] #section-discipline .rule-profile-editor__head strong,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head strong {
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy strong,
body[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy strong,
html[data-theme="dark"] #section-discipline .rule-profile-rule__copy strong,
body[data-theme="dark"] #section-discipline .rule-profile-rule__copy strong {
  font-size: 13px !important;
  font-weight: 650 !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy p,
body[data-theme="dark"] #section-discipline .execution-entry-empty-row__copy p,
html[data-theme="dark"] #section-discipline .execution-entry-pattern-bar p,
body[data-theme="dark"] #section-discipline .execution-entry-pattern-bar p,
html[data-theme="dark"] #section-discipline .rule-profile-editor__head p,
body[data-theme="dark"] #section-discipline .rule-profile-editor__head p,
html[data-theme="dark"] #section-discipline .rule-profile-rule__copy p,
body[data-theme="dark"] #section-discipline .rule-profile-rule__copy p {
  font-size: 12px !important;
  line-height: 1.42 !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview__head,
body[data-theme="dark"] #section-discipline .execution-entry-preview__head,
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row {
  grid-template-columns: 86px 92px minmax(160px, 1fr) 92px 74px !important;
}

html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row span,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row span,
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row strong,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row strong,
html[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row em,
body[data-theme="dark"] #section-discipline .execution-entry-preview .execution-entry-row em {
  font-size: 12px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs,
body[data-theme="dark"] #section-discipline .rule-profile-pairs {
  align-items: center !important;
  gap: 14px !important;
  padding: 12px 16px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child,
body[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child {
  flex: 0 0 150px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__control,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__control {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap;
  gap: 6px !important;
  min-height: 40px;
  padding: 5px;
  border: 1px solid var(--border-0);
  border-radius: 14px;
  background: color-mix(in srgb, var(--layer-2) 72%, transparent);
  transition: border-color 140ms ease, background 140ms ease;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__control:focus-within,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__control:focus-within {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-0));
  background: var(--layer-2);
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills {
  gap: 6px !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs__pills span,
body[data-theme="dark"] #section-discipline .rule-profile-pairs__pills span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  letter-spacing: 0.08em !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs input,
body[data-theme="dark"] #section-discipline .rule-profile-pairs input {
  flex: 1 1 120px !important;
  max-width: 190px !important;
  min-height: 28px !important;
  padding: 0 6px !important;
  outline: none !important;
  font-size: 12px !important;
  color: var(--text-1) !important;
}

html[data-theme="dark"] #section-discipline .rule-profile-pairs input::placeholder,
body[data-theme="dark"] #section-discipline .rule-profile-pairs input::placeholder {
  color: var(--text-3) !important;
}

@media (max-width: 1100px) {
  html[data-theme="dark"] #section-discipline .rule-history__grid-shell,
  body[data-theme="dark"] #section-discipline .rule-history__grid-shell {
    overflow-x: auto !important;
  }
}

@media (max-width: 760px) {
  html[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child,
  body[data-theme="dark"] #section-discipline .rule-profile-pairs > div:first-child {
    flex: 1 1 100% !important;
  }
}
