:root {
  color-scheme: light;
  --app-sticky-header-height: 76px;
  --app-fixed-chrome-height: 124px;
  --app-bg: #edf3f8;
  --app-surface: #ffffff;
  --app-surface-soft: #f6f9fc;
  --app-text: #10243d;
  --app-muted: #64788f;
  --app-border: #d4dfeb;
  --app-accent: #087fbd;
  --app-accent-soft: #e5f4fb;
  --app-positive: #07845b;
  --app-negative: #c83f4a;
}

body {
  background: var(--app-bg);
  color: var(--app-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell.page {
  display: block;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: var(--app-fixed-chrome-height) 0 0;
  background: var(--app-bg);
}

.app-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 14px 24px;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--app-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.app-brand h1 {
  color: var(--app-text);
  font-size: 14px;
  letter-spacing: .11em;
}

.app-brand .sub {
  margin-top: 3px;
  color: var(--app-muted);
  font-size: 11px;
  letter-spacing: .09em;
}

.hdr-right {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

#app-user-pill,
.btn-outline {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: var(--app-surface-soft);
  box-shadow: none;
  color: var(--app-text);
  font-size: 12px;
  letter-spacing: 0;
}

.btn-outline:hover {
  background: var(--app-accent-soft);
}

#app-user-pill span[style] {
  color: var(--app-muted) !important;
}

#app-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  color: #40556d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
  white-space: nowrap;
}

.app-tabs {
  position: fixed;
  top: var(--app-sticky-header-height);
  right: 0;
  left: 0;
  z-index: 29;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 0 24px;
  border: 0;
  border-bottom: 1px solid var(--app-border);
  border-radius: 0;
  background: var(--app-surface);
}

.app-tabs .tab {
  position: relative;
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.app-tabs .tab.active {
  background: transparent;
  box-shadow: none;
  color: var(--app-accent);
}

.app-tabs .tab.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--app-accent);
}

.app-nav-layout-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding-left: 18px;
  flex: 0 0 auto;
}

.app-nav-layout-controls .app-tool-button {
  min-height: 34px;
  padding: 6px 10px;
  background: var(--app-surface);
}

#panel {
  width: min(1680px, calc(100% - 28px));
  margin: 14px auto;
}

.app-trade-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-layout-toolbar {
  order: -1000;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 36px;
  margin-bottom: 10px;
}

.app-layout-toolbar > span {
  margin-right: auto;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.app-layout-add-control { position: relative; }

.app-layout-add-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 230px;
  max-height: 340px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--app-border);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(24,52,76,.18);
}

.app-layout-add-menu[hidden] { display: none; }
.app-layout-add-menu button { padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--app-text); text-align: left; cursor: pointer; }
.app-layout-add-menu button:hover, .app-layout-add-menu button:focus-visible { background: #eef8fd; outline: none; }
.app-layout-add-empty { padding: 9px 10px; color: var(--app-muted); }

.app-layout-drag-handle {
  display: none;
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 8;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #83b9da;
  border-radius: 7px;
  background: #fff;
  color: var(--app-accent);
  font: 800 17px/1 sans-serif;
  cursor: grab;
  box-shadow: 0 2px 7px rgba(20,70,105,.12);
}

.app-layout-remove-card {
  display: none;
  position: absolute;
  top: 7px;
  right: 42px;
  z-index: 8;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #e4a9a9;
  border-radius: 7px;
  background: #fff;
  color: #b42323;
  font: 800 18px/1 sans-serif;
  cursor: pointer;
}

.app-layout-editing [data-layout-id] {
  position: relative;
  outline: 2px dashed rgba(10,114,184,.28);
  outline-offset: 2px;
}

.app-layout-editing [data-layout-id] > .app-layout-drag-handle { display: inline-grid; place-items: center; }
.app-layout-editing [data-optional-card] > .app-layout-remove-card { display: inline-grid; place-items: center; }
.app-layout-editing .app-layout-drag-handle:active { cursor: grabbing; }
.app-layout-dragging { opacity: .52; }
.app-layout-drop-target { outline-color: var(--app-accent) !important; background-color: #f3faff !important; }

.app-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.app-stat,
.app-surface,
.app-content-panel {
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
  box-shadow: none;
}

.app-stat {
  min-height: 84px;
  padding: 13px 14px;
}

.app-stat > span,
.app-stat > small {
  display: block;
  color: var(--app-muted);
  font-size: 11px;
}

.app-stat > strong {
  display: block;
  margin-top: 7px;
  color: var(--app-text);
  font-size: 20px;
}

.app-news-stat { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.app-news-stat:hover, .app-news-stat:focus-visible { border-color: #1689c4; box-shadow: 0 7px 20px rgba(15, 112, 168, .11); outline: none; transform: translateY(-1px); }
.app-capacity-control { display: flex; align-items: center; gap: 7px; margin: 4px 0 3px; }
.app-capacity-control input { width: 68px; min-height: 31px; border: 1px solid #bfd0e2; border-radius: 8px; padding: 4px 8px; color: #0d213b; background: #fff; font: inherit; font-weight: 800; }
.app-capacity-control input:disabled { background: #edf2f7; color: #66778b; cursor: not-allowed; }
.app-capacity-control button { min-height: 31px; border: 1px solid #087fbd; border-radius: 8px; padding: 4px 10px; background: #0785c5; color: #fff; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.app-capacity-control button:disabled { opacity: .6; cursor: wait; }
.app-capacity-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-capacity-switch { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: #64748b; font-size: 11px; font-weight: 800; }
.app-capacity-switch input { position: absolute; opacity: 0; pointer-events: none; }
.app-capacity-switch i { width: 32px; height: 18px; padding: 2px; border-radius: 999px; background: #cbd5e1; transition: background .18s ease; }
.app-capacity-switch i::after { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.25); transition: transform .18s ease; }
.app-capacity-switch input:checked + i { background: #10b981; }
.app-capacity-switch input:checked + i::after { transform: translateX(14px); }
.app-capacity-switch input:focus-visible + i { outline: 2px solid #0785c5; outline-offset: 2px; }
.app-capacity-switch input:disabled + i { opacity: .55; cursor: not-allowed; }

.app-positive { color: #07834f !important; }
.app-negative { color: #c43333 !important; }

.app-status {
  display: inline-flex;
  min-width: 48px;
  justify-content: center;
  padding: 4px 7px;
  border-radius: 999px;
  background: #e9f2fb;
  color: #235175;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}
.app-status.buy { background: #dcf7ea; color: #077a49; }
.app-status.sell { background: #fee5e5; color: #b62e2e; }

.app-position-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.app-position-close {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid #c43333;
  border-radius: 7px;
  background: #c43333;
  color: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .035em;
  white-space: nowrap;
}

.app-position-close:hover,
.app-position-close:focus-visible { background: #a61f1f; outline: 2px solid rgba(196, 51, 51, .2); outline-offset: 2px; }
.app-position-close:disabled { cursor: wait; opacity: .65; }

.app-stat > small {
  margin-top: 5px;
}

.app-market-condition-stat > strong {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.app-market-condition-stat > strong b {
  font: inherit;
}

.app-market-condition-stat > strong em {
  border-radius: 999px;
  background: #edf2f7;
  color: #52657a;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 5px 8px;
  text-transform: uppercase;
}

.app-market-condition-stat > strong em.bullish { background: #dcf7ea; color: #077a49; }
.app-market-condition-stat > strong em.bearish { background: #fee5e5; color: #b62e2e; }
.app-market-condition-stat > strong em.neutral { background: #edf2f7; color: #52657a; }

.app-workspace {
  display: grid;
  grid-template-columns: 220px minmax(440px, 1fr) 250px;
  gap: 12px;
  align-items: stretch;
  height: 688px;
}

.app-watchlist,
.app-chart-surface,
.app-order-ticket {
  display: flex;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
}

.app-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--app-border);
}

.app-section-head strong,
.app-section-head small {
  display: block;
}

.app-section-head strong {
  color: var(--app-text);
  font-size: 13px;
}

.app-section-head small {
  margin-top: 3px;
  color: var(--app-muted);
  font-size: 10px;
}

.app-live,
.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 12px;
  background: var(--app-accent-soft);
  color: var(--app-accent);
  font-size: 10px;
  font-weight: 700;
}

.app-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--app-positive);
}

.app-search {
  padding: 10px;
  border-bottom: 1px solid var(--app-border);
}

.app-search input,
.app-order-body input,
.app-order-body select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  outline: none;
  background: var(--app-surface-soft);
  color: var(--app-text);
}

.app-search input:focus,
.app-order-body input:focus,
.app-order-body select:focus {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px rgba(8,127,189,.13);
}

.app-market-row {
  display: grid;
  grid-template-columns: 1fr auto;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--app-border);
  background: transparent;
  color: var(--app-text);
  text-align: left;
}

.app-market-row:last-child {
  border-bottom: 0;
}

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

.app-market-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.app-market-empty {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 24px 14px;
  color: var(--app-muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.app-market-empty strong {
  color: var(--app-text);
  font-size: 12px;
}

.app-market-row.selected {
  background: var(--app-accent-soft);
  box-shadow: inset 3px 0 var(--app-accent);
}

.app-market-row strong,
.app-market-row small {
  display: block;
}

.app-market-row strong {
  font-size: 12px;
}

.app-market-row small {
  margin-top: 3px;
  color: var(--app-muted);
  font-size: 10px;
}

.app-market-price {
  color: var(--app-text);
  font-size: 12px;
  text-align: right;
}

.app-chart-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 58px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--app-border);
}

.app-platform-control select {
  min-height: 32px;
  max-width: 190px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: var(--app-surface-soft);
  color: var(--app-text);
  font-size: 11px;
}

.app-symbol {
  margin-right: auto;
}

.app-symbol strong,
.app-symbol small {
  display: block;
}

.app-symbol strong {
  font-size: 16px;
}

.app-symbol small {
  margin-top: 3px;
  color: var(--app-muted);
  font-size: 10px;
}

.app-timeframes {
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-timeframes > span {
  margin-right: 2px;
  color: var(--app-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.app-timeframes button,
.app-tool-button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: var(--app-surface-soft);
  color: var(--app-text);
  font-size: 11px;
}

.app-timeframes button.active {
  border-color: var(--app-accent);
  background: var(--app-accent);
  color: #fff;
}

.app-chart-empty {
  position: relative;
  min-height: 318px;
  padding: 10px;
  overflow: hidden;
  color: var(--app-accent);
}

.app-tv-chart {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  background: var(--app-surface);
}

.app-tv-chart iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

.app-chart-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 590px;
  padding: 24px;
  color: var(--app-muted);
  text-align: center;
}

.app-chart-message strong {
  color: var(--app-text);
  font-size: 15px;
}

.app-chart-message span {
  max-width: 440px;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.5;
}

.app-chart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 38px;
  padding: 8px 12px;
  border-top: 1px solid var(--app-border);
  color: var(--app-muted);
  font-size: 10px;
}

.app-broker-pill {
  display: inline-flex;
  align-items: center;
}

.app-monitoring-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

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

.app-chart-empty svg {
  display: block;
  width: 100%;
  height: 260px;
}

.app-chart-grid line {
  stroke: var(--app-border);
  stroke-width: 1;
}

.app-chart-area {
  fill: url(#appChartFill);
}

.app-chart-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
}

.app-chart-empty > div {
  position: absolute;
  bottom: 16px;
  left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.app-chart-empty > div strong {
  color: var(--app-text);
  font-size: 12px;
}

.app-chart-empty > div span {
  color: var(--app-muted);
  font-size: 10px;
}

.app-order-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.app-side-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 12px;
}

.app-side-picker button {
  min-height: 38px;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  background: var(--app-surface-soft);
  color: var(--app-text);
  font-weight: 800;
}

.app-side-picker .buy.active {
  border-color: var(--app-positive);
  background: var(--app-positive);
  color: #fff;
}

.app-side-picker .sell.active {
  border-color: var(--app-negative);
  background: var(--app-negative);
  color: #fff;
}

.app-order-body label {
  display: block;
  margin: 10px 0;
  color: var(--app-muted);
  font-size: 11px;
}

.app-order-body label input,
.app-order-body label select {
  margin-top: 5px;
}

.app-order-sizing,
.app-protection-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.app-protection-grid {
  grid-template-columns: 1fr 1fr;
}

.app-order-sizing label,
.app-protection-grid label {
  min-width: 0;
}

.app-protection-grid label {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.app-protection-grid label input {
  margin-top: auto;
}

.app-order-sizing input,
.app-protection-grid input {
  width: 100%;
}

.app-risk-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  padding: 9px 10px;
  border-radius: 7px;
  background: var(--app-accent-soft);
  color: var(--app-text);
  font-size: 10px;
}

.app-review-order {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: var(--app-accent);
  color: #fff;
  font-weight: 800;
}

.app-order-note {
  margin: 9px 0 0;
  color: var(--app-muted);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.app-positions {
  margin-top: 12px;
}

.app-portfolio-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-portfolio-head {
  margin-bottom: 0;
}

.app-portfolio-head h2 {
  margin: 6px 0 4px;
}

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

.app-position-table {
  margin: 0;
  border: 0;
  border-radius: 0 0 10px 10px;
}

.app-position-row {
  transition: background .16s ease, box-shadow .16s ease;
}

.app-position-row:hover {
  background: #eef8fd;
  box-shadow: inset 3px 0 var(--app-accent);
}

.app-position-instrument-cell { padding: 0 !important; }
.app-position-chart-link {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--app-text);
  cursor: pointer;
  flex-direction: column;
  text-align: left;
}
.app-position-chart-link small {
  margin-top: 2px;
  color: var(--app-accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.app-position-chart-link:hover,
.app-position-chart-link:focus-visible,
.app-position-detail-cell:hover,
.app-position-detail-cell:focus-visible {
  outline: 0;
  background: var(--app-accent-soft);
  box-shadow: inset 0 -2px var(--app-accent);
}
.app-position-detail-cell { cursor: pointer; }

.app-position-open {
  color: var(--app-accent);
  font-size: 11px;
  font-weight: 800;
}

.app-position-backdrop {
  place-items: center;
  overflow: hidden;
  padding: 16px;
}

.app-position-modal {
  width: min(1120px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 16px;
  background: var(--app-surface);
  box-shadow: 0 26px 80px rgba(9, 30, 52, .32);
  color: var(--app-text);
}

#app-position-modal > .app-position-modal { width: min(1380px, 100%); }

.app-position-modal-head {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 72px 20px 24px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
}

.app-position-modal-head h2 {
  margin: 6px 0 3px;
  font-size: 25px;
}

.app-position-title-row h2 { flex: 0 1 auto; }

.app-position-title-row .app-position-close {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0;
  vertical-align: baseline;
}

.app-position-modal-head p {
  margin: 0;
  color: var(--app-muted);
  font-size: 12px;
}

.app-position-modal-head .app-modal-close {
  top: 18px;
  right: 20px;
}

.app-position-head-actions { display: flex; align-items: center; gap: 9px; }
.app-position-head-actions .app-modal-close { position: static; }
.app-position-head-actions .app-position-close { min-height: 36px; padding: 7px 12px; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 800; }
.app-position-print { min-height: 36px; padding-inline: 12px; font-size: 13px; font-weight: 700; }

@media print {
  body.printing-app-position-evidence > * { display: none !important; }
  body.printing-app-position-evidence > #app-position-modal { display: block !important; position: static; padding: 0; background: #fff; }
  body.printing-app-position-evidence #app-position-modal > .app-position-modal { width: 100%; max-width: none; max-height: none; overflow: visible; border-radius: 0; box-shadow: none; }
  body.printing-app-position-evidence .app-position-head-actions,
  body.printing-app-position-evidence .app-position-modal-foot { display: none !important; }
}

.app-position-hero {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--app-border);
  border-bottom: 1px solid var(--app-border);
}

.app-position-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
  background: var(--app-surface-soft);
}

.app-position-card {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface);
}

.app-position-card h3 {
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid var(--app-border);
  font-size: 14px;
}

.app-position-fact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 11px 14px;
  border-bottom: 1px solid #e8eef5;
}

.app-position-hero .app-position-fact {
  display: block;
  min-height: 72px;
  border: 0;
  background: var(--app-surface);
}

.app-position-fact:last-child { border-bottom: 0; }
.app-position-fact span { color: var(--app-muted); font-size: 11px; }
.app-position-fact strong { overflow-wrap: anywhere; text-align: right; font-size: 13px; }
.app-position-hero .app-position-fact strong { display: block; margin-top: 7px; text-align: left; font-size: 16px; }

.app-position-modal-foot {
  position: sticky;
  z-index: 5;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--app-border);
  color: var(--app-muted);
  font-size: 11px;
  background: var(--app-surface);
}

.app-evidence-loading {
  padding: 22px;
  border-top: 1px solid var(--app-border);
  color: var(--app-muted);
  background: var(--app-surface-soft);
  text-align: center;
}
.app-evidence-error { color: #b42318; }
.app-trade-evidence { padding: 20px; border-top: 1px solid var(--app-border); background: var(--app-surface-soft); }
.app-evidence-head,
.app-evidence-chart-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.app-evidence-head { margin-bottom: 14px; }
.app-evidence-head h3 { margin: 5px 0 2px; font-size: 20px; }
.app-evidence-head p,
.app-evidence-chart-title span { margin: 0; color: var(--app-muted); font-size: 11px; }
.app-evidence-status { padding: 7px 10px; border: 1px solid #9ed7bd; border-radius: 999px; background: #eaf8f1; color: #08734e; font-size: 11px; font-weight: 800; }
.app-evidence-notice { margin-bottom: 14px; padding: 11px 13px; border: 1px solid #efd598; border-radius: 9px; background: #fff7e3; color: #765000; font-size: 12px; font-weight: 700; }
.app-evidence-notice.confirmed { border-color: #9ed7bd; background: #eaf8f1; color: #08734e; }
.app-evidence-chart-card { overflow: hidden; border: 1px solid var(--app-border); border-radius: 12px; background: var(--app-surface); }
.app-evidence-chart-title { padding: 12px 14px; border-bottom: 1px solid var(--app-border); }
.app-evidence-chart { display: block; width: 100%; height: clamp(230px, 36vh, 320px); min-height: 0; background: #fbfdff; }
.app-evidence-gridline { stroke: #dbe5ef; stroke-width: 1; }
.app-evidence-axis { fill: #52677e; font-size: 11px; }
.app-evidence-entry,.app-evidence-stop,.app-evidence-target { stroke-width: 2; stroke-dasharray: 8 6; }
.app-evidence-entry { stroke: #087fc4; }.app-evidence-stop { stroke: #c42b1c; }.app-evidence-target { stroke: #07875f; }
.app-evidence-entry-text { fill: #087fc4; }.app-evidence-stop-text { fill: #c42b1c; }.app-evidence-target-text { fill: #07875f; }
.app-evidence-entry-text,.app-evidence-stop-text,.app-evidence-target-text { font-size: 12px; font-weight: 800; }
.app-evidence-empty { display: grid; min-height: 180px; place-items: center; color: var(--app-muted); }
.app-evidence-metrics { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 1px; margin-top: 14px; overflow: hidden; border: 1px solid var(--app-border); border-radius: 12px; background: var(--app-border); }
.app-evidence-metrics .app-position-fact { display: block; border: 0; background: var(--app-surface); }
.app-evidence-metrics .app-position-fact strong { display: block; margin-top: 6px; text-align: left; }
.app-evidence-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.app-trade-evidence > .app-evidence-chart-card:last-child { margin-top: 14px; }
.app-evidence-lifecycle { grid-column: 1 / -1; }
.app-evidence-lifecycle ol { display: grid; gap: 8px; margin: 0; padding: 14px 14px 14px 34px; }
.app-evidence-lifecycle li { padding-left: 4px; }
.app-evidence-lifecycle li span { margin-left: 10px; color: var(--app-muted); font-size: 11px; }
.app-evidence-copy { padding: 12px 14px; border-top: 1px solid #e8eef5; color: var(--app-muted); font-size: 12px; }
.app-evidence-copy > strong { display: block; margin-bottom: 7px; color: var(--app-text); }
.app-evidence-list { display: grid; gap: 6px; margin: 0; padding: 12px 18px 14px 34px; color: var(--app-muted); font-size: 12px; }
.app-evidence-copy .app-evidence-list { padding: 7px 4px 0 18px; }

/* NATE-originated positions use NATE's BossAI evidence composition. */
.app-nate-opportunity-shell { width: min(1380px, 100%); max-height: calc(100dvh - 32px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--app-border); border-radius: 13px; background: var(--app-surface); color: var(--app-text); box-shadow: 0 24px 80px rgba(18,34,56,.25); }
.app-nate-opportunity-head,
.app-nate-opportunity-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px 16px; }
.app-nate-opportunity-head { position: relative; border-bottom: 1px solid var(--app-border); }
.app-nate-opportunity-head h2 { margin: 4px 0 0; font-size: 20px; }
.app-nate-opportunity-head p,
.app-nate-chart-card header p { margin: 3px 0 0; color: var(--app-muted); font-size: 12px; }
.app-nate-eyebrow { color: var(--app-accent) !important; font-size: 10px !important; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.app-nate-opportunity-actions { display: flex; align-items: center; gap: 9px; }
.app-nate-opportunity-actions .app-modal-close { position: static; }
.app-nate-opportunity-actions .app-position-close { min-height: 36px; padding: 7px 12px; border: 1px solid #c52b20; border-radius: 8px; background: #c52b20; color: #fff; cursor: pointer; font: inherit; font-weight: 800; }
.app-nate-print { min-height: 36px; padding-inline: 12px; font-size: 13px; font-weight: 700; }
.app-nate-safety { margin: 0; padding: 10px 16px; border-bottom: 1px solid #efd598; background: #fff7e3; color: #684600; font-weight: 650; }
.app-nate-safety.confirmed-fill { border-color: #9fd8bd; background: #e8f7ef; color: #09643d; }
.app-nate-safety.failed-execution { border-color: #efb3b3; background: #fff0f0; color: #8e1f1f; }
.app-nate-opportunity-layout { display: grid; grid-template-columns: minmax(0,1fr); }
.app-nate-evidence-sidebar { display: block; columns: 2 420px; column-gap: 12px; padding: 14px; background: var(--app-surface-soft); }
.app-nate-evidence-metrics { column-span: all; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }
.app-nate-evidence-metrics .app-position-fact { display: block; min-width: 0; padding: 9px; border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); }
.app-nate-evidence-metrics .app-position-fact strong { display: block; margin-top: 3px; text-align: left; }
.app-nate-evidence-section { display: inline-block; width: 100%; margin: 0 0 12px; padding: 11px; break-inside: avoid; border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); vertical-align: top; }
.app-nate-evidence-section h3 { margin: 0; font-size: 14px; }
.app-nate-evidence-section h4 { margin: 11px 0 0; }
.app-nate-evidence-section > p { margin: 7px 0 0; color: #40556d; }
.app-nate-evidence-reference { border-color: #b9d7eb; background: #edf7fd; }
.app-nate-levels { display: grid; margin-top: 8px; padding: 4px 11px; border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); }
.app-nate-levels .app-position-fact { padding: 7px 0; }
.app-nate-lifecycle { display: grid; gap: 7px; margin: 8px 0 0; padding-left: 20px; }
.app-nate-lifecycle strong,
.app-nate-lifecycle span { display: block; }
.app-nate-lifecycle span { margin-top: 2px; color: var(--app-muted); font-size: 11px; }
.app-nate-chart-card { min-width: 0; padding: 14px; border-top: 1px solid var(--app-border); }
.app-nate-chart-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.app-nate-chart-card h3 { margin: 0; font-size: 14px; }
.app-nate-chart-card .app-evidence-chart { height: auto; min-height: 390px; border: 1px solid var(--app-border); border-radius: 9px; }
.app-nate-legend { display: flex; flex-wrap: wrap; gap: 18px; padding: 10px 2px 0; color: var(--app-muted); font-size: 12px; }
.app-nate-legend span { display: inline-flex; align-items: center; gap: 6px; }
.app-nate-legend i { display: inline-block; width: 22px; border-top: 3px solid; }
.app-nate-legend .entry { border-color: #087fc4; }
.app-nate-legend .stop { border-color: #c42b1c; }
.app-nate-legend .target { border-color: #07875f; }
.app-nate-opportunity-foot { flex-wrap: wrap; border-top: 1px solid var(--app-border); color: var(--app-muted); font-size: 12px; }

.app-empty-table {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 105px;
  padding: 18px;
  color: var(--app-muted);
  text-align: center;
}

.app-empty-table strong {
  color: var(--app-text);
  font-size: 13px;
}

.app-empty-table span {
  margin-top: 5px;
  font-size: 11px;
}

.app-content-panel.card {
  padding: 18px;
  background: var(--app-surface);
  color: var(--app-text);
}

.app-content-panel .muted,
.app-content-panel .item .meta,
.app-content-panel .canvas {
  color: var(--app-muted);
}

.app-content-panel .btn,
.app-content-panel .seg .chip {
  border-color: var(--app-border);
  background: var(--app-surface-soft);
  color: var(--app-text);
}

.app-content-panel .btn.primary,
.app-content-panel .seg .chip.active {
  border-color: var(--app-accent);
  background: var(--app-accent);
  color: #fff;
  box-shadow: none;
}

.app-content-panel .in,
.app-content-panel .item,
.app-content-panel .canvas {
  border-color: var(--app-border);
  background: var(--app-surface-soft);
  color: var(--app-text);
}

.app-included-detail,
.app-included-empty {
  color: var(--app-text);
}

.app-included-label {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 12px;
  background: var(--app-accent-soft);
  color: var(--app-accent);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.app-included-detail h2 {
  margin: 16px 0 8px;
  font-size: 24px;
}

.app-included-detail p,
.app-included-empty span {
  color: var(--app-muted);
  line-height: 1.6;
}

.app-included-detail dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.app-included-detail dl div {
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
}

.app-included-detail dt {
  color: var(--app-muted);
  font-size: 10px;
}

.app-included-detail dd {
  margin: 5px 0 0;
  font-weight: 700;
}

.app-included-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 260px;
  text-align: center;
}

.app-included-empty strong {
  font-size: 17px;
}

.app-included-empty span {
  margin-top: 6px;
}

.app-marketplace-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-marketplace-subscribed {
  margin-bottom: 12px;
  padding: 20px 22px;
  border: 1px solid var(--app-border);
  border-top: 3px solid #10b981;
  border-radius: 12px;
  background: var(--app-surface);
}

.app-marketplace-subscribed-head,
.app-marketplace-subscribed-card,
.app-marketplace-subscribed-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.app-marketplace-subscribed-head > div > span {
  color: #047857;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.app-marketplace-subscribed-head h2 {
  margin: 6px 0 4px;
  font-size: 22px;
}

.app-marketplace-subscribed-head p,
.app-marketplace-subscribed-empty span {
  margin: 0;
  color: var(--app-muted);
  font-size: 12px;
}

.app-marketplace-subscribed-head > strong,
.app-marketplace-subscribed-actions > span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #047857;
  font-size: 11px;
  white-space: nowrap;
}

.app-marketplace-subscribed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.app-marketplace-subscribed-card {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--app-border);
  border-radius: 9px;
  background: #f8fbfd;
}

.app-marketplace-subscribed-card > div:first-child {
  min-width: 0;
}

.app-marketplace-subscribed-card > div:first-child > span {
  color: var(--app-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.app-marketplace-subscribed-card h3 {
  margin: 4px 0 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-marketplace-subscribed-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  background: var(--app-surface);
  color: var(--app-text);
  font-weight: 800;
}

.app-marketplace-subscribed-actions .app-cancel-subscription {
  border-color: #fecaca;
  background: #fff;
  color: #b91c1c;
}

.app-marketplace-subscribed-actions .app-cancel-subscription:hover {
  border-color: #dc2626;
  background: #fef2f2;
}

.app-marketplace-subscribed-actions .app-cancel-subscription:disabled {
  cursor: wait;
  opacity: .6;
}

.app-marketplace-subscribed-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 15px;
  border: 1px dashed var(--app-border);
  border-radius: 9px;
  background: #f8fbfd;
}

.app-marketplace-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 24px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: linear-gradient(120deg, #ffffff 0%, #eef8fc 100%);
}

.app-marketplace-hero > div:first-child {
  max-width: 720px;
}

.app-marketplace-hero > div > span {
  color: var(--app-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.app-marketplace-hero h2 {
  margin: 8px 0;
  font-size: 26px;
}

.app-marketplace-hero p {
  margin: 0;
  color: var(--app-muted);
  line-height: 1.55;
}

.app-marketplace-price {
  min-width: 180px;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
  text-align: center;
}

.app-marketplace-price strong,
.app-marketplace-price span {
  display: block;
}

.app-marketplace-price strong {
  font-size: 20px;
}

.app-marketplace-price span {
  margin-top: 4px;
  color: var(--app-muted);
  font-size: 11px;
}

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

.app-marketplace-card {
  display: flex;
  flex-direction: column;
  min-height: 240px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
}

.app-marketplace-card-top,
.app-marketplace-card-bottom,
.app-modal-payment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-marketplace-card-top > span:first-child {
  color: var(--app-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.app-lock {
  padding: 5px 8px;
  border-radius: 12px;
  background: #fff5df;
  color: #9a6100;
  font-size: 10px;
  font-weight: 800;
}

.app-marketplace-card h3 {
  margin: 18px 0 8px;
  font-size: 18px;
}

.app-marketplace-card p {
  flex: 1;
  margin: 0 0 20px;
  color: var(--app-muted);
  font-size: 12px;
  line-height: 1.55;
}

.app-marketplace-card-bottom strong {
  font-size: 15px;
}

.app-marketplace-card-bottom strong small {
  color: var(--app-muted);
  font-size: 10px;
  font-weight: 500;
}

.app-marketplace-card-bottom button,
.app-modal-payment button {
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: var(--app-accent);
  color: #fff;
  font-weight: 800;
}

.app-marketplace-empty {
  grid-column: 1 / -1;
  padding: 30px;
  color: var(--app-muted);
  text-align: center;
}

.app-strategy-library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.app-strategy-library-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-top: 3px solid #94a3b8;
  border-radius: 10px;
  background: var(--app-surface);
  color: var(--app-text);
}

.app-strategy-library-card.is-trading { border-top-color: #10b981; }

.app-strategy-library-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--app-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.app-strategy-state {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
}

.is-trading .app-strategy-state { background: #dcfce7; color: #047857; }
.app-strategy-library-card h3 { margin: 17px 0 8px; font-size: 18px; }
.app-strategy-library-card > p {
  flex: 1;
  margin: 0 0 16px;
  color: var(--app-muted);
  font-size: 12px;
  line-height: 1.55;
}
.app-strategy-access { margin-bottom: 12px; color: var(--app-accent); font-size: 11px; font-weight: 800; }
.app-strategy-lifecycle-badge {
  align-self: flex-start;
  margin: 0 0 7px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .045em;
}
.app-strategy-lifecycle-badge.status-released { background:#dcfce7; color:#047857; }
.app-strategy-lifecycle-badge.status-forward-testing { background:#dbeafe; color:#1d4ed8; }
.app-strategy-lifecycle-badge.status-under-investigation { background:#fef3c7; color:#92400e; }
.app-strategy-lifecycle-badge.status-failed { background:#fee2e2; color:#b91c1c; }
.app-strategy-lifecycle-detail { margin:0 0 9px; color:var(--app-muted); font-size:11px; font-weight:650; }
.app-strategy-library-card.lifecycle-released { border-top-color:#10b981; }
.app-strategy-library-card.lifecycle-forward-testing { border-top-color:#3b82f6; }
.app-strategy-library-card.lifecycle-under-investigation { border-top-color:#f59e0b; }
.app-strategy-library-card.lifecycle-failed { border-top-color:#ef4444; }
.app-strategy-status-filter { display:flex; align-items:center; gap:7px; color:var(--app-muted); font-size:11px; font-weight:750; }
.app-strategy-status-filter select { min-width:155px; }
.app-strategy-library-card .app-strategy-card-actions {
  justify-content: space-between;
  padding-top: 13px;
  border-top: 1px solid var(--app-border);
}

.app-modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 21, 38, .62);
}

.app-strategy-modal {
  position: relative;
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 14px;
  background: var(--app-surface);
  box-shadow: 0 24px 70px rgba(9, 30, 52, .28);
  color: var(--app-text);
}

.app-strategy-settings-dialog {
  width: min(1080px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  overscroll-behavior: contain;
}
.app-strategy-settings-dialog .app-modal-kicker {
  position: sticky;
  top: -28px;
  z-index: 2;
  margin: -28px -28px 18px;
  padding: 20px 72px 14px 28px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
}
.app-strategy-settings-dialog .app-modal-close {
  position: sticky;
  z-index: 3;
  top: 0;
  float: right;
  margin: -2px -2px -36px 12px;
}
.app-strategy-settings-dialog .btn {
  border-color: var(--app-border);
  background: var(--app-surface-soft);
  color: var(--app-text);
  box-shadow: none;
}
.app-strategy-settings-dialog .btn.primary {
  border-color: var(--app-accent);
  background: var(--app-accent);
  color: #fff;
}
.app-strategy-settings-dialog .muted { color: var(--app-muted); }

.app-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--app-border);
  border-radius: 50%;
  background: var(--app-surface-soft);
  color: var(--app-text);
  font-size: 22px;
}

.app-modal-kicker {
  padding-right: 45px;
  color: var(--app-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.app-strategy-modal h2 {
  margin: 8px 45px 10px 0;
  font-size: 26px;
}

.app-strategy-modal > p {
  color: var(--app-muted);
  line-height: 1.6;
}

.app-modal-feature {
  margin: 20px 0;
  padding: 14px;
  border-radius: 9px;
  background: var(--app-surface-soft);
}

.app-modal-feature strong {
  font-size: 12px;
}

.app-modal-feature ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--app-muted);
  font-size: 12px;
  line-height: 1.7;
}

.app-modal-payment {
  padding-top: 18px;
  border-top: 1px solid var(--app-border);
}

.app-modal-payment > div strong,
.app-modal-payment > div span {
  display: block;
}

.app-modal-payment > div strong {
  font-size: 22px;
}

.app-modal-payment > div span {
  color: var(--app-muted);
  font-size: 11px;
}

.app-payment-status {
  margin: 12px 0 0 !important;
  font-size: 11px;
  text-align: center;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(8,127,189,.24);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .app-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-workspace {
    grid-template-columns: 200px minmax(400px, 1fr);
    height: auto;
  }

  .app-order-ticket {
    grid-column: 1 / -1;
  }

  .app-watchlist,
  .app-chart-surface,
  .app-order-ticket {
    height: auto;
  }

  .app-market-list,
  .app-tv-chart,
  .app-tv-chart iframe,
  .app-chart-message {
    min-height: 520px;
    max-height: 520px;
  }

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

  .app-marketplace-subscribed-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hdr-right,
  .top-links {
    align-items: flex-start;
    justify-content: flex-start;
  }

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

  .app-workspace {
    grid-template-columns: 1fr;
  }

  .app-order-ticket {
    grid-column: auto;
  }

  .app-marketplace-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .app-marketplace-subscribed-head,
  .app-marketplace-subscribed-card {
    align-items: stretch;
    flex-direction: column;
  }

  .app-marketplace-subscribed-actions {
    width: 100%;
  }

  .app-marketplace-price {
    min-width: 0;
    text-align: left;
  }

  .app-marketplace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .app-header,
  .app-tabs {
    padding-right: 14px;
    padding-left: 14px;
  }

  #panel {
    width: calc(100% - 20px);
    margin: 10px auto;
  }

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

  .app-chart-tools {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .app-symbol {
    width: 100%;
  }

  .app-platform-control {
    flex: 1 1 100%;
  }

  .app-platform-control select {
    width: 100%;
    max-width: none;
  }

  .app-modal-payment {
    align-items: stretch;
    flex-direction: column;
  }

  .app-modal-payment button {
    width: 100%;
  }
}

/* Authenticated App strategy, order and platform workspaces */
.app-strategy-editor { color: #0f172a; }
.app-strategy-editor > header,
.app-record-head,
.app-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.app-strategy-editor h2,
.app-record-head h2,
.app-settings-layout h2 { margin: 8px 0 4px; }
.app-strategy-editor section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #dbe4ef;
}
.app-strategy-editor h3 { margin: 0 0 12px; }
.app-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.app-form-grid label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
.app-form-grid input,
.app-form-grid select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
}
.app-switch-field {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  align-content: center;
  column-gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #dbe4ef;
  border-radius: 9px;
  background: #f8fafc;
}
.app-switch-field input { min-height: 0; width: 18px; height: 18px; margin: 0; }
.app-acknowledgement-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.app-acknowledgement-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  column-gap: 12px;
  margin: 0;
  color: #334155;
  line-height: 1.45;
  cursor: pointer;
}
.app-acknowledgement-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}
.app-editor-actions { margin-top: 20px; }
.app-record-head p,
.app-settings-layout p { margin: 4px 0; color: #64748b; }
.app-table-wrap { overflow: auto; margin-top: 16px; border: 1px solid #dbe4ef; border-radius: 12px; }
.app-data-table { width: 100%; border-collapse: collapse; color: #0f172a; font-size: 13px; }
.app-data-table th,
.app-data-table td { padding: 11px 12px; border-bottom: 1px solid #e2e8f0; text-align: left; white-space: nowrap; }
.app-data-table th { background: #f8fafc; color: #475569; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.app-data-table tr:last-child td { border-bottom: 0; }
.app-data-table .app-trade-action { text-align: right; }
.app-table-close { min-height: 30px; padding: 5px 10px; border: 1px solid #c52b20; border-radius: 7px; background: #c52b20; color: #fff; cursor: pointer; font: inherit; font-size: 11px; font-weight: 800; white-space: nowrap; }
.app-table-close:hover, .app-table-close:focus-visible { background: #a61f1f; outline: 2px solid rgba(196,51,51,.2); outline-offset: 2px; }
.app-table-close:disabled { cursor: wait; opacity: .65; }
.app-journal-modal { width: min(1680px, calc(100vw - 28px)); max-width: none; }
.app-journal-hero { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.app-journal-type-switch { display: inline-flex; gap: 4px; margin-top: 14px; padding: 4px; border: 1px solid var(--app-border); border-radius: 9px; background: var(--app-surface-soft); }
.app-journal-type-switch button { min-width: 92px; min-height: 36px; padding: 7px 15px; border: 0; border-radius: 6px; background: transparent; color: var(--app-muted); cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .05em; }
.app-journal-type-switch button.active { background: var(--app-accent); color: #fff; box-shadow: 0 2px 8px rgba(2,132,199,.2); }
.app-journal-type-switch button:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.app-journal-surface { margin-top: 16px; overflow: hidden; border: 1px solid var(--app-border); border-radius: 12px; background: var(--app-surface); }
.app-journal-list-head,
.app-journal-entry { display: grid; grid-template-columns: minmax(150px,1fr) minmax(230px,1.8fr) minmax(90px,.55fr) minmax(170px,1fr) minmax(180px,1fr); gap: 14px; align-items: center; }
.app-journal-list-head { padding: 10px 13px; border-bottom: 1px solid var(--app-border); background: var(--app-surface-soft); color: var(--app-muted); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.app-journal-list { display: grid; }
.app-journal-entry { width: 100%; padding: 13px; border: 0; border-bottom: 1px solid var(--app-border); background: var(--app-surface); color: var(--app-text); text-align: left; cursor: pointer; }
.app-journal-entry:last-child { border-bottom: 0; }
.app-journal-entry:hover,
.app-journal-entry:focus-visible { outline: 0; background: #eef8fd; box-shadow: inset 3px 0 var(--app-accent); }
.app-journal-entry time { color: var(--app-muted); }
.app-journal-instrument,
.app-journal-result { display: grid; gap: 2px; }
.app-journal-instrument small { color: var(--app-accent); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.app-journal-status { display: inline-flex; width: fit-content; padding: 5px 8px; border: 1px solid var(--app-border); border-radius: 999px; background: var(--app-surface-soft); font-size: 11px; font-weight: 800; }
.app-journal-result { color: var(--app-muted); font-size: 12px; text-align: left; white-space: normal; }
.app-journal-result strong { color: inherit; font-size: 13px; }
.app-journal-result small { font-size: 10px; }
.app-journal-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-top: 1px solid var(--app-border); color: var(--app-muted); font-size: 12px; }
.app-journal-pagination > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.app-journal-page { min-width: 34px; min-height: 32px; padding: 5px 9px; border: 1px solid var(--app-border); border-radius: 7px; background: var(--app-surface); color: var(--app-text); cursor: pointer; font-weight: 700; }
.app-journal-page.active { border-color: var(--app-accent); background: var(--app-accent); color: #fff; }
.app-journal-page:disabled { cursor: default; opacity: .45; }
.app-journal-detail { display: grid; gap: 12px; padding: 16px; background: var(--app-surface-soft); }
.app-journal-position-chart { overflow: hidden; border: 1px solid var(--app-border); border-radius: 10px; background: var(--app-surface); }
.app-journal-position-chart > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 13px 14px; border-bottom: 1px solid var(--app-border); }
.app-journal-position-chart > header h3 { margin: 0; color: var(--app-accent); font-size: 15px; }
.app-journal-position-chart > header p { margin: 4px 0 0; color: var(--app-muted); font-size: 11px; }
.app-journal-position-chart > header > span { color: var(--app-text); font-weight: 800; }
.app-journal-position-metrics { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 1px; background: var(--app-border); }
.app-journal-position-metrics .app-position-fact { display: block; border: 0; background: var(--app-surface); }
.app-journal-position-metrics .app-position-fact strong { display: block; margin-top: 5px; text-align: left; }
.app-journal-position-chart .app-evidence-chart { height: clamp(300px,45vh,480px); }
.app-journal-chart-loading { display: grid; min-height: 300px; place-items: center; color: var(--app-muted); }
.app-journal-detail-section { overflow: hidden; border: 1px solid var(--app-border); border-radius: 10px; background: var(--app-surface); }
.app-journal-detail-section > h3 { margin: 0; padding: 13px 14px; border-bottom: 1px solid var(--app-border); color: var(--app-accent); font-size: 15px; }
.app-journal-review { border-color: #b9d9eb; background: #f4faff; }
.app-journal-review-reason { margin: 13px 14px; padding: 11px 12px; border-left: 3px solid var(--app-accent); background: var(--app-surface); }
.app-journal-review > strong { display: block; margin: 12px 14px 0; }
.app-journal-review-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; margin: 0 14px 13px; overflow: hidden; border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-border); }
.app-journal-review-facts div { min-width: 0; padding: 10px; background: var(--app-surface); }
.app-journal-review-facts dt,
.app-journal-facts dt { color: var(--app-muted); font-size: 11px; text-transform: uppercase; }
.app-journal-review-facts dd,
.app-journal-facts dd { margin: 5px 0 0; overflow-wrap: anywhere; font-weight: 700; }
.app-journal-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; margin: 0; background: var(--app-border); }
.app-journal-facts div { min-width: 0; padding: 11px 13px; background: var(--app-surface); }
.app-journal-note { margin: 12px 14px; color: var(--app-muted); font-size: 12px; }
.app-loading,
.app-state-error { display: grid; gap: 5px; padding: 24px; color: #64748b; }
.app-state-error { color: #b91c1c; }
.app-settings-layout { width: 100%; color: #0f172a; }
.app-settings-layout { display: grid; gap: 13px; }
.app-settings-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 14px;
  border-bottom: 1px solid var(--app-border);
}
.app-settings-page-header h2 { margin: 4px 0; }
.app-settings-page-header p { margin: 5px 0 0; }
.app-restart-guide { white-space: nowrap; }
.app-setup-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(7,30,58,.72); }
.app-setup-focus { position: relative !important; z-index: 10001 !important; outline: 4px solid #20b8f0; box-shadow: 0 0 0 8px rgba(32,184,240,.2),0 18px 42px rgba(3,35,58,.28) !important; }
.app-setup-coachmark { position: fixed; z-index: 10002; width: min(390px,calc(100vw - 40px)); padding: 24px; border: 1px solid #d5e5f1; border-radius: 15px; background: #fff; color: #0f2742; box-shadow: 0 24px 64px rgba(2,22,43,.35); }
.app-setup-coachmark h2 { margin: 10px 0 4px; font-size: 24px; }
.app-setup-coachmark > strong { display: block; color: #45637e; font-size: 13px; }
.app-setup-coachmark p { margin: 14px 0 18px; color: #58718a; line-height: 1.5; }
.app-setup-progress { display: flex; gap: 7px; margin-bottom: 15px; }
.app-setup-progress span { width: 11px; height: 11px; border-radius: 50%; background: #d9dee5; }
.app-setup-progress span.active { background: #0789d1; }
.app-setup-nav,.app-setup-nav > div { display: flex; align-items: center; gap: 9px; }
.app-setup-nav { justify-content: space-between; }
.app-setup-skip { padding: 4px 0; border: 0; background: transparent; color: #526c84; text-decoration: underline; cursor: pointer; }
@media(max-width:900px){.app-setup-coachmark{left:20px !important;right:20px;top:auto !important;bottom:20px;width:auto}.app-restart-guide{white-space:normal}}
.app-risk-governor,
.app-broker-settings { padding: 18px; border: 1px solid #dbe4ef; border-radius: 14px; background: #fff; }
.app-settings-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.app-policy-badge { white-space: nowrap; padding: 7px 10px; border-radius: 999px; background: #e0f2fe; color: #075985; font-size: 12px; font-weight: 800; }
.app-risk-note { margin-top: 12px; padding: 10px 12px; border-radius: 9px; background: #eff6ff; color: #1e3a8a; font-size: 12px; }
.app-settings-layout .hidden { display: none; }
.app-platform-choice { margin-top: 16px; }
.app-setup-steps { display: grid; gap: 8px; margin: 16px 0; padding-left: 24px; color: #334155; font-size: 13px; line-height: 1.5; }
.app-setup-steps li::marker { color: #0284c7; font-weight: 900; }
.app-connection-notice { margin: 12px 0; padding: 11px 13px; border: 1px solid #c9d9e7; border-radius: 10px; background: #f4f9fd; color: #405a72; line-height: 1.45; }
.app-form-grid label small { display: block; margin-top: 5px; color: #607890; font-size: .75rem; line-height: 1.35; }
.app-platform-choice label { display: grid; max-width: 520px; gap: 7px; font-size: 13px; font-weight: 800; }
.app-platform-choice select,
.app-trial-actions select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
}
.app-demo-balance { margin-top: 18px; }
.app-demo-strategy-head { display: flex; justify-content: space-between; gap: 12px; margin: 20px 0 10px; color: #334155; font-size: 13px; }
.app-demo-strategy-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.app-demo-strategy-option { display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border: 1px solid #dbe4ef; border-radius: 10px; background: #f8fafc; cursor: pointer; }
.app-demo-strategy-option:has(input:checked) { border-color: #38a3dc; background: #eef8fd; }
.app-demo-strategy-option input { width: 18px; height: 18px; margin: 0; }
.app-demo-strategy-option span { display: grid; gap: 3px; min-width: 0; }
.app-demo-strategy-option small { color: #64748b; }
.app-trial-card { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #dbe4ef; }
.app-trial-card h3 { margin: 7px 0 4px; }
.app-trial-actions { display: grid; grid-template-columns: minmax(220px,1fr) auto; gap: 10px; min-width: min(100%,520px); }

@media (max-width: 900px) {
  .app-strategy-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-form-grid { grid-template-columns: 1fr 1fr; }
  .app-position-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app-position-detail-grid { grid-template-columns: 1fr 1fr; }
  .app-evidence-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .app-journal-list-head { display: none; }
  .app-journal-entry { grid-template-columns: 1fr 1fr; gap: 7px 12px; }
  .app-journal-entry time,
  .app-journal-result { grid-column: 1 / -1; text-align: left; }
  .app-journal-hero { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .app-journal-position-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .app-journal-review-facts,
  .app-journal-facts { grid-template-columns: 1fr 1fr; }
  .app-demo-strategy-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .app-trial-card { align-items: stretch; flex-direction: column; }
}
@media (max-width: 560px) {
  .app-strategy-library-grid { grid-template-columns: 1fr; }
  .app-form-grid { grid-template-columns: 1fr; }
  .app-position-backdrop { padding: 0; }
  .app-position-modal { min-height: 100%; border-radius: 0; }
  .app-position-hero { grid-template-columns: 1fr 1fr; }
  .app-position-detail-grid { grid-template-columns: 1fr; padding: 12px; }
  .app-trade-evidence { padding: 12px; }
  .app-evidence-metrics { grid-template-columns: 1fr 1fr; }
  .app-evidence-grid { grid-template-columns: 1fr; }
  .app-journal-pagination { align-items: flex-start; flex-direction: column; }
  .app-journal-review-facts,
  .app-journal-facts { grid-template-columns: 1fr; }
  .app-journal-position-metrics { grid-template-columns: 1fr; }
  .app-position-modal-foot { align-items: stretch; flex-direction: column; }
  .app-nate-opportunity-shell { min-height: 100%; border-radius: 0; }
  .app-nate-opportunity-head { flex-direction: column; }
  .app-nate-opportunity-actions { flex-wrap: wrap; }
  .app-nate-evidence-metrics { grid-template-columns: 1fr 1fr; }
  .app-demo-strategy-grid,
  .app-trial-actions { grid-template-columns: 1fr; }
  .app-order-sizing,
  .app-protection-grid { grid-template-columns: 1fr; }
}

/* App trade workbench: one natural page scroll, with temporary search results only. */
.app-market-ticker {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  align-items: stretch;
  min-height: 72px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
}
.app-market-ticker[hidden] { display: none !important; }
.app-ticker-label {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-right: 1px solid var(--app-border);
  background: var(--app-surface-soft);
  color: var(--app-text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  white-space: nowrap;
}
.app-ticker-label-title { display: flex; align-items: center; justify-content: center; gap: 7px; }
.app-ticker-label-title > span { display: flex; flex-direction: column; gap: 1px; }
.app-ticker-label-title small { color: var(--app-muted); font-size: 9px; font-weight: 700; letter-spacing: .06em; }
.app-ticker-label i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--app-positive);
  box-shadow: 0 0 0 4px rgba(7,132,91,.12);
}
.app-ticker-style-switch {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  padding: 2px;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  background: var(--app-surface);
}
.app-ticker-style-switch button {
  min-height: 23px;
  padding: 0 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--app-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
}
.app-ticker-style-switch button:hover { color: var(--app-accent); }
.app-ticker-style-switch button.active { background: #e5f4fb; color: #0678ad; box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.app-ticker-viewport { display: flex; align-items: center; min-width: 0; overflow: hidden; }
.app-ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  min-width: max-content;
  animation: appTickerMove 48s linear infinite;
  will-change: transform;
}
.app-ticker-sequence { display: flex; flex: 0 0 auto; align-items: center; }
.app-ticker-viewport:hover .app-ticker-track,
.app-ticker-viewport:focus-within .app-ticker-track { animation-play-state: paused; }
.app-ticker-item {
  display: grid;
  grid-template-columns: minmax(0,1fr) 58px;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  min-width: 205px;
  min-height: 70px;
  padding: 9px 13px;
  border: 0;
  border-right: 1px solid var(--app-border);
  background: transparent;
  color: var(--app-text);
  white-space: nowrap;
}
.app-ticker-item strong { grid-column: 1; grid-row: 1; align-self: end; font-size: 12px; letter-spacing: .025em; text-align: left; }
.app-ticker-item > span:not(.app-ticker-bars) { grid-column: 1; grid-row: 2; align-self: start; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: left; }
.app-ticker-item em { grid-column: 2; grid-row: 2; align-self: start; font-size: 11px; font-style: normal; font-weight: 900; text-align: right; }
.app-ticker-item em b { margin-right: 4px; font-size: 8px; }
.app-ticker-item.up em { color: var(--app-positive); }
.app-ticker-item.down em { color: var(--app-negative); }
.app-ticker-item.flat em { color: var(--app-muted); }
.app-ticker-spark { grid-column: 2; grid-row: 1; width: 58px; height: 27px; overflow: visible; }
.app-ticker-spark path { fill: none; stroke: var(--app-muted); stroke-width: 2; vector-effect: non-scaling-stroke; }
.app-ticker-item.up .app-ticker-spark path { stroke: var(--app-positive); }
.app-ticker-item.down .app-ticker-spark path { stroke: var(--app-negative); }
.app-ticker-bars { grid-column: 2; grid-row: 1; align-self: end; display: flex; align-items: end; justify-content: end; gap: 2px; height: 24px; margin-bottom: 2px; }
.app-ticker-bars i { width: 3px; min-height: 5px; border-radius: 2px 2px 0 0; background: var(--app-muted); opacity: .8; }
.app-ticker-item.up .app-ticker-bars i { background: var(--app-positive); }
.app-ticker-item.down .app-ticker-bars i { background: var(--app-negative); }

.app-ticker-style-pulse .app-ticker-viewport { padding: 6px 0; background: #f8fbfd; }
.app-ticker-style-pulse .app-ticker-item { min-height: 60px; margin: 0 5px; border: 1px solid var(--app-border); border-radius: 9px; background: #fff; box-shadow: 0 2px 7px rgba(15,23,42,.055); }

.app-ticker-style-heatmap .app-ticker-item.up { background: linear-gradient(90deg,rgba(16,185,129,.11),rgba(16,185,129,.025)); }
.app-ticker-style-heatmap .app-ticker-item.down { background: linear-gradient(90deg,rgba(239,68,68,.11),rgba(239,68,68,.025)); }
.app-ticker-style-heatmap .app-ticker-item.flat { background: linear-gradient(90deg,rgba(100,116,139,.08),rgba(100,116,139,.015)); }

.app-market-ticker.app-ticker-style-desk { border-color: #203d59; background: #061a2b; box-shadow: inset 0 1px 0 rgba(255,255,255,.04),0 4px 13px rgba(2,23,42,.16); }
.app-ticker-style-desk .app-ticker-label { border-color: #294761; background: linear-gradient(135deg,#0b2940,#071b2d); color: #f8fbff; }
.app-ticker-style-desk .app-ticker-label-title small { color: #7fa5c2; }
.app-ticker-style-desk .app-ticker-style-switch { border-color: #31516b; background: rgba(2,15,27,.45); }
.app-ticker-style-desk .app-ticker-style-switch button { color: #86a6c0; }
.app-ticker-style-desk .app-ticker-style-switch button.active { background: #0b86bd; color: #fff; box-shadow: none; }
.app-ticker-style-desk .app-ticker-item { border-color: #27455f; background: transparent; color: #f6fbff; }
.app-ticker-style-desk .app-ticker-item:hover { background: rgba(56,189,248,.075); }
.app-ticker-style-desk .app-ticker-item.flat em { color: #8ba5ba; }
.app-ticker-style-desk .app-ticker-empty { color: #9cb3c6; }
.app-ticker-empty { padding: 0 20px; color: var(--app-muted); font-size: 12px; }
@keyframes appTickerMove { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }

.app-workspace { display: block; height: auto; }
.app-market-toolbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(160px, .8fr) minmax(250px, 1.35fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 13px;
}
.app-market-search-wrap { position: relative; min-width: 0; }
.app-market-search-wrap > input {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  outline: none;
  background: var(--app-surface-soft);
  color: var(--app-text);
}
.app-market-search-wrap > input:focus {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px rgba(8,127,189,.13);
}
.app-market-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 20;
  max-height: 330px;
  overflow-y: auto;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  box-shadow: 0 18px 42px rgba(16,36,61,.18);
}
.app-market-results[hidden] { display: none; }
.app-market-chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.app-market-chip {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--app-border);
  border-radius: 15px;
  background: var(--app-surface-soft);
  color: var(--app-text);
  font-size: 10px;
  font-weight: 800;
}
.app-market-chip.active { border-color: var(--app-accent); background: var(--app-accent-soft); color: var(--app-accent); }
.app-market-unavailable { color: var(--app-muted); font-size: 11px; }
.app-chart-surface { display: flex; margin-top: 12px; overflow: hidden; flex-direction: column; }
.app-chart-title { margin-right: auto; color: var(--app-text); font-size: 12px; }
.app-chart-identity { display: flex; align-items: baseline; gap: 5px; min-width: 0; margin-right: auto; }
.app-chart-identity strong,
.app-chart-identity small { display: block; }
.app-chart-timeframe { color: var(--app-text); font-size: 12px; }
.app-chart-identity small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--app-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-position-zone {
  position: absolute;
  z-index: 5;
  border-left: 2px solid;
  pointer-events: none;
}
.app-position-zone[hidden],
.app-position-entry-line[hidden] { display: none; }
.app-position-zone.reward {
  border-color: #07845a;
  background: rgba(10,169,114,.2);
}
.app-position-zone.risk {
  border-color: #cf3131;
  background: rgba(224,55,55,.2);
}
.app-position-zone span {
  position: absolute;
  top: 4px;
  right: 5px;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(8,27,44,.88);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.app-position-entry-line {
  position: absolute;
  z-index: 6;
  height: 0;
  border-top: 2px solid #137cc1;
  pointer-events: none;
}
.app-position-entry-line span {
  position: absolute;
  right: 4px;
  bottom: 5px;
  padding: 4px 7px;
  border-radius: 4px;
  background: rgba(8,71,113,.92);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.app-chart-detach { white-space: nowrap; }
.app-chart-copy-fields {
  display: grid;
  grid-template-columns: repeat(7,minmax(115px,1fr));
  gap: 1px;
  overflow-x: auto;
  border-top: 1px solid var(--app-border);
  border-bottom: 1px solid var(--app-border);
  background: var(--app-border);
}
.app-chart-copy-field {
  position: relative;
  display: grid;
  min-width: 115px;
  min-height: 58px;
  padding: 8px 30px 8px 11px;
  border: 0;
  background: var(--app-surface);
  color: var(--app-text);
  text-align: left;
  cursor: pointer;
}
.app-chart-copy-field > span {
  overflow: hidden;
  color: var(--app-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-chart-copy-field > strong {
  overflow: hidden;
  margin-top: 3px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-chart-copy-field > small {
  position: absolute;
  top: 9px;
  right: 8px;
  color: var(--app-accent);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .04em;
}
.app-chart-copy-field:hover,
.app-chart-copy-field:focus-visible { z-index: 1; outline: 2px solid var(--app-accent); outline-offset: -2px; background: var(--app-accent-soft); }
.app-chart-copy-field:disabled { cursor: default; opacity: .62; }
.app-chart-copy-field:disabled:hover { outline: 0; background: var(--app-surface); }
.app-tv-chart-stage { position: relative; flex: 1 1 auto; min-height: 610px; overflow: hidden; }
.app-tv-chart,
.app-tv-chart iframe { min-height: 610px !important; height: 610px !important; max-height: none; }

.app-order-ticket { display: block; margin-top: 12px; overflow: visible; }
.app-order-body { min-height: 0; overflow: visible; }
.app-order-flow {
  display: grid;
  grid-template-columns: minmax(180px,.8fr) minmax(330px,1.5fr) minmax(360px,1.55fr) minmax(230px,1fr);
  gap: 12px;
  padding: 13px;
}
.app-order-cluster {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface-soft);
}
.app-order-cluster-title {
  display: block;
  margin-bottom: 8px;
  color: var(--app-text);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.app-order-flow .app-side-picker { margin-bottom: 8px; }
.app-order-flow label { margin: 7px 0 0; }
.app-order-flow .app-order-sizing { grid-template-columns: repeat(3,minmax(0,1fr)); }
.app-order-flow .app-protection-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.app-order-flow .app-risk-line { align-items: flex-start; flex-direction: column; margin: 0 0 10px; }
.app-order-flow .app-order-note { text-align: left; }

@media (max-width: 1280px) {
  .app-market-toolbar { grid-template-columns: minmax(170px,.8fr) minmax(240px,1.2fr) auto; }
  .app-market-toolbar .app-live { display: none; }
  .app-order-flow { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .app-market-toolbar { grid-template-columns: 1fr; }
  .app-market-chips { order: 3; }
  .app-order-flow { grid-template-columns: 1fr; }
  .app-tv-chart,
  .app-tv-chart iframe { min-height: 500px !important; height: 500px !important; }
}
@media (max-width: 560px) {
  .app-market-ticker { grid-template-columns: 1fr; }
  .app-ticker-label { min-height: 66px; justify-content: center; border-right: 0; border-bottom: 1px solid var(--app-border); }
  .app-ticker-style-switch { width: min(260px,100%); margin: 0 auto; }
  .app-ticker-item { min-width: 165px; min-height: 64px; padding: 8px 15px; }
  .app-order-flow .app-order-sizing,
  .app-order-flow .app-protection-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .app-ticker-track { animation: none; }
  .app-ticker-viewport { overflow-x: auto; }
}

/* Shared App/Nate dark colour themes. */
html[data-color-theme="green"] {
  color-scheme: dark;
  --app-bg:#07140f; --app-surface:#0d2118; --app-surface-soft:#102b20;
  --app-text:#edf8f2; --app-muted:#9bbcac; --app-border:#254637;
  --app-accent:#2ec27e; --app-accent-soft:#173d2d; --app-positive:#4ade9b; --app-negative:#ff6b72;
  --bg:#07140f; --text:#edf8f2; --muted:#9bbcac; --border:#254637;
  --accent:#2ec27e; --accent2:#57d79a; --accentGlow:rgba(46,194,126,.18);
  --surface1:#0d2118; --surface2:#102b20; --surfaceNav:#0d2118; --surfacePill:#102b20;
}
html[data-color-theme="red"] {
  color-scheme: dark;
  --app-bg:#160a0c; --app-surface:#241014; --app-surface-soft:#2d151a;
  --app-text:#fff1f2; --app-muted:#c6a0a5; --app-border:#543038;
  --app-accent:#d95663; --app-accent-soft:#492027; --app-positive:#4ade9b; --app-negative:#ff6b72;
  --bg:#160a0c; --text:#fff1f2; --muted:#c6a0a5; --border:#543038;
  --accent:#d95663; --accent2:#ee7a84; --accentGlow:rgba(217,86,99,.2);
  --surface1:#241014; --surface2:#2d151a; --surfaceNav:#241014; --surfacePill:#2d151a;
}
html[data-color-theme="blue"] {
  color-scheme: dark;
  --app-bg:#07111d; --app-surface:#0c1d2d; --app-surface-soft:#10283c;
  --app-text:#eef7ff; --app-muted:#9ab4ca; --app-border:#29465e;
  --app-accent:#28a8df; --app-accent-soft:#173d55; --app-positive:#4ade9b; --app-negative:#ff6b72;
  --bg:#07111d; --text:#eef7ff; --muted:#9ab4ca; --border:#29465e;
  --accent:#28a8df; --accent2:#5bc4ee; --accentGlow:rgba(40,168,223,.2);
  --surface1:#0c1d2d; --surface2:#10283c; --surfaceNav:#0c1d2d; --surfacePill:#10283c;
}
html[data-color-theme]:not([data-color-theme="clean"]) .app-header,
html[data-color-theme]:not([data-color-theme="clean"]) .app-tabs,
html[data-color-theme]:not([data-color-theme="clean"]) .app-broker-settings,
html[data-color-theme]:not([data-color-theme="clean"]) .app-setup-coachmark,
html[data-color-theme]:not([data-color-theme="clean"]) .app-ticker-style-pulse .app-ticker-item,
html[data-color-theme]:not([data-color-theme="clean"]) .app-layout-add-menu { background:var(--app-surface); color:var(--app-text); }
html[data-color-theme]:not([data-color-theme="clean"]) .app-ticker-style-pulse .app-ticker-viewport,
html[data-color-theme]:not([data-color-theme="clean"]) .app-data-table th,
html[data-color-theme]:not([data-color-theme="clean"]) .app-demo-strategy-option,
html[data-color-theme]:not([data-color-theme="clean"]) .app-order-cluster { background:var(--app-surface-soft); color:var(--app-text); }
html[data-color-theme]:not([data-color-theme="clean"]) input,
html[data-color-theme]:not([data-color-theme="clean"]) select,
html[data-color-theme]:not([data-color-theme="clean"]) textarea { background:var(--app-surface-soft); color:var(--app-text); border-color:var(--app-border); }
html[data-color-theme]:not([data-color-theme="clean"]) #app-user-pill,
html[data-color-theme]:not([data-color-theme="clean"]) .btn-outline { color:var(--app-text); }

.alika-theme-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:14px; }
.alika-theme-choice { display:flex; align-items:center; gap:11px; min-height:72px; padding:11px; border:1px solid var(--app-border); border-radius:10px; background:var(--app-surface-soft); color:var(--app-text); text-align:left; cursor:pointer; }
.alika-theme-choice:hover,.alika-theme-choice:focus-visible { border-color:var(--app-accent); outline:none; }
.alika-theme-choice.active { border-color:var(--app-accent); box-shadow:0 0 0 2px color-mix(in srgb,var(--app-accent) 24%,transparent); }
.alika-theme-choice > span,.alika-theme-choice strong,.alika-theme-choice small { display:block; }
.alika-theme-choice small { margin-top:3px; color:var(--app-muted); }
.alika-theme-swatch { width:38px; height:38px; flex:0 0 38px; border:1px solid rgba(255,255,255,.16); border-radius:9px; box-shadow:inset 0 0 0 7px rgba(255,255,255,.025); }
.alika-theme-swatch-clean { border-color:#cbd7e3; background:linear-gradient(135deg,#ffffff 50%,#087fbd 50%); }
.alika-theme-swatch-green { background:linear-gradient(135deg,#07140f 50%,#2ec27e 50%); }
.alika-theme-swatch-red { background:linear-gradient(135deg,#160a0c 50%,#d95663 50%); }
.alika-theme-swatch-blue { background:linear-gradient(135deg,#07111d 50%,#28a8df 50%); }
@media (max-width:760px) { .alika-theme-grid { grid-template-columns:1fr; } }
