:root {
  color-scheme: dark;
  --bg: #06090c;
  --bg-raised: #090e12;
  --panel: #0c1217;
  --panel-2: #101820;
  --panel-3: #151e25;
  --line: #202b33;
  --line-strong: #31404a;
  --text: #dbe4e9;
  --text-strong: #f4f7f8;
  --muted: #788793;
  --muted-2: #53616b;
  --amber: #ffad29;
  --amber-bright: #ffc354;
  --amber-soft: rgba(255, 173, 41, 0.12);
  --green: #30d99a;
  --green-soft: rgba(48, 217, 154, 0.1);
  --red: #ff6375;
  --red-soft: rgba(255, 99, 117, 0.1);
  --blue: #46bde3;
  --blue-soft: rgba(70, 189, 227, 0.11);
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "Roboto Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --rail-width: 244px;
  --header-height: 76px;
  --radius: 3px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 70% -20%, rgba(39, 87, 103, 0.13), transparent 38rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.35;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
}

button,
input,
select,
[tabindex] {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--amber-bright);
  outline-offset: 2px;
}

::selection {
  background: rgba(255, 173, 41, 0.28);
  color: var(--text-strong);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #080d11;
}

::-webkit-scrollbar-thumb {
  border: 2px solid #080d11;
  border-radius: 10px;
  background: #2b3740;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a4954;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 9px 12px;
  transform: translateY(-150%);
  border: 1px solid var(--amber);
  background: var(--bg);
  color: var(--text-strong);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
}

.strategy-rail {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 100vh;
  min-height: 560px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 173, 41, 0.035), transparent 11rem),
    #080d11;
}

.brand-lockup {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--amber);
  background: var(--amber);
  color: #171008;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: 0 0 22px rgba(255, 173, 41, 0.08);
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  text-transform: uppercase;
}

.brand-copy strong {
  color: var(--text-strong);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.brand-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.rail-section-label,
.control-label,
.telemetry-label,
.summary-label,
.chart-kicker,
.formula-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.rail-section-label {
  padding: 20px 16px 9px;
}

.strategy-nav {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 2px;
  padding: 0 9px;
}

.strategy-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 45px;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted-2);
  text-align: left;
}

.strategy-item:disabled {
  opacity: 1;
}

.strategy-item:not(:disabled):hover {
  border-color: rgba(255, 173, 41, 0.2);
  background: rgba(255, 173, 41, 0.05);
}

.strategy-item.is-active {
  border-color: rgba(255, 173, 41, 0.26);
  background: linear-gradient(90deg, rgba(255, 173, 41, 0.15), rgba(255, 173, 41, 0.035));
  color: var(--text-strong);
}

.strategy-item.is-active::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: -10px;
  width: 2px;
  background: var(--amber);
  content: "";
}

.strategy-index {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
}

.strategy-item.is-active .strategy-index {
  color: var(--amber);
}

.strategy-name {
  font-size: 11px;
  font-weight: 620;
  line-height: 1.25;
}

.soon-tag {
  padding: 2px 4px;
  border: 1px solid #263039;
  color: #55636c;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rail-footer {
  display: flex;
  margin-top: auto;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 17px;
  border-top: 1px solid var(--line);
  color: #96a3ac;
  font-family: var(--font-mono);
  font-size: 10px;
}

.rail-footer-label {
  margin-bottom: 2px;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rail-footer small {
  color: var(--muted-2);
  font-size: 9px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(83, 97, 107, 0.12);
}

.status-dot--local,
.status-dot.is-ready {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(48, 217, 154, 0.1), 0 0 9px rgba(48, 217, 154, 0.25);
}

.status-dot.is-partial,
.status-dot.is-syncing {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 173, 41, 0.1), 0 0 9px rgba(255, 173, 41, 0.2);
}

.status-dot.is-error {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 99, 117, 0.1);
}

.workspace {
  min-width: 0;
  min-height: 100vh;
}

.desk-header {
  position: relative;
  z-index: 15;
  display: flex;
  min-height: var(--header-height);
  align-items: stretch;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 17, 0.96);
}

.desk-heading {
  display: flex;
  min-width: 260px;
  flex-direction: column;
  justify-content: center;
  padding: 10px 22px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.title-line,
.module-title-row,
.detail-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.desk-heading h1,
.module-strip h2,
.table-heading h3,
.dialog-header h2,
.chart-header h3 {
  margin: 0;
  color: var(--text-strong);
}

.desk-heading h1 {
  font-size: 20px;
  font-weight: 690;
  letter-spacing: -0.025em;
}

.live-module-badge,
.source-badge {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 5px;
  border: 1px solid rgba(48, 217, 154, 0.32);
  background: rgba(48, 217, 154, 0.07);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.header-telemetry {
  display: flex;
  min-width: 0;
  align-items: stretch;
  margin-left: auto;
}

.telemetry-item {
  display: flex;
  min-width: 116px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 10px 15px;
  border-left: 1px solid var(--line);
}

.telemetry-item strong {
  overflow: hidden;
  color: #cbd6db;
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-button {
  align-self: center;
  margin: 0 16px;
}

.button {
  display: inline-flex;
  min-height: 33px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.button svg,
.icon-button svg,
.search-control svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button--primary {
  border-color: var(--amber);
  background: var(--amber);
  color: #181108;
}

.button--primary:hover:not(:disabled) {
  border-color: var(--amber-bright);
  background: var(--amber-bright);
}

.button--primary:disabled {
  border-color: #765d31;
  background: #765d31;
  color: #17130e;
}

.button--secondary {
  background: #10171c;
  color: #b5c1c8;
}

.button--secondary:hover:not(:disabled) {
  border-color: #546570;
  background: #151f25;
  color: var(--text-strong);
}

.button--secondary:disabled {
  opacity: 0.42;
}

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

.column-manager {
  position: relative;
}

.column-manager.is-open {
  z-index: 30;
}

.columns-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: flex;
  width: min(292px, calc(100vw - 18px));
  max-height: min(500px, calc(100vh - 120px));
  flex-direction: column;
  border: 1px solid #35434c;
  background: #0b1217;
  color: var(--text);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.48);
}

.columns-panel[hidden] {
  display: none;
}

.columns-panel-header {
  display: flex;
  min-height: 39px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  background: #10181e;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.columns-panel-header strong {
  color: var(--text-strong);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.columns-panel-header span {
  color: var(--muted-2);
  font-size: 7px;
  letter-spacing: 0.03em;
}

.columns-list {
  min-height: 0;
  overflow-y: auto;
}

.column-option {
  display: grid;
  min-height: 32px;
  align-items: center;
  padding: 3px 7px;
  border-bottom: 1px solid #172128;
  background: #0b1217;
  grid-template-columns: 14px minmax(0, 1fr) 55px;
}

.column-option:hover,
.column-option:focus-within {
  background: #111a20;
}

.column-option.is-dragging {
  opacity: 0.45;
}

.column-option.is-drop-target {
  box-shadow: inset 0 2px 0 var(--amber);
}

.column-option.is-drop-target.is-drop-after {
  box-shadow: inset 0 -2px 0 var(--amber);
}

.column-drag-handle {
  color: #52616a;
  cursor: grab;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  user-select: none;
}

.column-option[draggable="true"]:active .column-drag-handle {
  cursor: grabbing;
}

.column-option.is-pinned .column-drag-handle {
  color: #29353d;
  cursor: default;
}

.column-visibility {
  position: relative;
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: #9ba8af;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.column-visibility input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.column-visibility input:disabled {
  cursor: not-allowed;
}

.column-option.is-pinned .column-visibility {
  cursor: default;
}

.column-option-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-check {
  position: relative;
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border: 1px solid #46535c;
  background: #10171c;
}

.column-visibility input:focus-visible + .column-check {
  outline: 2px solid var(--amber-bright);
  outline-offset: 2px;
}

.column-visibility input:checked + .column-check {
  border-color: var(--amber);
  background: var(--amber);
}

.column-visibility input:checked + .column-check::after {
  position: absolute;
  top: 1px;
  left: 3px;
  width: 3px;
  height: 6px;
  transform: rotate(42deg);
  border-right: 1.5px solid #1a1207;
  border-bottom: 1.5px solid #1a1207;
  content: "";
}

.column-move-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 3px;
}

.column-move-button {
  display: grid;
  width: 24px;
  height: 23px;
  place-items: center;
  padding: 0;
  border: 1px solid #2b3740;
  background: #0d151a;
  color: #88969e;
  font-family: var(--font-mono);
  font-size: 10px;
}

.column-move-button:hover:not(:disabled) {
  border-color: var(--amber);
  color: var(--amber-bright);
}

.column-move-button:disabled {
  color: #344149;
}

.column-pinned {
  color: #5c6a73;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.04em;
  text-align: right;
}

.columns-panel-footer {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 6px 9px;
  background: #10181e;
}

.columns-reset {
  padding-left: 0;
}

.sync-icon {
  fill: currentColor !important;
  stroke: none !important;
}

.sync-button.is-syncing .sync-icon {
  animation: spin 0.85s linear infinite;
}

.sync-button[hidden] {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.venue-tabs {
  display: flex;
  height: 38px;
  align-items: stretch;
  gap: 0;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
  background: #090e12;
}

.venue-tab {
  position: relative;
  display: inline-flex;
  min-width: 138px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 17px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.venue-tab:first-child {
  border-left: 1px solid var(--line);
}

.venue-tab.is-active {
  background: var(--amber-soft);
  color: var(--amber-bright);
}

.venue-tab:not(:disabled):hover {
  background: rgba(255, 173, 41, 0.06);
  color: #c9d2d7;
}

.venue-tab.is-active::after {
  position: absolute;
  right: -1px;
  bottom: -1px;
  left: -1px;
  height: 2px;
  background: var(--amber);
  content: "";
}

.venue-tab:disabled {
  color: #48545d;
}

.venue-tab-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.market-workspace {
  padding: 14px 18px 24px;
}

.market-workspace[hidden] {
  display: none;
}

.module-strip {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 0 13px;
}

.module-ident {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.venue-glyph,
.detail-glyph {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #284451;
  background: linear-gradient(145deg, #11232b, #0c171d);
  color: #7ad7f1;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
}

.venue-glyph {
  width: 34px;
  height: 34px;
}

.venue-glyph--spread {
  border-color: rgba(255, 173, 41, 0.42);
  background: linear-gradient(145deg, #2a2113, #17130d);
  color: var(--amber-bright);
  font-size: 15px;
}

.module-strip h2 {
  font-size: 14px;
  font-weight: 700;
}

.module-strip p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.source-badge {
  height: 15px;
  border-color: rgba(70, 189, 227, 0.3);
  background: var(--blue-soft);
  color: var(--blue);
}

.formula-note {
  display: grid;
  min-width: min(510px, 48%);
  grid-template-columns: auto minmax(180px, auto);
  gap: 2px 12px;
  padding: 7px 10px;
  border-left: 2px solid var(--amber);
  background: rgba(255, 173, 41, 0.04);
  color: var(--muted);
  font-size: 9px;
}

.formula-note code {
  overflow: hidden;
  color: #c4ced3;
  font-family: var(--font-mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formula-note > span:last-child {
  grid-column: 2;
}

.summary-grid {
  display: grid;
  margin-bottom: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  grid-template-columns: repeat(5, minmax(125px, 1fr));
  background: var(--panel);
}

.summary-cell {
  position: relative;
  display: grid;
  min-height: 73px;
  align-content: center;
  padding: 9px 13px;
  border-right: 1px solid var(--line);
}

.summary-cell::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  transform: scaleX(0);
  background: var(--amber);
  content: "";
  transform-origin: left;
  transition: transform 180ms ease;
}

.summary-cell:hover::after {
  transform: scaleX(1);
}

.summary-cell strong {
  margin-top: 2px;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.summary-cell small {
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 9px;
}

.control-deck {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.control-row {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 11px;
  padding: 6px 9px;
}

.control-row--primary {
  border-bottom: 1px solid var(--line);
}

.window-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.segmented-control {
  display: inline-flex;
  height: 29px;
  border: 1px solid var(--line-strong);
  background: #080d11;
}

.segment-button {
  min-width: 45px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.segment-button:last-child {
  border-right: 0;
}

.segment-button:hover {
  background: #131b21;
  color: var(--text);
}

.segment-button.is-active {
  background: var(--amber);
  color: #1c1409;
}

.search-control {
  position: relative;
  display: flex;
  width: min(320px, 31vw);
  height: 29px;
  align-items: center;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  background: #080d11;
  color: var(--muted);
}

.search-control:focus-within,
.field-control:focus-within {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px rgba(255, 173, 41, 0.12);
}

.search-control svg {
  width: 13px;
  height: 13px;
  margin-left: 9px;
}

.search-control input {
  min-width: 0;
  height: 100%;
  flex: 1;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.search-control input::placeholder,
.field-control input::placeholder {
  color: #495660;
  opacity: 1;
}

.search-control kbd {
  margin-right: 6px;
  padding: 1px 5px;
  border: 1px solid #2a353d;
  border-radius: 2px;
  background: #121920;
  color: #66747d;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  box-shadow: none;
}

.control-row--filters {
  min-height: 39px;
  flex-wrap: wrap;
}

.field-control {
  display: inline-flex;
  height: 27px;
  align-items: center;
  border: 1px solid var(--line);
  background: #080d11;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
}

.field-control > span:first-child {
  padding: 0 7px;
  white-space: nowrap;
}

.field-control input {
  width: 72px;
  height: 100%;
  padding: 0 7px;
  border: 0;
  border-left: 1px solid var(--line);
  background: #0d1318;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.input-prefix,
.input-suffix {
  color: var(--muted-2) !important;
}

.field-control .input-prefix {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 0 0 6px !important;
  border-left: 1px solid var(--line);
  background: #0d1318;
}

.field-control .input-prefix + input {
  width: 79px;
  border-left: 0;
  padding-left: 3px;
}

.field-control--suffix input {
  width: 48px;
}

.leverage-control-slot,
.global-leverage-control {
  display: flex;
  min-width: 0;
  align-items: center;
}

.global-leverage-control {
  gap: 8px;
}

.field-control--leverage select {
  width: 54px;
  height: 100%;
  padding: 0 7px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: #0d1318;
  color: var(--text-strong);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.leverage-consequences {
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.field-control .input-suffix {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 6px 0 2px;
  background: #0d1318;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.check-control {
  display: inline-flex;
  height: 27px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: #080d11;
  color: #88969f;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.check-control:hover {
  border-color: var(--line-strong);
  color: #adb8be;
}

.check-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.custom-check {
  position: relative;
  width: 11px;
  height: 11px;
  border: 1px solid #46535c;
  background: #10171c;
}

.check-control input:focus-visible + .custom-check {
  outline: 2px solid var(--amber-bright);
  outline-offset: 2px;
}

.check-control input:checked + .custom-check {
  border-color: var(--amber);
  background: var(--amber);
}

.check-control input:checked + .custom-check::after {
  position: absolute;
  top: 1px;
  left: 3px;
  width: 3px;
  height: 6px;
  transform: rotate(42deg);
  border-right: 1.5px solid #1a1207;
  border-bottom: 1.5px solid #1a1207;
  content: "";
}

.text-button {
  padding: 4px 2px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.text-button:hover:not(:disabled) {
  border-bottom-color: var(--amber);
}

.text-button:disabled {
  color: #45515a;
}

.filter-count {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.table-panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.table-heading {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

.table-heading h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.table-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.table-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
}

.table-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-swatch--positive { background: var(--green); }
.legend-swatch--negative { background: var(--red); }
.legend-swatch--partial { background: var(--amber); }

.table-scroll {
  position: relative;
  min-height: 260px;
  max-height: calc(100vh - 435px);
  overflow: auto;
  overscroll-behavior: contain;
}

table {
  width: 100%;
  min-width: max(100%, calc(var(--visible-columns, 15) * 104px));
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.spread-table {
  --visible-columns: 6;
  min-width: max(100%, 900px);
}

.spread-table-scroll {
  max-height: calc(100vh - 245px);
}

.spread-table tbody tr {
  cursor: default;
}

.spread-coin {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  color: var(--text-strong);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.spread-coin::before {
  width: 3px;
  height: 14px;
  background: var(--amber);
  content: "";
}

thead {
  position: sticky;
  z-index: 5;
  top: 0;
}

th {
  height: 31px;
  padding: 0;
  border-right: 1px solid #1a242b;
  border-bottom: 1px solid var(--line-strong);
  background: #11191f;
  color: #7d8c96;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

th button {
  display: flex;
  width: 100%;
  height: 31px;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

th.numeric button {
  justify-content: flex-end;
}

th button:hover {
  background: #162129;
  color: #c5d0d5;
}

th[aria-sort="ascending"],
th[aria-sort="descending"] {
  background: #192128;
  color: var(--amber-bright);
}

.sort-indicator {
  position: relative;
  width: 6px;
  height: 8px;
  flex: 0 0 auto;
}

th[aria-sort="ascending"] .sort-indicator::after,
th[aria-sort="descending"] .sort-indicator::after {
  position: absolute;
  left: 0;
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
  content: "";
}

th[aria-sort="ascending"] .sort-indicator::after {
  top: 1px;
  border-bottom: 4px solid var(--amber);
}

th[aria-sort="descending"] .sort-indicator::after {
  top: 3px;
  border-top: 4px solid var(--amber);
}

tbody tr {
  --row-bg: #0b1115;
  background: var(--row-bg);
  transition: background 80ms ease;
}

tbody tr:nth-child(even) {
  --row-bg: #0d1318;
}

tbody tr:hover,
tbody tr:focus-within {
  --row-bg: #152029;
}

td {
  height: 33px;
  padding: 0 8px;
  border-right: 1px solid rgba(32, 43, 51, 0.6);
  border-bottom: 1px solid #172027;
  background: var(--row-bg);
  color: #aebbc2;
  white-space: nowrap;
}

td.numeric {
  text-align: right;
}

th.sticky-column,
td.sticky-column {
  position: sticky;
  z-index: 3;
  left: 0;
  min-width: 105px;
  box-shadow: 1px 0 0 var(--line-strong), 8px 0 12px rgba(0, 0, 0, 0.1);
}

th.sticky-column {
  z-index: 7;
}

.coin-button {
  display: inline-flex;
  width: 100%;
  height: 28px;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: left;
}

.coin-button::before {
  width: 3px;
  height: 14px;
  background: #31404a;
  content: "";
}

.delisted-tag {
  display: inline-flex;
  height: 15px;
  align-items: center;
  padding: 0 4px;
  border: 1px solid rgba(120, 135, 147, 0.3);
  background: rgba(120, 135, 147, 0.07);
  color: #73818b;
  font-family: var(--font-mono);
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.delisted-tag[hidden] {
  display: none;
}

tr.is-delisted td:not(.sticky-column) {
  color: #73818a;
}

tr:hover .coin-button,
.coin-button:hover {
  color: var(--amber-bright);
}

tr:hover .coin-button::before,
.coin-button:hover::before {
  background: var(--amber);
}

.sync-badge,
.boolean-badge,
.persistence-badge {
  display: inline-flex;
  min-width: 42px;
  height: 17px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  background: #111920;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sync-badge::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.sync-badge.is-complete {
  border-color: rgba(48, 217, 154, 0.25);
  background: var(--green-soft);
  color: var(--green);
}

.sync-badge.is-partial,
.sync-badge.is-syncing,
.sync-badge.is-pending {
  border-color: rgba(255, 173, 41, 0.26);
  background: var(--amber-soft);
  color: var(--amber);
}

.sync-badge.is-empty,
.sync-badge.is-error {
  border-color: rgba(255, 99, 117, 0.22);
  background: var(--red-soft);
  color: var(--red);
}

.boolean-badge.is-yes {
  border-color: rgba(70, 189, 227, 0.25);
  background: var(--blue-soft);
  color: var(--blue);
}

.boolean-badge.is-no {
  color: #59666f;
}

.persistence-badge.is-young {
  color: var(--muted-2);
}

.positive-text,
.metric-positive {
  color: var(--green) !important;
}

.negative-text,
.metric-negative {
  color: var(--red) !important;
}

.metric-neutral {
  color: #b8c4ca;
}

.metric-persistence-medium {
  color: var(--amber);
}

.metric-missing {
  color: #48555e;
}

.secondary-metric {
  color: var(--muted-2);
}

.spark-cell {
  width: 122px;
  padding: 0 7px;
}

.sparkline {
  display: block;
  width: 108px;
  height: 24px;
  overflow: visible;
}

.sparkline .spark-grid {
  stroke: #27323a;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.sparkline .spark-area {
  fill: rgba(48, 217, 154, 0.06);
}

.sparkline .spark-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 1.15;
  vector-effect: non-scaling-stroke;
}

.sparkline.is-negative .spark-area {
  fill: rgba(255, 99, 117, 0.06);
}

.sparkline.is-negative .spark-line {
  stroke: var(--red);
}

.spark-empty {
  color: #45515a;
  font-size: 8px;
}

.table-state {
  display: flex;
  min-height: 226px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  background:
    linear-gradient(rgba(24, 34, 41, 0.24) 1px, transparent 1px) 0 0 / 100% 33px,
    var(--panel);
  color: var(--muted);
  font-size: 10px;
}

.table-state[hidden] {
  display: none;
}

.table-state strong {
  margin-top: 4px;
  color: #bac6cc;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-state .button {
  margin-top: 6px;
}

.terminal-loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #26333b;
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.empty-glyph {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #35434c;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 16px;
}

.table-footer {
  display: flex;
  min-height: 27px;
  align-items: center;
  gap: 17px;
  padding: 0 9px;
  border-top: 1px solid var(--line);
  background: #090f13;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
}

.table-footer span:last-child {
  margin-left: auto;
}

.market-dialog {
  width: min(1180px, calc(100vw - 34px));
  height: min(760px, calc(100vh - 34px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid #3a4852;
  border-radius: 3px;
  background: #080d11;
  color: var(--text);
  box-shadow: 0 26px 85px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 173, 41, 0.06);
}

.market-dialog::backdrop {
  background: rgba(1, 4, 6, 0.82);
  backdrop-filter: blur(3px);
}

.market-dialog[open] {
  animation: dialog-in 150ms ease-out;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-shell {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.dialog-header {
  display: flex;
  min-height: 67px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line-strong);
  background: linear-gradient(90deg, rgba(255, 173, 41, 0.07), transparent 42%), #0d1419;
}

.detail-ident {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-glyph {
  width: 38px;
  height: 38px;
  color: var(--amber-bright);
}

.dialog-header h2 {
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: -0.02em;
}

.dialog-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: #10171c;
  color: var(--muted);
}

.icon-button:hover {
  border-color: #5c6b75;
  color: var(--text-strong);
}

.detail-loading,
.detail-error {
  display: flex;
  min-height: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.detail-loading[hidden],
.detail-error[hidden],
.dialog-content[hidden] {
  display: none;
}

.detail-loading strong,
.detail-error strong {
  margin-top: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.detail-error .button {
  margin-top: 6px;
}

.dialog-content {
  min-height: 0;
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.detail-stats {
  display: grid;
  margin-bottom: 11px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  grid-template-columns: repeat(7, minmax(100px, 1fr));
}

.detail-stat {
  min-width: 0;
  min-height: 58px;
  padding: 8px 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.detail-stat span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.detail-stat strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 1fr);
  gap: 11px;
}

.chart-panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.chart-header {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

.chart-header h3 {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 650;
}

.chart-header > strong {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.chart-wrap {
  position: relative;
  height: 284px;
  min-height: 220px;
  padding: 7px 8px 0;
  background:
    linear-gradient(rgba(40, 53, 62, 0.16) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, rgba(40, 53, 62, 0.11) 1px, transparent 1px) 0 0 / 16.66% 100%,
    #0a1014;
}

.data-chart {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid-line {
  stroke: #29363e;
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.chart-zero-line {
  stroke: #687984;
  stroke-width: 0.9;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
}

.curve-area {
  fill: url(#curve-gradient);
}

.curve-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.curve-line.is-negative {
  stroke: var(--red);
}

.chart-label {
  fill: #6c7a84;
  font-family: var(--font-mono);
  font-size: 10px;
}

.curve-hover-line {
  stroke: var(--amber);
  stroke-width: 0.9;
  stroke-dasharray: 3 3;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.curve-hover-dot {
  fill: var(--amber-bright);
  stroke: #151006;
  stroke-width: 1.5;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.chart-hit-area {
  fill: transparent;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 116px;
  padding: 6px 7px;
  transform: translate(-50%, calc(-100% - 8px));
  border: 1px solid #4a5a64;
  background: rgba(7, 12, 15, 0.96);
  color: #b8c4ca;
  font-family: var(--font-mono);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  white-space: nowrap;
}

.chart-tooltip strong {
  display: block;
  margin-top: 2px;
  color: var(--green);
  font-size: 10px;
}

.chart-axis-labels,
.histogram-legend {
  display: flex;
  min-height: 25px;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
}

.histogram-bar-positive {
  fill: rgba(48, 217, 154, 0.72);
}

.histogram-bar-negative {
  fill: rgba(255, 99, 117, 0.72);
}

.histogram-bar-positive:hover,
.histogram-bar-negative:hover {
  fill: var(--amber-bright);
}

.detail-footer {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 11px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: #090f13;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 17px;
  bottom: 17px;
  display: flex;
  width: min(360px, calc(100vw - 34px));
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr);
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(13, 20, 25, 0.98);
  color: #b8c3ca;
  font-size: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  animation: toast-in 160ms ease-out;
}

.toast::before {
  width: 3px;
  height: 100%;
  background: var(--blue);
  content: "";
}

.toast.is-success::before { background: var(--green); }
.toast.is-error::before { background: var(--red); }
.toast.is-warning::before { background: var(--amber); }

.toast strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .telemetry-item--rows {
    display: none;
  }

  .telemetry-item {
    min-width: 104px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .formula-note {
    min-width: min(450px, 50%);
  }

  .detail-stats {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }
}

@media (max-width: 980px) {
  :root {
    --rail-width: 205px;
  }

  .strategy-item {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .soon-tag {
    display: none;
  }

  .telemetry-item--state {
    display: none;
  }

  .module-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .formula-note {
    width: 100%;
    min-width: 0;
  }

  .control-row--primary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .search-control {
    width: min(340px, 100%);
    margin-left: 0;
  }

  .table-actions {
    margin-left: auto;
  }

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

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .strategy-rail {
    position: static;
    height: auto;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-lockup {
    min-height: 58px;
  }

  .rail-section-label {
    padding: 9px 13px 6px;
  }

  .strategy-nav {
    display: grid;
    padding: 0 9px 9px;
    overflow-x: auto;
    grid-auto-columns: minmax(155px, 1fr);
    grid-auto-flow: column;
  }

  .strategy-item {
    min-height: 42px;
  }

  .strategy-item.is-active::before {
    top: auto;
    right: 7px;
    bottom: -10px;
    left: 7px;
    width: auto;
    height: 2px;
  }

  .rail-footer {
    display: none;
  }

  .desk-header {
    min-height: auto;
    align-items: center;
    flex-wrap: wrap;
  }

  .desk-heading {
    min-height: 62px;
    flex: 1 1 auto;
    padding: 9px 13px;
  }

  .header-telemetry {
    width: 100%;
    border-top: 1px solid var(--line);
  }

  .telemetry-item {
    min-width: 0;
    flex: 1 1 120px;
  }

  .sync-button {
    margin: 0 9px;
  }

  .venue-tabs {
    overflow-x: auto;
    padding: 0 9px;
  }

  .venue-tab {
    min-width: 112px;
    flex: 1 0 112px;
  }

  .market-workspace {
    padding: 10px 9px 18px;
  }

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

  .summary-cell:last-child {
    grid-column: span 2;
  }

  .window-control {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented-control {
    width: 100%;
  }

  .segment-button {
    min-width: 0;
    flex: 1;
    padding: 0 4px;
  }

  .search-control {
    flex: 1 1 220px;
  }

  .table-actions {
    flex: 0 0 auto;
  }

  .control-row--filters > .control-label {
    width: 100%;
  }

  .filter-count {
    width: 100%;
    margin-left: 0;
  }

  .table-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .table-scroll {
    max-height: 62vh;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 7px 9px;
  }

  .table-footer span:last-child {
    margin-left: 0;
  }

  .market-dialog {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

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

  .chart-wrap {
    height: 245px;
  }

  .detail-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 7px 9px;
  }
}

@media (max-width: 440px) {
  .live-module-badge,
  .table-legend,
  .telemetry-item:nth-of-type(3) {
    display: none;
  }

  .desk-heading h1 {
    font-size: 17px;
  }

  .formula-note {
    display: flex;
    flex-direction: column;
  }

  .formula-note > span:last-child {
    grid-column: auto;
  }

  .formula-note code {
    white-space: normal;
  }

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

  .summary-cell:last-child {
    grid-column: auto;
  }

  .field-control,
  .check-control {
    flex: 1 1 145px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.brand-mark--logo {
  background: transparent;
  border: none;
  object-fit: contain;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 0 22px rgba(255, 173, 41, 0.12);
}

/* Collapsible strategy rail */
.rail-toggle {
  margin-left: auto;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim, #8b93a1);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.rail-toggle:hover { color: var(--amber); border-color: var(--amber); }

.strategy-rail, .app-shell { transition: none; }

body.rail-collapsed { --rail-width: 64px; }
body.rail-collapsed .brand-lockup {
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
body.rail-collapsed .rail-toggle { margin-left: 0; }
body.rail-collapsed .brand-copy,
body.rail-collapsed .strategy-name,
body.rail-collapsed .soon-tag,
body.rail-collapsed .rail-section-label,
body.rail-collapsed .rail-footer { display: none; }
body.rail-collapsed .strategy-item { justify-content: center; padding-left: 0; padding-right: 0; }
body.rail-collapsed .strategy-index { margin: 0; }

/* Column info markers */
.col-info {
  display: inline-grid;
  place-items: center;
  width: 12px;
  height: 12px;
  margin-left: 5px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-dim, #8b93a1);
  font-family: var(--font-mono);
  font-size: 8px;
  font-style: italic;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
  opacity: 0.7;
}
th:hover .col-info { opacity: 1; color: var(--amber); border-color: var(--amber); }

/* Signed-in identity */
.auth-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-left: 1px solid var(--line);
}

.user-chip {
  display: inline-flex;
  min-width: 0;
  max-width: 160px;
  height: 28px;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding: 0 8px;
  border: 1px solid rgba(255, 173, 41, 0.3);
  background: rgba(255, 173, 41, 0.06);
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.user-chip i,
.login-system-state i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px rgba(48, 217, 154, 0.45);
}

.logout-control {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.logout-control:hover {
  color: var(--text-strong);
}

.mobile-menu-button,
.mobile-rail-close,
.rail-backdrop {
  display: none;
}

/* App-level login */
.login-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 50% 0, rgba(255, 173, 41, 0.11), transparent 34rem),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto, auto;
}

.login-shell {
  width: 100%;
  padding: 24px;
}

.login-panel {
  width: min(440px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  background: rgba(9, 14, 18, 0.97);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52), 0 0 45px rgba(255, 173, 41, 0.035);
}

.login-brand {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 11px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}

.login-brand > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  text-transform: uppercase;
}

.login-brand strong {
  color: var(--text-strong);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.login-brand > div span {
  margin-top: 2px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.login-system-state {
  display: inline-flex;
  margin-left: auto;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.login-content {
  padding: 31px 32px 34px;
}

.login-content h1 {
  margin: 4px 0 7px;
  color: var(--text-strong);
  font-size: 25px;
  letter-spacing: -0.035em;
}

.login-content > p {
  max-width: 340px;
  margin: 0 0 23px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.login-error {
  margin-bottom: 15px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 99, 117, 0.35);
  border-left: 2px solid var(--red);
  background: var(--red-soft);
  color: #ffc1c8;
  font-family: var(--font-mono);
  font-size: 9px;
}

.login-form {
  display: grid;
  gap: 15px;
}

.login-form label {
  display: grid;
  gap: 6px;
}

.login-form label > span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #080d11;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 16px;
}

.login-form input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px rgba(255, 173, 41, 0.12);
}

.login-submit {
  min-height: 46px;
  margin-top: 4px;
  justify-content: space-between;
  padding: 0 14px;
}

.login-submit span {
  font-size: 15px;
}

.login-footer {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 15px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-footer > span {
  display: inline-flex;
  align-items: center;
}

/* Phone and tablet navigation/layout. Desktop rules above remain unchanged. */
@media (max-width: 899px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .app-shell {
    display: block;
    width: 100%;
  }

  .strategy-rail,
  body.rail-collapsed .strategy-rail {
    position: fixed;
    z-index: 80;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: min(82vw, 300px);
    height: 100dvh;
    min-height: 0;
    flex-direction: column;
    overflow-y: auto;
    transform: translateX(-102%);
    visibility: hidden;
    pointer-events: none;
    border-right: 1px solid var(--line-strong);
    border-bottom: 0;
    box-shadow: 24px 0 70px rgba(0, 0, 0, 0.48);
    transition: transform 160ms ease-out, visibility 0s linear 160ms;
  }

  body.mobile-nav-open .strategy-rail {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .brand-lockup,
  body.rail-collapsed .brand-lockup {
    min-height: 64px;
    flex-direction: row;
    align-items: center;
    gap: 11px;
  }

  body.rail-collapsed .brand-copy,
  body.rail-collapsed .strategy-name,
  body.rail-collapsed .rail-section-label,
  body.rail-collapsed .rail-footer {
    display: flex;
  }

  body.rail-collapsed .strategy-name {
    display: block;
  }

  .rail-section-label {
    display: block;
    padding: 18px 16px 9px;
  }

  .strategy-nav,
  body.rail-collapsed .strategy-nav {
    display: flex;
    padding: 0 9px;
    flex-direction: column;
    gap: 2px;
    overflow: visible;
  }

  .strategy-item,
  body.rail-collapsed .strategy-item {
    min-height: 46px;
    grid-template-columns: 22px minmax(0, 1fr);
    justify-content: stretch;
    padding: 7px 8px;
  }

  .strategy-item.is-active::before {
    top: 7px;
    right: auto;
    bottom: 7px;
    left: -10px;
    width: 2px;
    height: auto;
  }

  .rail-footer,
  body.rail-collapsed .rail-footer {
    display: flex;
  }

  .rail-toggle {
    display: none;
  }

  .mobile-rail-close {
    display: grid;
    width: 44px;
    height: 44px;
    margin-left: auto;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    font-size: 26px;
    line-height: 1;
  }

  .rail-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    pointer-events: none;
    opacity: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.62);
    transition: opacity 160ms ease-out;
  }

  body.mobile-nav-open .rail-backdrop {
    pointer-events: auto;
    opacity: 1;
  }

  .workspace {
    width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  .desk-header {
    min-height: 64px;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .mobile-menu-button {
    display: grid;
    width: 44px;
    height: 44px;
    margin: 10px 0 10px 9px;
    flex: 0 0 44px;
    align-self: flex-start;
    place-content: center;
    gap: 4px;
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    background: #0b1115;
  }

  .mobile-menu-button span {
    display: block;
    width: 17px;
    height: 1px;
    background: var(--amber-bright);
  }

  .desk-heading {
    min-width: 0;
    min-height: 64px;
    flex: 1 1 0;
    padding: 9px 10px;
  }

  .header-telemetry {
    width: 100%;
    flex: 1 1 100%;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
  }

  .telemetry-item {
    min-width: 0;
    min-height: 54px;
    flex: 1 1 120px;
  }

  .auth-controls {
    min-height: 54px;
    flex: 1 1 190px;
    justify-content: center;
  }

  .logout-control {
    min-height: 44px;
    padding: 0 6px;
  }

  .sync-button {
    min-height: 44px;
    margin: 5px 9px;
  }

  .venue-tabs {
    min-height: 45px;
    max-width: 100%;
    overflow-x: auto;
  }

  .venue-tab {
    min-height: 44px;
  }

  .market-workspace,
  .table-panel,
  .control-deck,
  .module-strip,
  .summary-grid {
    min-width: 0;
    max-width: 100%;
  }

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

  .summary-cell:last-child {
    grid-column: auto;
  }

  .control-row--primary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .window-control {
    max-width: 100%;
    flex: 1 1 100%;
  }

  .search-control {
    width: auto;
    min-height: 44px;
    flex: 1 1 230px;
    margin-left: 0;
  }

  .search-control input,
  .field-control input,
  .field-control select {
    font-size: 16px;
  }

  .field-control--leverage select {
    width: 64px;
  }

  .leverage-control-slot {
    max-width: 100%;
    flex: 1 1 320px;
  }

  .global-leverage-control {
    width: 100%;
    flex-wrap: wrap;
  }

  .leverage-consequences {
    display: inline-flex;
    min-height: 44px;
    flex: 1 1 185px;
    align-items: center;
  }

  .table-actions {
    margin-left: 0;
  }

  .button,
  .segment-button,
  .field-control,
  .check-control {
    min-height: 44px;
  }

  .segmented-control {
    height: 44px;
  }

  .table-scroll,
  .spread-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  th.sticky-column,
  td.sticky-column {
    min-width: 100px;
  }
}

@media (max-width: 440px) {
  .login-shell {
    padding: 13px;
  }

  .login-content {
    padding: 25px 20px 28px;
  }

  .login-content h1 {
    font-size: 22px;
  }

  .login-system-state {
    display: none;
  }

  .login-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

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

/* Native execution module */
.venue-tabs[hidden],
.execution-workspace[hidden],
.execution-recovery-actions[hidden],
.execution-ambiguity-actions[hidden] {
  display: none !important;
}

.execution-workspace {
  min-width: 0;
  padding: 14px 18px 30px;
}

.execution-module-strip {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 0 13px;
}

.execution-module-strip h2,
.execution-card h3,
.execution-review-dialog h2 {
  margin: 0;
  color: var(--text-strong);
}

.execution-module-strip h2 {
  font-size: 14px;
}

.execution-module-strip p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.venue-glyph--execution {
  border-color: rgba(255, 173, 41, 0.42);
  background: linear-gradient(145deg, #2a2113, #17130d);
  color: var(--amber-bright);
}

.execution-network-control {
  display: inline-flex;
  min-height: 33px;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  background: #080d11;
  font-family: var(--font-mono);
}

.execution-network-control > span {
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.execution-network-control button {
  min-width: 80px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
}

.execution-network-control button.is-active {
  background: var(--amber);
  color: #1c1409;
}

.execution-network-control button[data-execution-network="testnet"].is-active {
  background: var(--blue);
  color: #06131a;
}

.execution-safety-banner {
  display: grid;
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(70, 189, 227, 0.28);
  border-left: 2px solid var(--blue);
  background: var(--blue-soft);
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  color: #a9bac3;
  font-size: 10px;
}

.execution-safety-banner strong {
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
}

.execution-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.execution-card-header {
  display: flex;
  min-height: 49px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: #0e161c;
}

.execution-card h3 {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.execution-step-kicker {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.execution-status-badge,
.execution-hop-status,
.execution-order-sequence {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  background: #0a1014;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.execution-status-badge.is-ready,
.execution-status-badge.is-success,
.execution-hop-status.is-ready {
  border-color: rgba(48, 217, 154, 0.35);
  background: var(--green-soft);
  color: var(--green);
}

.execution-status-badge.is-loading {
  border-color: rgba(255, 173, 41, 0.32);
  background: var(--amber-soft);
  color: var(--amber-bright);
}

.execution-status-badge.is-error,
.execution-status-badge.is-danger,
.execution-hop-status.is-error {
  border-color: rgba(255, 99, 117, 0.36);
  background: var(--red-soft);
  color: var(--red);
}

.execution-hop-status.is-link {
  border-color: rgba(70, 189, 227, 0.3);
  color: var(--blue);
}

.execution-wallet-card,
.execution-arm-card,
.execution-result-card {
  margin-bottom: 10px;
}

.execution-wallet-body {
  padding: 10px;
}

.execution-wallet-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.execution-wallet-body p,
.execution-card-note,
.execution-path-note,
.execution-trade-body p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.execution-card-note a {
  color: var(--blue);
}

.execution-address-chip,
.execution-chain-badge,
.execution-agent-address,
.execution-balance {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  background: #080d11;
  color: #c8d3d9;
  font-family: var(--font-mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.execution-chain-badge {
  border-color: rgba(70, 189, 227, 0.3);
  color: var(--blue);
}

.execution-primary-grid {
  display: grid;
  margin-bottom: 10px;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 10px;
}

.execution-fields {
  display: grid;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.execution-fields .execution-leverage-slot {
  grid-column: 1 / -1;
  min-width: 0;
}

.execution-field {
  display: grid;
  gap: 5px;
}

.execution-field > span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.execution-field input,
.execution-field select {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #080d11;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 10px;
}

.execution-leverage-slot {
  display: flex;
  min-width: 0;
  align-items: flex-end;
}

.execution-leverage-slot .global-leverage-control {
  width: 100%;
  min-height: 34px;
}

.execution-leverage-slot .field-control--leverage {
  height: 34px;
}

.execution-allocation-grid,
.execution-monitor-grid {
  display: grid;
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.execution-allocation-grid > div,
.execution-monitor-grid > div {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--line);
}

.execution-allocation-grid > div:last-child,
.execution-monitor-grid > div:nth-child(3n) {
  border-right: 0;
}

.execution-allocation-grid span,
.execution-monitor-grid span,
.execution-cost-row span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
}

.execution-allocation-grid strong,
.execution-monitor-grid strong,
.execution-cost-row strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.execution-allocation-grid small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
}

.execution-outcome-grid {
  display: grid;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.execution-outcome-grid article {
  padding: 10px;
  border: 1px solid var(--line);
  background: #090f13;
}

.execution-outcome-grid article.is-budget {
  border-color: rgba(255, 173, 41, 0.4);
  background: rgba(255, 173, 41, 0.045);
}

.execution-outcome-grid span,
.execution-outcome-grid small {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.execution-outcome-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.execution-outcome-grid b {
  display: block;
  margin: 1px 0 5px;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
}

.execution-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px;
}

.execution-cost-row p {
  max-width: 410px;
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  text-align: right;
}

.execution-inline-warning,
.execution-review-warning,
.execution-deposit-warning {
  margin: 0 10px 10px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 99, 117, 0.3);
  border-left: 2px solid var(--red);
  background: var(--red-soft);
  color: #e8aeb5;
  font-size: 9px;
}

.execution-hop-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.execution-hop {
  display: grid;
  min-width: 0;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
}

.execution-hop-index {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--amber);
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
}

.execution-hop > div > strong {
  color: var(--text-strong);
  font-size: 10px;
}

.execution-hop p {
  margin: 2px 0 6px;
  color: var(--muted);
  font-size: 9px;
}

.execution-link-button {
  width: fit-content;
  margin-top: 6px;
  text-decoration: none;
}

.execution-link-button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.46;
}

.execution-funding-card.is-testnet .execution-hop:first-child,
.execution-funding-card.is-testnet .execution-hop:nth-child(2) {
  opacity: 0.62;
}

.execution-deposit-warning {
  margin: 8px 0 0;
  color: #e5b5ba;
}

.execution-deposit-warning strong,
.execution-deposit-warning span {
  display: block;
}

.execution-deposit-warning strong {
  margin-bottom: 2px;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
}

.execution-path-note {
  padding: 0 10px 10px;
}

.execution-funding-cost-capture {
  margin: 0 10px 10px;
  border: 1px solid var(--line);
  background: #080d11;
}

.execution-funding-cost-capture summary {
  padding: 8px 9px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.execution-funding-cost-capture .trade-ledger-form-grid {
  padding: 0 9px 9px;
}

.execution-funding-cost-capture > p {
  margin: 0;
  padding: 0 9px 9px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.5;
}

.execution-arm-layout {
  display: grid;
  padding: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.execution-security-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 14px;
  color: #9dabb3;
  font-size: 9px;
}

.execution-security-list i {
  margin-right: 4px;
  color: var(--green);
  font-style: normal;
}

.execution-arm-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.execution-agent-address {
  max-width: 270px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.execution-arm-card > .execution-card-note {
  margin: 0;
  padding: 0 10px 10px;
}

.execution-trade-grid {
  display: grid;
  margin-bottom: 10px;
  grid-template-columns: 0.8fr 0.8fr 1.4fr;
  gap: 10px;
}

.execution-trade-body {
  padding: 10px;
}

.execution-trade-body p {
  min-height: 42px;
  margin-top: 0;
}

.execution-wide-button {
  width: 100%;
}

.button--danger {
  border-color: var(--red);
  background: var(--red);
  color: #22070b;
}

.button--danger:hover:not(:disabled) {
  background: #ff7c8b;
}

.button--danger:disabled {
  opacity: 0.42;
}

.execution-kill-card {
  border-color: rgba(255, 99, 117, 0.3);
}

.execution-order-sequence {
  color: var(--amber-bright);
}

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

.execution-monitor-grid > div:nth-child(-n + 3) {
  border-bottom: 1px solid var(--line);
}

.execution-monitor-card > .execution-card-note {
  padding: 0 10px 10px;
}

.execution-result-log {
  display: grid;
  min-height: 54px;
  gap: 6px;
  padding: 10px;
  color: #9cabb3;
  font-family: var(--font-mono);
  font-size: 9px;
}

.execution-result-log p {
  margin: 0;
}

.execution-result-log .is-success { color: var(--green); }
.execution-result-log .is-error { color: var(--red); font-weight: 800; }
.execution-result-log .is-warning { color: var(--amber-bright); font-weight: 800; }

.execution-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 10px 10px;
}

.execution-ambiguity-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--red);
  background: rgb(228 93 93 / 8%);
}

.execution-ambiguity-actions p {
  max-width: 760px;
  margin: 0;
  color: #f2b4b4;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.6;
}

/* Per-trade accounting ledger */
.execution-ledger-card {
  margin-bottom: 10px;
}

.trade-ledger-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.trade-ledger-empty {
  min-height: 184px;
  padding: 20px;
  text-align: center;
}

.trade-ledger-empty > span:not(.empty-glyph) {
  max-width: 620px;
  line-height: 1.55;
}

.trade-ledger-section[hidden],
.trade-ledger-empty[hidden],
.trade-ledger-form-status[hidden],
.trade-ledger-notice[hidden] {
  display: none !important;
}

.trade-ledger-notice {
  padding: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 173, 41, 0.08);
  color: #d8c092;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.55;
}

.trade-ledger-notice.is-success { background: rgba(72, 207, 143, 0.08); color: var(--green); }
.trade-ledger-notice ul { margin: 7px 0 0; padding-left: 17px; }

.trade-ledger-section {
  border-top: 1px solid var(--line);
}

.trade-ledger-section-header {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: #0b1217;
}

.trade-ledger-section-header h4 {
  margin: 2px 0 0;
  color: var(--text-strong);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trade-ledger-count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.trade-ledger-open-list {
  display: grid;
  padding: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 10px;
}

/* Class hooks used by dynamically rendered open-trade cards. */
.trade-ledger-trade-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #0a1014;
}

.trade-ledger-trade-header {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #101920;
}

.trade-ledger-trade-ident {
  min-width: 0;
}

.trade-ledger-trade-coin {
  display: block;
  overflow: hidden;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-ledger-trade-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.trade-ledger-plan-compare {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 6px;
  border: 1px solid rgba(255, 173, 41, 0.3);
  background: var(--amber-soft);
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 800;
  white-space: nowrap;
}

.trade-ledger-metric-grid {
  display: grid;
  padding: 1px;
  background: var(--line);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
}

.trade-ledger-metric {
  min-width: 0;
  padding: 9px;
  background: var(--panel);
}

.trade-ledger-metric-label {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.3;
  text-transform: uppercase;
}

.trade-ledger-metric:hover .col-info,
.trade-ledger-metric:focus-within .col-info,
.trade-ledger-table th:hover .col-info {
  border-color: var(--amber);
  color: var(--amber);
  opacity: 1;
}

button.trade-ledger-formula-marker,
.trade-ledger-table button.trade-ledger-formula-marker {
  position: relative;
  display: inline-grid;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim, #8b93a1);
  font-family: var(--font-mono);
  font-size: 8px;
  font-style: italic;
  line-height: 1;
  cursor: help;
}

button.trade-ledger-formula-marker:focus-visible {
  border-color: var(--amber);
  outline: 2px solid var(--amber-bright);
  outline-offset: 2px;
}

button.trade-ledger-formula-marker:hover::after,
button.trade-ledger-formula-marker:focus::after {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  width: max-content;
  max-width: min(240px, 70vw);
  padding: 6px 7px;
  border: 1px solid var(--line-strong);
  background: #11191f;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  color: var(--text);
  content: attr(data-tooltip);
  font-size: 8px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  white-space: normal;
}

.trade-ledger-metric strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-ledger-metric small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-ledger-metric.is-positive strong { color: var(--green); }
.trade-ledger-metric.is-negative strong { color: var(--red); }
.trade-ledger-metric.is-plan strong { color: var(--amber-bright); }

.trade-ledger-break-even,
.trade-ledger-final-line {
  margin: 0;
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  color: #b8c5cb;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
}

.trade-ledger-break-even strong,
.trade-ledger-final-line strong {
  color: var(--green);
}

.trade-ledger-accounting-limits {
  padding: 0 10px 9px;
  border-top: 1px solid var(--line);
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.5;
}

.trade-ledger-accounting-limits summary { padding: 8px 0 0; cursor: pointer; }
.trade-ledger-accounting-limits ul { margin: 7px 0 0; padding-left: 17px; color: var(--muted); }

.trade-ledger-cost-breakdown {
  border-top: 1px solid var(--line);
}

.trade-ledger-cost-breakdown summary {
  padding: 8px 10px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.trade-ledger-cost-grid {
  display: grid;
  padding: 0 10px 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.trade-ledger-cost-grid > div {
  padding: 7px;
  border: 1px solid var(--line);
  background: #080d11;
}

.trade-ledger-cost-grid span,
.trade-ledger-cost-grid strong,
.trade-ledger-cost-grid small {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
}

.trade-ledger-cost-grid span { color: var(--muted); }
.trade-ledger-cost-grid strong { margin-top: 3px; color: var(--text-strong); }
.trade-ledger-cost-grid small { margin-top: 3px; color: var(--muted-2); line-height: 1.35; }
.trade-ledger-cost-grid .trade-ledger-cost-label { display: flex; align-items: center; }

.trade-ledger-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior: contain;
}

.trade-ledger-table {
  --visible-columns: 5;
  min-width: max(100%, 620px);
}

.trade-ledger-table th {
  padding: 0 8px;
  font-size: 8px;
}

.trade-ledger-table th.numeric {
  text-align: right;
}

.trade-ledger-table tbody tr {
  cursor: default;
}

.trade-ledger-table .col-info {
  margin-left: 5px;
}

.trade-ledger-estimate-tag {
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 3px;
  border: 1px solid rgba(255, 173, 41, 0.35);
  color: var(--amber-bright);
  font-size: 7px;
}

.trade-ledger-table tr.is-estimate td { color: #d5c19c; }

.execution-review-dialog.trade-ledger-manual-dialog {
  width: min(760px, calc(100vw - 24px));
}

.trade-ledger-form-intro {
  margin: 0 0 11px;
  color: #aebbc2;
  font-size: 9px;
  line-height: 1.55;
}

.trade-ledger-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.trade-ledger-field-wide {
  grid-column: 1 / -1;
}

.trade-ledger-cost-fields {
  min-width: 0;
  margin: 13px 0 0;
  padding: 11px;
  border: 1px solid var(--line);
  background: #0a1014;
}

.trade-ledger-cost-fields legend {
  padding: 0 5px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trade-ledger-cost-fields > p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.trade-ledger-form-status {
  margin: 10px 0 0;
}

.execution-review-dialog {
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #090f13;
  color: var(--text);
  box-shadow: 0 25px 85px rgba(0, 0, 0, 0.68);
}

.execution-review-dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
}

.execution-review-shell {
  display: flex;
  max-height: calc(100dvh - 26px);
  flex-direction: column;
}

.execution-review-dialog .dialog-header {
  flex: 0 0 auto;
}

.execution-review-dialog h2 {
  margin-top: 3px;
  font-size: 14px;
}

.execution-review-content {
  min-height: 0;
  padding: 11px;
  overflow-y: auto;
}

.execution-review-warning {
  margin: 0 0 9px;
}

.execution-review-orders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.execution-review-order {
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.execution-review-order span,
.execution-review-order small {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.execution-review-order strong {
  display: block;
  margin: 5px 0;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 13px;
}

.execution-review-summary {
  display: grid;
  margin: 9px 0;
  border: 1px solid var(--line);
  grid-template-columns: auto minmax(0, 1fr);
}

.execution-review-summary dt,
.execution-review-summary dd {
  margin: 0;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8px;
}

.execution-review-summary dt {
  color: var(--muted);
  text-transform: uppercase;
}

.execution-review-summary dd {
  color: var(--text-strong);
  text-align: right;
}

.execution-confirm-check {
  position: relative;
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  background: #080d11;
  color: #aebbc2;
  cursor: pointer;
  font-size: 9px;
}

.execution-confirm-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.execution-confirm-check input:focus-visible + .custom-check {
  outline: 2px solid var(--amber-bright);
  outline-offset: 2px;
}

.execution-confirm-check input:checked + .custom-check {
  border-color: var(--amber);
  background: var(--amber);
}

.execution-confirm-check input:checked + .custom-check::after {
  position: absolute;
  top: 1px;
  left: 3px;
  width: 3px;
  height: 6px;
  transform: rotate(42deg);
  border-right: 1.5px solid #1a1207;
  border-bottom: 1.5px solid #1a1207;
  content: "";
}

.execution-review-footer {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 7px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #0e161c;
}

@media (max-width: 1180px) {
  .execution-primary-grid,
  .execution-trade-grid {
    grid-template-columns: 1fr 1fr;
  }

  .execution-funding-card,
  .execution-monitor-card {
    grid-column: 1 / -1;
  }

  .execution-fields {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 899px) {
  .execution-workspace {
    width: 100%;
    max-width: 100%;
    padding: 10px 9px 20px;
    overflow-x: clip;
  }

  .execution-module-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .execution-network-control {
    width: 100%;
    min-height: 44px;
  }

  .execution-network-control > span,
  .execution-network-control button {
    flex: 1 1 0;
  }

  .execution-safety-banner,
  .execution-primary-grid,
  .execution-trade-grid,
  .execution-arm-layout {
    grid-template-columns: 1fr;
  }

  .execution-funding-card,
  .execution-monitor-card {
    grid-column: auto;
  }

  .execution-fields {
    grid-template-columns: 1fr 1fr;
  }

  .execution-field input,
  .execution-field select {
    min-height: 44px;
    font-size: 16px;
  }

  .execution-leverage-slot {
    align-items: center;
  }

  .execution-leverage-slot .global-leverage-control {
    min-height: 44px;
  }

  .execution-security-list {
    grid-template-columns: 1fr;
  }

  .execution-arm-actions {
    justify-content: flex-start;
  }

  .trade-ledger-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .trade-ledger-open-list {
    grid-template-columns: 1fr;
  }

  .trade-ledger-table-scroll {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 440px) {
  .execution-safety-banner,
  .execution-fields,
  .execution-outcome-grid,
  .execution-review-orders {
    grid-template-columns: 1fr;
  }

  .execution-allocation-grid,
  .execution-monitor-grid {
    grid-template-columns: 1fr 1fr;
  }

  .execution-allocation-grid > div:nth-child(2n),
  .execution-monitor-grid > div:nth-child(2n) {
    border-right: 0;
  }

  .execution-allocation-grid > div,
  .execution-monitor-grid > div {
    border-bottom: 1px solid var(--line);
  }

  .execution-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .execution-card-header .button {
    width: 100%;
  }

  .execution-hop {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .execution-hop-status {
    grid-column: 2;
    width: fit-content;
  }

  .execution-cost-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .execution-cost-row p {
    text-align: left;
  }

  .trade-ledger-header-actions .execution-status-badge {
    width: 100%;
    justify-content: center;
  }

  .trade-ledger-empty {
    min-height: 210px;
    padding: 18px 12px;
  }

  .trade-ledger-section-header {
    align-items: flex-start;
  }

  .trade-ledger-metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .trade-ledger-cost-grid,
  .trade-ledger-form-grid {
    grid-template-columns: 1fr;
  }

  .trade-ledger-field-wide {
    grid-column: auto;
  }

  .trade-ledger-manual-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }

  .trade-ledger-manual-shell {
    max-height: calc(100dvh - 14px);
  }

  .trade-ledger-manual-dialog .execution-review-footer {
    flex-direction: column-reverse;
  }

  .trade-ledger-manual-dialog .execution-review-footer .button {
    width: 100%;
    flex: 0 0 auto;
  }

  .execution-review-footer .button {
    min-width: 0;
    flex: 1 1 0;
  }

  .execution-ambiguity-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* EXECUTION: action entry - pinned to the sidebar foot, unnumbered, light yellow */
.strategy-item.strategy-action {
  margin-top: auto;
  margin-bottom: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
}
.strategy-item.strategy-action .strategy-name {
  color: #f5d76e;
  letter-spacing: 0.08em;
}
.strategy-item.strategy-action.is-active .strategy-name,
.strategy-item.strategy-action:hover:not(:disabled) .strategy-name {
  color: #ffe9a3;
}
.strategy-item.strategy-action.is-active {
  border-color: rgba(245, 215, 110, 0.45);
}
