:root {
  --app-bg: #0d0e11;
  --surface: rgba(244, 240, 231, 0.052);
  --surface-strong: rgba(244, 240, 231, 0.078);
  --surface-elevated: rgba(24, 25, 28, 0.88);
  --card-bg: rgba(244, 240, 231, 0.044);
  --card-bg-strong: rgba(244, 240, 231, 0.068);
  --border-soft: rgba(244, 240, 231, 0.13);
  --border-strong: rgba(244, 240, 231, 0.23);
  --text-primary: #f4f0e7;
  --text-secondary: #d8d0c3;
  --text-muted: #aaa295;
  --accent-primary: #78c6a3;
  --accent-secondary: #a6b7ef;
  --accent-gold: #d6b56d;
  --success: #78c6a3;
  --danger: #d76258;
  --warning: #d6b56d;
  --info: #8fb7d8;
  --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.42);
  --glow-soft: 0 18px 44px rgba(120, 198, 163, 0.12);
  --bg: var(--app-bg);
  --panel: var(--surface-elevated);
  --card: var(--card-bg);
  --border: var(--border-soft);
  --text: var(--text-primary);
  --muted: var(--text-muted);
  --green: var(--success);
  --red: #e08b84;
  --yellow: var(--warning);
  --blue: var(--accent-secondary);
  --accent: var(--accent-primary);
  --btn: rgba(244, 240, 231, 0.055);
  --btn2: rgba(244, 240, 231, 0.092);
  --shadow: var(--shadow-soft);
  --sim-left-split: 38%;
  --sim-top-split: 44%;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(13, 14, 17, 0.72), var(--app-bg) 72%),
    repeating-linear-gradient(90deg, rgba(244, 240, 231, 0.026) 0 1px, transparent 1px 86px),
    radial-gradient(980px 480px at 48% 4%, rgba(120, 198, 163, 0.10), transparent 62%),
    var(--app-bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

.app-tabs {
  height: 52px;
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 10px 16px 0;
  background: rgba(13, 14, 17, 0.82);
  border-bottom: 1px solid rgba(244, 240, 231, 0.08);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.app-tab-spacer {
  flex: 1 1 auto;
  min-width: 24px;
}

.release-channel-badge {
  align-self: center;
  border: 1px solid rgba(244, 240, 231, 0.14);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  background: rgba(244, 240, 231, 0.045);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.release-channel-badge.canary {
  color: #f5d88f;
  border-color: rgba(245, 216, 143, 0.32);
  background: rgba(245, 216, 143, 0.10);
}

.release-channel-secondary {
  margin-left: 6px;
  padding-left: 6px;
  border-left: 1px solid rgba(244, 240, 231, 0.18);
  color: rgba(244, 240, 231, 0.62);
  font-size: 10px;
  font-weight: 700;
  text-transform: lowercase;
}

.app-tab-btn {
  appearance: none;
  border: 1px solid var(--border);
  border-bottom-color: rgba(244, 240, 231, 0.08);
  border-radius: 7px 7px 0 0;
  background: rgba(244, 240, 231, 0.035);
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
  padding: 10px 16px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.app-tab-btn.active {
  background: rgba(120, 198, 163, 0.12);
  color: var(--text);
  border-color: rgba(120, 198, 163, 0.42);
}

.app-tab-btn:hover {
  background: rgba(244, 240, 231, 0.065);
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .app-tabs {
    height: auto;
    min-height: 52px;
    align-items: end;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 8px 0;
    overflow: visible;
  }

  .app-tab-spacer {
    display: none;
  }

  .release-channel-badge {
    order: 10;
    flex: 1 0 100%;
    justify-self: end;
    margin-left: auto;
    max-width: max-content;
    padding: 2px 7px;
    font-size: 9.5px;
    line-height: 1.1;
  }

  .app-tab-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 8px;
    font-size: 13px;
  }
}

.app-tab-panel {
  display: none;
}

.app-tab-panel.active {
  display: grid;
}

html.app-tab-hydrating .app-tabs,
html.app-tab-hydrating .app-tab-panel {
  visibility: hidden;
}

.admin-developer {
  min-height: calc(100vh - 52px);
  padding: 14px;
  overflow: auto;
}

.admin-dev-wrap,
.account-wrap {
  display: grid;
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.account-shell {
  min-height: calc(100vh - 52px);
  padding: 16px;
  overflow: auto;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.account-simple-header,
.account-simple-grid {
  max-width: 420px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.account-simple-header {
  justify-content: center;
  text-align: center;
}

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

.account-auth-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  gap: 14px;
}

.account-auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("/assets/bearisup-account-watermark.jpeg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: min(86%, 360px) auto;
  opacity: 0.08;
  filter: blur(0.4px);
}

.account-auth-card .account-action-row {
  justify-content: center;
}

.account-brand-intro {
  align-items: center;
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.account-brand-intro p {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  margin: 0;
}

.account-terms-check {
  align-items: start;
  background: rgba(244, 240, 231, 0.05);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  font-size: 11px;
  font-weight: 650;
  gap: 8px;
  grid-template-columns: 16px minmax(0, 1fr);
  line-height: 1.35;
  padding: 10px;
}

.account-terms-check input {
  margin-top: 1px;
}

.account-terms-check a {
  color: var(--accent);
}

.account-signin-prompt {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 4px;
  justify-content: center;
}

.account-reset-link {
  justify-self: center;
}

.link-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  padding: 2px 4px;
}

.link-button:hover {
  text-decoration: underline;
}

.account-storage-details {
  color: var(--muted);
  font-size: 11px;
}

.account-storage-details summary {
  cursor: pointer;
  font-weight: 800;
  text-align: center;
}

.account-storage-diagnostics {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  white-space: pre-wrap;
}

.account-auth-card > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 520px) {
  .account-auth-card::before {
    background-size: min(92%, 300px) auto;
    opacity: 0.055;
  }
}

.account-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.account-card h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.account-stat-list {
  display: grid;
  gap: 8px;
}

.account-stat-list span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  border-bottom: 1px solid rgba(244, 240, 231, 0.08);
  padding-bottom: 7px;
}

.account-stat-list b {
  color: var(--text);
  text-align: right;
}

.account-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cloud-sync-card {
  display: grid;
  gap: 10px;
}

.cloud-sync-card-header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.cloud-sync-card-header h3 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: 0;
}

.cloud-sync-card-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.cloud-sync-map {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.cloud-sync-map span {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: var(--surface);
}

.cloud-sync-map b {
  color: var(--text);
  font-size: 12px;
}

.cloud-sync-map small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.25;
}

.account-placeholder-action:disabled,
.account-danger-placeholder:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.account-danger-placeholder {
  border-color: rgba(242, 167, 181, 0.35);
  color: var(--red);
}

.admin-dev-section > summary {
  font-weight: 850;
}

.admin-dev-section .debug-details,
.admin-dev-section .data-collection-status {
  margin-top: 10px;
}

.admin-table-wrap {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
}

.admin-table-wrap h3 {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.admin-debug-output {
  min-height: 120px;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.45;
}

.admin-metrics-table {
  border-collapse: collapse;
  min-width: 680px;
  width: 100%;
}

.admin-metrics-table th,
.admin-metrics-table td {
  border-bottom: 1px solid rgba(244, 240, 231, 0.08);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.admin-metrics-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.admin-metrics-table td {
  color: var(--text);
  font-size: 12px;
}

.admin-metrics-table tr[data-user-id] {
  cursor: pointer;
}

.admin-metrics-table tr[data-user-id]:hover,
.admin-metrics-table tr.selected-user {
  background: rgba(120, 198, 163, 0.10);
}

.admin-user-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.admin-user-detail-panel > h3 {
  color: var(--text);
  font-size: 14px;
  margin: 0;
}

.sim-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  height: calc(100vh - 52px);
  padding: 16px;
}

.training-hub {
  height: calc(100vh - 52px);
  overflow: auto;
  padding: 16px;
  position: relative;
}

.training-hub-inner {
  display: grid;
  gap: 12px;
  max-width: 1180px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.training-hub-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(244, 240, 231, 0.058), rgba(244, 240, 231, 0.032));
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.22);
  padding: 14px;
}

.training-hub-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: end;
}

.training-hub-header h1 {
  margin: 2px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

.training-hub-header small,
.latest-session-report-panel summary small {
  color: var(--muted);
}

.app-tab-panel:not(.active) {
  display: none !important;
}

.chart-pane,
.trade-card {
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(244, 240, 231, 0.054), rgba(244, 240, 231, 0.025)),
    rgba(13, 14, 17, 0.68);
  box-shadow: var(--shadow);
}

.chart-pane {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, var(--sim-left-split)) minmax(0, 1fr);
  grid-template-rows: minmax(260px, var(--sim-top-split)) minmax(220px, 1fr);
  grid-template-areas:
    "settings chart1m"
    "chart15m chart5m";
  gap: 10px;
  padding: 14px;
  overflow: hidden;
}

.chart-pane.focus-mode {
  grid-template-columns: minmax(320px, 34%) minmax(0, 1fr);
  grid-template-rows: minmax(520px, 1fr);
  grid-template-areas: "settings chart1m";
}

.chart-pane.focus-mode .chart-panel-1m {
  grid-area: chart1m;
}

.chart-pane.focus-mode .chart-panel-5m,
.chart-pane.focus-mode .chart-panel-15m,
.chart-pane.focus-mode .quadrant-resizer {
  display: none;
}

.hidden { display: none !important; }

.simulator-settings-pane {
  grid-area: settings;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 9px;
  border: 1px solid rgba(131, 165, 255, 0.20);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(131, 165, 255, 0.08), rgba(0, 0, 0, 0.10)),
    rgba(0, 0, 0, 0.16);
}

.multi-chart-grid {
  min-height: 0;
  display: contents;
}

.multi-chart-panel {
  min-width: 0;
  min-height: 0;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.chart-panel-1m { grid-area: chart1m; }
.chart-panel-15m { grid-area: chart15m; }
.chart-panel-5m { grid-area: chart5m; }

.quadrant-resizer {
  position: absolute;
  z-index: 20;
  border-radius: 999px;
  background: rgba(131, 165, 255, 0.30);
  border: 1px solid rgba(131, 165, 255, 0.46);
  pointer-events: auto;
  touch-action: none;
}

.quadrant-resizer.vertical {
  top: 14px;
  bottom: 14px;
  left: calc(14px + var(--sim-left-split));
  width: 14px;
  transform: translateX(-7px);
  cursor: col-resize;
}

.quadrant-resizer.horizontal {
  left: 14px;
  right: 14px;
  top: calc(14px + var(--sim-top-split));
  height: 14px;
  transform: translateY(-7px);
  cursor: row-resize;
}

.quadrant-resizer:hover,
.quadrant-resizer.dragging {
  background: rgba(131, 165, 255, 0.52);
  border-color: rgba(131, 165, 255, 0.76);
}

.multi-chart-title {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 7;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(10, 13, 24, 0.76);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.chart-header-timeframe-label {
  display: block;
}

.chart-header-timeframe-select {
  min-height: 28px;
  padding: 4px 26px 4px 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 13, 24, 0.9);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.replay-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 10px;
}

.replay-action-btn {
  min-height: 56px;
  justify-content: center;
  font-size: 17px;
  font-weight: 900;
  padding: 9px 12px;
}

.random-action-btn {
  border-color: rgba(131, 165, 255, 0.34);
  background: linear-gradient(180deg, rgba(131, 165, 255, 0.18), rgba(131, 165, 255, 0.08));
}

.today-warmup-btn {
  border-color: rgba(246, 205, 118, 0.62);
  background: linear-gradient(180deg, rgba(246, 205, 118, 0.26), rgba(246, 205, 118, 0.12));
  color: #f7e4ad;
  font-weight: 850;
}

.today-warmup-btn:hover,
.today-warmup-btn:focus-visible {
  border-color: rgba(255, 221, 143, 0.82);
  background: linear-gradient(180deg, rgba(255, 221, 143, 0.34), rgba(246, 205, 118, 0.16));
}

.pause-action-btn {
  border-color: rgba(255, 202, 112, 0.46);
  background: linear-gradient(180deg, rgba(255, 202, 112, 0.18), rgba(255, 202, 112, 0.08));
  color: #ffd08b;
}

.replay-action-btn.working {
  opacity: 0.78;
  transform: translateY(1px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.date-random-pulse select,
select.date-random-pulse {
  animation: date-random-pulse 620ms ease-out;
}

@keyframes date-random-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(246, 223, 154, 0);
    transform: scale(1);
  }
  35% {
    box-shadow: 0 0 0 4px rgba(246, 223, 154, 0.28);
    transform: scale(1.018);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(246, 223, 154, 0);
    transform: scale(1);
  }
}

.chart-slot {
  position: absolute;
  inset: 0;
  min-height: 160px;
}

.indicator-label-canvas-v1 {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.reference-overlay-canvas-v1 {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.compact-time {
  width: 88px;
}

.countdown-overlay {
  position: fixed;
  top: calc(52px + 46vh);
  left: 16px;
  right: 16px;
  z-index: 30;
  pointer-events: none;
  display: flex;
  justify-content: center;
  transform: translateY(-50%);
}

.countdown-overlay.hidden {
  display: none;
}

.countdown-card {
  width: min(960px, calc(100vw - 32px));
  min-height: 74px;
  padding: 14px 24px;
  border: 1px solid rgba(246, 223, 154, 0.34);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(10, 13, 24, 0.34), rgba(10, 13, 24, 0.7), rgba(10, 13, 24, 0.34));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  text-align: center;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
}

.countdown-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.15;
  margin-bottom: 0;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.52);
}

.countdown-card span {
  color: rgba(238, 242, 255, 0.74);
  font-size: 12px;
}

.countdown-bell {
  display: none;
  margin-bottom: 6px;
  font-size: 34px;
  line-height: 1;
  transform-origin: 50% 0%;
}

.countdown-live .countdown-bell {
  display: block;
}

@media (max-width: 980px) {
  .countdown-overlay {
    top: calc(52px + 34vh);
    left: 10px;
    right: 10px;
  }
  .countdown-card {
    width: min(560px, calc(100vw - 20px));
    min-height: 62px;
    padding: 12px 16px;
  }
  .countdown-card strong {
    font-size: 19px;
  }
  .countdown-card span {
    font-size: 11px;
  }
}

@media (max-width: 520px) {
  .countdown-overlay {
    top: calc(52px + 30vh);
  }
  .countdown-card {
    min-height: 56px;
    padding: 10px 12px;
  }
  .countdown-card strong {
    font-size: 17px;
  }
  .countdown-card span {
    display: none;
  }
}

.bell-ringing {
  animation: bell-shake 0.72s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes bell-shake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  10% { transform: rotate(-18deg) scale(1.04); }
  20% { transform: rotate(16deg) scale(1.06); }
  30% { transform: rotate(-14deg) scale(1.08); }
  40% { transform: rotate(12deg) scale(1.08); }
  50% { transform: rotate(-9deg) scale(1.06); }
  60% { transform: rotate(7deg) scale(1.04); }
  75% { transform: rotate(-4deg) scale(1.02); }
}

.gap-label {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(183, 191, 216, 0.24);
  background: rgba(10, 13, 24, 0.72);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.gap-label.hidden {
  display: none;
}

.context-level-label,
.event-marker-label {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(183, 191, 216, 0.22);
  background: rgba(10, 13, 24, 0.70);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.event-marker-line {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  width: 1px;
  pointer-events: none;
  background: rgba(246, 223, 154, 0.45);
}

.regime-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(183, 191, 216, 0.22);
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.regime-badge.low { color: var(--green); border-color: rgba(125, 211, 176, 0.35); }
.regime-badge.med { color: var(--yellow); border-color: rgba(246, 223, 154, 0.35); }
.regime-badge.high { color: var(--red); border-color: rgba(242, 167, 181, 0.35); }
.regime-badge.muted { color: var(--muted); }

.chart-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.compact-title {
  margin-bottom: 6px;
}

.eyebrow,
.chart-stat span,
.selected-box span,
label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 8px 0;
  font-size: 15px;
}

.chart-stat {
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.24);
}

.chart-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.chart-toolbar:empty {
  display: none;
}

.chart-mode-controls {
  display: inline-flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-mode-controls label {
  min-width: 108px;
}

.chart-mode-controls select {
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 8px;
}

.chart-mode-resource-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
  max-width: 360px;
}

.chart-mode-resource-note.warning {
  color: #fbbf24;
}

.chart-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.segmented {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.24);
}

.segmented button {
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  min-width: 48px;
  background: transparent;
}

.segmented button:last-child { border-right: 0; }
.segmented button.active { background: rgba(131, 165, 255, 0.24); color: var(--text); }

.overlay-dropdown {
  position: relative;
  z-index: 20;
}

.chart-overlay-control {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 8;
}

.overlay-dropdown summary {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 13, 24, 0.92);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  list-style: none;
}

.overlay-dropdown summary::-webkit-details-marker {
  display: none;
}

.overlay-dropdown summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 10px;
}

.overlay-dropdown[open] summary::after {
  content: "▴";
}

.overlay-dropdown summary b {
  color: var(--muted);
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overlay-grid {
  min-width: 230px;
  max-width: 300px;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 13, 24, 0.98);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
}

.overlay-dropdown:not([open]) .overlay-grid {
  display: none;
}

.overlay-grid label,
.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.overlay-grid input[type="checkbox"] {
  accent-color: var(--muted);
}

.indicator-control {
  z-index: 12;
}

.indicator-dropdown {
  position: relative;
}

.indicator-dropdown summary {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 13, 24, 0.92);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  list-style: none;
}

.indicator-dropdown summary::-webkit-details-marker {
  display: none;
}

.indicator-dropdown summary::after {
  content: "v";
  color: var(--muted);
  font-size: 10px;
}

.indicator-dropdown[open] summary::after {
  content: "^";
}

.indicator-dropdown summary b {
  color: var(--muted);
  font-weight: 600;
}

.indicator-grid {
  min-width: 250px;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 13, 24, 0.98);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
}

.indicator-list-v1 {
  width: 280px;
}

.indicator-preset-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.indicator-preset-row select {
  min-width: 0;
  height: 34px;
  line-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(5, 10, 20, 0.94);
  color: var(--text);
  font-size: 12px;
}

.indicator-preset-row select option {
  line-height: 1.4;
}

.indicator-dropdown:not([open]) .indicator-grid {
  display: none;
}

.indicator-dropdown:not([open]) .indicator-legend {
  display: none;
}

.indicator-group {
  display: grid;
  gap: 5px;
}

.indicator-group strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.indicator-group label {
  min-height: 42px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 7px;
  row-gap: 1px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
}

.indicator-group-primary label {
  border-color: rgba(245, 165, 36, 0.22);
  background: rgba(245, 165, 36, 0.055);
}

.indicator-group label span {
  color: var(--text);
  font-weight: 700;
}

.indicator-group label small {
  grid-column: 2;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.indicator-group input[type="checkbox"] {
  accent-color: var(--muted);
}

.indicator-row {
  min-height: 30px;
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr) 72px;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--text);
  font-size: 12px;
}

.indicator-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.indicator-row-primary {
  border-color: rgba(245, 165, 36, 0.16);
  background: rgba(245, 165, 36, 0.035);
}

.indicator-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.indicator-row-hint {
  display: none;
  grid-column: 2 / -1;
  margin-top: -3px;
  color: rgba(226, 232, 240, 0.62);
  font-size: 10px;
  line-height: 1.2;
}

.indicator-row.is-insufficient-history {
  border-color: rgba(168, 85, 247, 0.22);
  background: rgba(168, 85, 247, 0.05);
}

.indicator-row.is-insufficient-history .indicator-row-hint {
  display: block;
}

.indicator-row input[type="checkbox"] {
  accent-color: var(--muted);
}

.indicator-row-sample {
  height: 0;
  border-top: var(--indicator-width, 1px) solid var(--indicator-color, var(--muted));
}

.indicator-row-sample.is-dashed {
  border-top-style: dashed;
}

.indicator-row-sample.is-dotted {
  border-top-style: dotted;
}

.indicator-row-sample.is-large-dashed {
  border-top-style: dashed;
}

.indicator-row.is-unavailable {
  color: rgba(226, 232, 240, 0.48);
}

.indicator-row.is-unavailable .indicator-row-sample {
  opacity: 0.42;
}

.indicator-row.is-unavailable input[type="checkbox"] {
  opacity: 0.45;
}

.indicator-legend {
  min-width: 250px;
  position: absolute;
  top: calc(100% + 320px);
  right: 0;
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 13, 24, 0.98);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
}

.indicator-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 4px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.indicator-legend-chip.is-primary {
  border-color: rgba(245, 165, 36, 0.22);
  background: rgba(245, 165, 36, 0.06);
  font-weight: 700;
}

.indicator-legend-chip.is-off {
  opacity: 0.48;
}

.indicator-legend-swatch {
  width: 24px;
  height: 0;
  border-top: var(--indicator-width, 2px) solid var(--indicator-color, var(--muted));
}

.indicator-legend-swatch.is-dashed {
  border-top-style: dashed;
}

.indicator-legend-swatch.is-dotted {
  border-top-style: dotted;
}

.warnings {
  min-height: 28px;
  color: var(--yellow);
  font-size: 12px;
}

.warnings div {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid rgba(246, 223, 154, 0.35);
  background: rgba(246, 223, 154, 0.08);
}

.chart-diagnostics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: 24px;
  margin-top: 8px;
  color: rgba(213, 219, 246, 0.64);
  font-size: 12px;
}

.chart-diagnostics b {
  color: rgba(231, 241, 255, 0.9);
}

.loading-status {
  color: rgba(246, 223, 154, 0.88);
  font-size: 12px;
  min-width: 92px;
}

.loading-overlay {
  position: absolute;
  inset: 128px 16px 92px 16px;
  z-index: 5;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(11, 15, 28, 0.72);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.loading-overlay.hidden {
  display: none;
}

.loading-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(24, 29, 47, 0.95);
  color: rgba(231, 241, 255, 0.92);
  box-shadow: var(--shadow);
}

.loading-card span {
  color: rgba(213, 219, 246, 0.58);
  font-size: 12px;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--blue);
  animation: spin .8s linear infinite;
}

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

.performance-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: 24px;
  margin-top: 5px;
  color: rgba(213, 219, 246, 0.58);
  font-size: 12px;
}

.performance-panel b {
  color: rgba(246, 223, 154, 0.95);
}

.load-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: 24px;
  margin-top: 5px;
  color: rgba(213, 219, 246, 0.58);
  font-size: 12px;
}

.load-stats b {
  color: rgba(231, 241, 255, 0.88);
}

.muted-note {
  color: rgba(213, 219, 246, 0.48);
}

#chart1m {
  position: relative;
  min-height: 0;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
}

.current-price-label {
  position: absolute;
  right: 3px;
  z-index: 8;
  min-width: 58px;
  padding: 3px 5px 4px;
  border-radius: 4px;
  color: #07110d;
  background: var(--green);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.26);
  pointer-events: none;
  text-align: center;
  line-height: 1.05;
  transform: translateY(-50%);
}

.current-price-label.down {
  color: #18090d;
  background: var(--red);
}

.current-price-label.hidden {
  display: none;
}

.current-price-label span,
.current-price-label small {
  display: block;
  font-variant-numeric: tabular-nums;
}

.current-price-label span {
  font-size: 12px;
  font-weight: 850;
}

.current-price-label small {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 750;
}

.chart-debug-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding-top: 8px;
}

.trade-card {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px;
}

.scanner-wrap {
  position: relative;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  padding: 3px 6px;
  margin-bottom: 2px;
}

.scanner-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14.5px;
  letter-spacing: 0;
  color: rgba(231, 241, 255, 0.72);
}

.pill {
  position: absolute;
  top: 4px;
  right: 6px;
  padding: 2px 5px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 10.5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
}

.pill.ok { color: var(--green); border-color: rgba(38, 208, 124, 0.45); }
.pill.bad { color: var(--red); border-color: rgba(255, 75, 92, 0.45); }
.pill.paused { color: var(--yellow); border-color: rgba(246, 223, 154, 0.45); }

.replay-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.chart-replay-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 5px 6px;
  margin: 0 0 5px;
}

.chart-replay-controls .symbol-select-label {
  min-width: 112px;
}

.chart-replay-controls #dateSelect {
  width: 214px;
  min-width: 214px;
  max-width: 214px;
}

.chart-replay-controls label {
  min-width: 72px;
}

.chart-replay-controls .date-select-control {
  width: 214px;
  min-width: 214px;
  max-width: 214px;
}

.chart-replay-controls .date-select-control select {
  width: 214px;
}

.chart-replay-controls .chip-check {
  min-width: auto;
  min-height: 28px;
  justify-content: center;
  white-space: nowrap;
}

.chart-replay-controls select,
.chart-replay-controls .input {
  min-height: 28px;
  padding: 5px 7px;
  border-radius: 8px;
}

.chart-replay-controls .btn {
  min-height: 28px;
  padding: 5px 8px;
}

.replay-time-inline {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.replay-time-inline b {
  color: var(--text);
  font-size: 12.5px;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.replay-status-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 8px;
  margin: 2px 0 6px;
  padding: 5px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.replay-status-box b,
.replay-status-box .loading-status {
  color: var(--text);
}

.data-coverage-badge {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  line-height: 1.2;
}

.data-coverage-complete {
  color: #9bf0b4;
  border-color: rgba(91, 214, 129, 0.35);
  background: rgba(91, 214, 129, 0.1);
}

.data-coverage-incomplete {
  color: var(--yellow);
  border-color: rgba(246, 223, 154, 0.35);
  background: rgba(246, 223, 154, 0.08);
}

.data-coverage-unavailable {
  color: #ffb4b4;
  border-color: rgba(255, 122, 122, 0.35);
  background: rgba(255, 122, 122, 0.08);
}

.replay-controls:not(.chart-replay-controls) .chip-check {
  grid-column: 1 / -1;
  justify-content: center;
}

.training-date-filters-panel {
  margin: 6px 0 5px;
  padding: 6px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.training-filter-actions {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-height: 30px;
}

.training-filter-actions small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.training-filter-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 5px;
  margin-top: 0;
}

.training-filter-grid label {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.05;
}

.training-filter-grid select,
.training-filter-grid .input {
  width: auto;
  min-width: 8ch;
  max-width: 19ch;
  min-height: 25px;
  padding: 3px 6px;
  border-radius: 7px;
  font-size: 11px;
}

.training-filter-grid input[type="date"] {
  width: 124px;
  min-width: 124px;
}

.training-filter-grid .chip-check {
  justify-content: flex-start;
  min-height: 25px;
  padding: 3px 6px;
  font-size: 10.5px;
  white-space: nowrap;
}

.training-reset-btn {
  align-self: end;
  width: auto;
  min-height: 25px;
  padding: 3px 7px;
  white-space: nowrap;
}

.training-filter-message {
  flex: 1 0 100%;
  min-height: 18px;
  padding: 2px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
}

.training-filter-message.warn {
  color: #fbbf24;
}

.warmup-today-profile-panel {
  border-color: rgba(56, 189, 248, 0.45);
}

.spy-dev-paper-panel {
  margin: 2px 0 6px;
  padding: 6px 7px;
  border: 1px dashed rgba(125, 211, 176, 0.35);
  border-radius: 8px;
  background: rgba(6, 24, 18, 0.28);
}

.spy-dev-paper-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.spy-dev-paper-panel summary small {
  color: #7dd3b0;
  font-size: 11px;
  font-weight: 800;
}

.spy-dev-paper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.spy-dev-paper-grid label {
  min-width: 0;
}

.spy-dev-paper-grid .input,
.spy-dev-paper-grid .btn {
  width: 100%;
  min-height: 28px;
}

.spy-dev-asset-mode {
  align-self: end;
  min-height: 28px;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(125, 211, 176, 0.08);
  color: #7dd3b0;
  font-size: 11px;
  font-weight: 850;
}

.spy-dev-paper-output {
  grid-column: 1 / -1;
  min-height: 84px;
  max-height: 180px;
  overflow: auto;
  padding: 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.exec-actions,
.replay-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  margin: 2px 0;
}

.exec-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

#buyCall { grid-column: 1 / 4; }
#buyPut { grid-column: 4 / 7; }
#sell25 { grid-column: 1 / 3; }
#sell50 { grid-column: 3 / 5; }
#sell100 { grid-column: 5 / 7; }

.platform-hotkey-hint {
  grid-column: 1 / 7;
  margin-top: 1px;
  color: rgba(213, 219, 246, 0.70);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.exec-compact-bar {
  display: grid;
  gap: 1px;
  margin: 2px 0;
  min-width: 0;
  max-width: 100%;
}

.exec-grid-row {
  display: grid;
  gap: 1px;
  align-items: stretch;
  min-width: 0;
}

.stat-row {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.control-row {
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
}

.log-row {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.exec-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  min-height: 24px;
  padding: 1px 4px;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.1;
  white-space: normal;
  min-width: 0;
  overflow: visible;
}

.chip-val {
  color: var(--text);
  font-weight: 900;
  min-width: 0;
}

.stat-chip {
  justify-content: space-between;
  min-width: 0;
  width: 100%;
}

.pnl-stat {
  width: 100%;
  min-width: 0;
}

.trades-stat {
  min-width: 0;
}

.risk-stat {
  justify-content: center;
}

.risk-pct-input {
  width: 48px;
  min-height: 20px;
  margin-left: 4px;
  padding: 1px 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.20);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.risk-percent-symbol {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.stat-val {
  display: inline-block;
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow: visible;
  font-size: 15px;
}

.stat-val.pnl-hidden {
  color: var(--muted);
}

.pnl-val {
  flex: 0 0 auto;
  min-width: 88px;
  font-size: 19px;
  letter-spacing: 0;
}

.hide-pnl-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.hide-pnl-chip {
  justify-content: center;
  gap: 5px;
}

.hide-pnl-chip input,
.trade-log-toggle input {
  width: 12px;
  height: 12px;
  margin: 0;
}

.control-chip {
  width: 100%;
  min-width: 0;
}

.stop-chip {
  gap: 4px;
}

.hide-pnl-inline input {
  width: 12px;
  height: 12px;
  margin: 0;
}

.input,
select,
button {
  background: rgba(244, 240, 231, 0.055);
  border: 1px solid var(--border-soft);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 800;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: rgba(170, 162, 149, 0.74);
}

.input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: rgba(120, 198, 163, 0.58);
  box-shadow: 0 0 0 3px rgba(120, 198, 163, 0.13);
}

select option {
  background: #151619;
  color: var(--text-primary);
}

.exec-chip .input,
.exec-chip select.input {
  width: auto;
  min-width: 0;
  height: 21px;
  padding: 1px 4px;
  border-radius: 6px;
  font-size: 12.75px;
  font-weight: 800;
  box-sizing: border-box;
  flex: 0 1 auto;
}

#moneyness { width: 132px; min-width: 132px; max-width: 132px; height: 28px; line-height: 1.1; }
#right { width: 66px; }
#qtyInput { width: 38px; min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
#setupTagSelect {
  width: 124px;
  min-width: 124px;
  max-width: 124px;
}

.setup-quality-hint {
  flex: 1 1 100%;
  margin-top: -3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.setup-quality-hint[data-tone="nudge"] {
  color: #f6df9a;
}

.pricing-chip select.input {
  width: 84px;
  min-width: 84px;
  max-width: 84px;
}
.stop-loss-input {
  width: 4ch !important;
  min-width: 4ch !important;
  max-width: 4ch;
  box-sizing: content-box;
  padding-left: 4px !important;
  padding-right: 4px !important;
  text-align: right;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}

.stop-loss-input::-webkit-outer-spin-button,
.stop-loss-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stop-loss-status-chip { min-width: 104px; justify-content: center; }
.trade-log-copy {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 24px;
  padding: 2px 5px;
  font-size: 12.5px;
  border-radius: 6px;
  white-space: normal;
}

.trade-log-toggle {
  min-height: 24px;
  justify-content: center;
  box-sizing: border-box;
  font-size: 12.5px;
  font-weight: 800;
  min-width: 0;
  overflow: visible;
  white-space: normal;
}

.trade-log-fallback {
  width: 100%;
  min-height: 110px;
  margin: 4px 0 6px;
  padding: 8px;
  resize: vertical;
  font-size: 11px;
  line-height: 1.35;
}

.trade-log-fallback.hidden {
  display: none;
}
#dateSelect { width: 100%; }

.btn {
  min-width: 72px;
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(244, 240, 231, 0.10), rgba(244, 240, 231, 0.052));
  border-color: rgba(244, 240, 231, 0.16);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  transition: filter 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.btn.compact {
  min-width: 50px;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 11.5px;
}

.btn.buy-call {
  background: linear-gradient(180deg, rgba(120, 198, 163, 0.92), rgba(120, 198, 163, 0.50));
  border-color: rgba(120, 198, 163, 0.58);
  color: #08110d;
}

.btn.buy-put {
  background: linear-gradient(180deg, rgba(215, 98, 88, 0.94), rgba(215, 98, 88, 0.52));
  border-color: rgba(215, 98, 88, 0.58);
  color: #170807;
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.selected-box,
.box {
  border-radius: 7px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(244, 240, 231, 0.052), rgba(244, 240, 231, 0.030));
  padding: 3px 4px;
  margin-top: 2px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.16);
}

.selected-box strong,
.selected-box small {
  display: block;
  margin-top: 3px;
}

.selected-box strong {
  font-size: 16px;
  line-height: 1.25;
}

.selected-contracts-box {
  padding: 3px 4px;
}

.selected-contracts-title {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 2px;
}

.selected-atm-inline {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.selected-contract-hidden {
  display: none;
}

.selected-contract-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.selected-side {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.025);
  min-width: 0;
}

.selected-side-heading {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  align-items: baseline;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.1;
}

.selected-side-heading strong {
  color: var(--text);
  font-size: 18px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.selected-quote-line {
  margin-top: 2px;
  font-size: 15px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: normal;
  line-height: 1.15;
}

.quote-freshness {
  display: none;
}

.quote-freshness.fresh {
  color: #8dd7a5;
}

.quote-freshness.stale {
  color: #f1ad73;
}

.quote-bid-ask {
  display: block;
}

.quote-mid-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  min-width: 0;
}

.spread-meter {
  position: relative;
  flex: 1 1 42px;
  max-width: 70px;
  min-width: 38px;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.spread-meter > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 120ms ease, background 120ms ease;
}

.spread-meter.tight > span {
  background: linear-gradient(90deg, rgba(116, 232, 182, 0.72), rgba(116, 232, 182, 0.96));
}

.spread-meter.medium > span {
  background: linear-gradient(90deg, rgba(255, 214, 126, 0.78), rgba(255, 178, 94, 0.98));
}

.spread-meter.wide > span {
  background: linear-gradient(90deg, rgba(255, 140, 116, 0.82), rgba(255, 75, 92, 0.98));
}

.spread-meter-empty {
  opacity: 0.45;
}

.selected-side-reason {
  margin-top: 1px;
  color: var(--muted);
  line-height: 1.15;
}

.selected-box small {
  font-size: 12.5px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.38;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d5dbf6;
}

#positionsBox {
  height: 72px;
  min-height: 72px;
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3px;
  font-size: 14.5px;
  line-height: 1.05;
  white-space: normal;
  word-break: normal;
  resize: vertical;
}

#positionsBox.positions-stale {
  box-shadow: none;
}

.positions-quote-age {
  display: none;
}

.positions-panel {
  padding: 2px 4px;
}

.positions-panel h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1;
}

.session-journal-panel {
  margin-top: 8px;
}

.session-journal-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-weight: 850;
}

.session-journal-panel summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.journal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.journal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 750;
}

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

.journal-mode-note {
  justify-content: center;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.journal-mode-note b {
  color: var(--text);
  font-size: 13px;
}

.journal-notes,
.journal-summary {
  width: 100%;
  resize: vertical;
  line-height: 1.35;
}

.journal-emotions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.journal-emotions legend {
  padding: 0 4px;
  color: var(--muted);
}

.journal-emotions label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
}

.journal-auto-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  font-size: 11px;
}

.journal-auto-stats span {
  min-width: 0;
}

.journal-auto-stats b {
  color: var(--text);
}

.performance-tracking-panel {
  margin-top: 8px;
}

.training-hub-section {
  margin-top: 8px;
}

.trainer-visual-dashboard {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.trainer-dashboard-head,
.trainer-coach-summary-card {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.trainer-dashboard-head h2,
.trainer-coach-summary-card h2 {
  font-size: 17px;
  margin: 2px 0 0;
}

.trainer-coach-summary-card {
  align-items: stretch;
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.trainer-coach-summary-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  width: 100%;
}

.trainer-coach-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 10px;
  width: 100%;
}

.trainer-coach-grid article {
  background: rgba(244, 240, 231, 0.046);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 10px;
}

.trainer-coach-grid span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.trainer-coach-grid b {
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.trainer-coach-summary-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
  max-width: none;
  width: 100%;
}

.trainer-daily-ai-feedback-card {
  background: rgba(244, 240, 231, 0.046);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.trainer-daily-ai-feedback-card.is-empty {
  opacity: 0.78;
}

.trainer-daily-ai-feedback-text {
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.42;
  white-space: pre-wrap;
}

.trainer-daily-ai-feedback-debug {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.coach-detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 10px;
}

.coach-detail-grid section {
  background: rgba(244, 240, 231, 0.035);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px 12px;
}

.coach-detail-grid h3 {
  color: var(--text-primary);
  font-size: 12px;
  margin: 0 0 8px;
}

.coach-detail-grid ul {
  color: var(--text-secondary);
  display: grid;
  gap: 6px;
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
  padding-left: 16px;
}

.trainer-metric-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
}

.trainer-metric-card {
  background: linear-gradient(180deg, var(--card-bg-strong), var(--card-bg));
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 10px;
}

.trainer-metric-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.trainer-metric-card b {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.trainer-chart-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trainer-chart-card {
  background: linear-gradient(180deg, rgba(244, 240, 231, 0.050), rgba(244, 240, 231, 0.026));
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 10px;
}

.trainer-chart-card-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.trainer-chart-card-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.trainer-chart-card-head b {
  color: var(--text);
  font-size: 12px;
}

.trainer-sparkline {
  display: block;
  height: 96px;
  overflow: visible;
  width: 100%;
}

.trainer-sparkline-path {
  fill: none;
  stroke: rgba(120, 198, 163, 0.92);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.trainer-sparkline-dot {
  fill: rgba(120, 198, 163, 0.96);
}

.trainer-sparkline-zero {
  stroke: rgba(244, 240, 231, 0.13);
  stroke-dasharray: 4 5;
  stroke-width: 1;
}

.trainer-sparkline-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.trainer-week-bars {
  align-items: end;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(7, minmax(18px, 1fr));
  min-height: 96px;
}

.trainer-week-bar {
  align-items: center;
  display: grid;
  gap: 4px;
  grid-template-rows: 1fr auto;
  height: 100%;
}

.trainer-week-bar span {
  align-self: end;
  background: linear-gradient(180deg, rgba(214, 181, 109, 0.95), rgba(120, 198, 163, 0.74));
  border-radius: 5px 5px 2px 2px;
  min-height: 8px;
  width: 100%;
}

.trainer-week-bar small {
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.trainer-bar-list {
  display: grid;
  gap: 8px;
}

.trainer-bar-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(70px, 0.85fr) minmax(90px, 1.5fr) 28px;
}

.trainer-bar-row span,
.trainer-bar-row b {
  color: var(--muted);
  font-size: 11px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trainer-bar-row b {
  color: var(--text);
  text-align: right;
}

.trainer-bar-row div {
  background: rgba(244, 240, 231, 0.08);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.trainer-bar-row i {
  background: rgba(120, 198, 163, 0.84);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.trainer-ratio-bar {
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  display: flex;
  height: 28px;
  overflow: hidden;
  position: relative;
}

.trainer-ratio-win,
.trainer-ratio-loss {
  display: block;
  height: 100%;
}

.trainer-ratio-win {
  background: rgba(92, 214, 170, 0.86);
}

.trainer-ratio-loss {
  background: rgba(255, 110, 110, 0.72);
}

.trainer-ratio-bar b {
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  left: 50%;
  position: absolute;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.trainer-chart-empty {
  align-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  justify-content: center;
  min-height: 96px;
  padding: 10px;
  text-align: center;
}

.training-hub-section summary,
.latest-session-report-panel summary,
.telemetry-panel summary {
  cursor: pointer;
  font-weight: 850;
}

.current-session-quality {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.tester-persistence-notice {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 7px;
  border: 1px solid rgba(246, 223, 154, 0.34);
  background: rgba(246, 223, 154, 0.08);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.tester-persistence-notice strong {
  color: var(--text);
  font-size: 12px;
}

.session-state-strip {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px;
}

.session-state-strip span {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 7px;
}

.session-state-strip b {
  color: var(--text);
}

.performance-tracking-panel summary {
  cursor: pointer;
  font-weight: 850;
}

.performance-tracking-panel summary small {
  color: var(--muted);
  float: right;
  font-size: 11px;
}

.performance-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.performance-stats {
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
}

.dashboard-filter-row {
  align-items: end;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
}

.dashboard-filter-row label {
  color: var(--muted);
  display: grid;
  font-size: 11px;
  font-weight: 800;
  gap: 3px;
}

.dashboard-filter-row .input {
  min-width: 132px;
}

.dashboard-filter-row #dashFilterSessionMode {
  min-width: 112px;
}

.dashboard-filter-row #dashFilterSymbol {
  min-width: 92px;
}

.dashboard-filter-row .btn {
  align-self: end;
}

.performance-backup-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.performance-export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tester-onboarding-panel {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px;
}

.tester-onboarding-panel summary {
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.tester-onboarding-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 8px;
}

.tester-onboarding-grid strong {
  color: var(--text);
  font-size: 12px;
}

.tester-onboarding-grid ol,
.tester-onboarding-grid ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.tester-onboarding-grid li,
.tester-onboarding-grid p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.recent-sessions-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recent-sessions-panel summary small {
  float: right;
  font-size: 11px;
}

.recent-sessions-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  font-size: 11px;
}

.recent-session-row {
  display: grid;
  grid-template-columns: 48px 74px 98px minmax(130px, 1.25fr) minmax(100px, 1fr) 48px 72px 58px 76px 82px;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.14);
  color: var(--muted);
}

.recent-session-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-session-row.recent-session-sandbox {
  background: rgba(246, 223, 154, 0.06);
  box-shadow: inset 3px 0 0 rgba(246, 223, 154, 0.5);
}

.recent-session-header {
  color: var(--text);
  font-weight: 850;
  background: rgba(255, 255, 255, 0.06);
}

.recent-session-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.recent-session-empty {
  color: var(--muted);
  padding: 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.14);
}

.data-collection-status summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.data-health-status {
  margin-top: 8px;
}

.data-health-status summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .trainer-dashboard-head,
  .trainer-coach-summary-card {
    align-items: stretch;
    display: grid;
  }

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

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

.data-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.data-health-section {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.data-health-section h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0;
}

.data-health-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.data-health-score b {
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.data-health-score span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.data-health-details {
  min-height: 94px;
  font-size: 11px;
}

@media (max-width: 920px) {
  .data-health-grid {
    grid-template-columns: 1fr;
  }
}

.telemetry-panel summary {
  cursor: pointer;
}

.trade-card h2 {
  margin: 0 0 2px 0;
  font-size: 15px;
  line-height: 1.05;
}

.position-row {
  display: flex;
  align-items: baseline;
  gap: 2px;
  flex-wrap: wrap;
  white-space: normal;
  line-height: 1.05;
  min-height: 0;
  padding: 0;
  margin: 0;
}

.position-main {
  display: inline;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  font-size: 14.5px;
  font-weight: 850;
}

.position-badge {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 4px;
  border: 1px solid rgba(91, 141, 239, 0.38);
  border-radius: 4px;
  color: #8ab4ff;
  background: rgba(91, 141, 239, 0.12);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
}

.position-pnl {
  display: inline;
  margin-left: 0;
  font-weight: 900;
  white-space: nowrap;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.action-hotkey-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1.05;
  min-width: 0;
  min-height: 50px;
  padding: 5px 5px;
  font-size: 16px;
  font-weight: 900;
}

.action-hotkey-btn > span {
  display: block;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0;
}

.action-hotkey-btn > small {
  color: rgba(234, 238, 255, 0.9);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.exec-actions .btn {
  width: 100%;
  min-width: 0;
}

.exec-actions .btn.compact {
  min-width: 0;
}

.buy-action-btn {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.buy-action-btn .trade-action-content {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  column-gap: 8px;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
}

.trade-action-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  font-weight: 950;
  line-height: 1;
  min-width: 24px;
}

.trade-action-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}

.trade-action-label,
.trade-action-hotkey {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.trade-action-label {
  line-height: 1;
}

.trade-action-hotkey {
  color: rgba(234, 238, 255, 0.9);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

#sell25.action-hotkey-btn,
#sell50.action-hotkey-btn,
#sell100.action-hotkey-btn {
  gap: 4px;
  padding: 5px 4px;
}

#sell25.action-hotkey-btn > span,
#sell50.action-hotkey-btn > span,
#sell100.action-hotkey-btn > span {
  font-size: 17px;
  font-weight: 950;
}

#sell25.action-hotkey-btn > small,
#sell50.action-hotkey-btn > small,
#sell100.action-hotkey-btn > small {
  color: rgba(234, 238, 255, 0.86);
  font-size: 10.5px;
  font-weight: 850;
}

@media (max-width: 1180px) {
  .exec-actions {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.position-pnl.positive { color: var(--green); }
.position-pnl.negative { color: var(--red); }
.position-pnl.flat { color: var(--muted); }
.position-pnl.pnl-hidden { color: var(--muted); }

.hide-pnl-toggle {
  padding: 2px 5px;
  border-radius: 7px;
  font-size: 12px;
}

.market-context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 6px;
  align-items: stretch;
}

.left-market-context-box {
  margin: 0 0 10px;
}

.left-market-context-box h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.1;
}

.market-context-live {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: rgba(125, 211, 176, 0.9);
  box-shadow: 0 0 0 0 rgba(125, 211, 176, 0.34);
  animation: market-live-dot 2.8s ease-in-out infinite;
}

.left-market-context-box .market-context-grid {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}

.market-read-summary {
  grid-column: 1 / -1;
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 6px 8px;
  border: 1px solid rgba(120, 198, 163, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(120, 198, 163, 0.13), rgba(214, 181, 109, 0.07));
}

.market-read-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.market-read-summary strong {
  color: var(--text);
  font-size: 12.75px;
  font-weight: 900;
  line-height: 1.15;
}

.context-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, 112px);
  gap: 3px 7px;
  align-items: start;
  min-width: 0;
  min-height: 66px;
  padding: 6px 7px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(244, 240, 231, 0.045);
  box-shadow: inset 3px 0 0 rgba(170, 162, 149, 0.18);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.context-row span {
  color: var(--muted);
  font-size: 10.25px;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.context-row strong {
  justify-self: end;
  color: var(--text);
  width: 100%;
  min-width: 0;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(244, 240, 231, 0.075);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

.context-row small {
  grid-column: 1 / -1;
  color: #aab3d8;
  min-height: 24px;
  font-size: 10.25px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
}

.context-row.context-row-updated {
  animation: market-context-update 560ms ease-out;
}

@keyframes market-context-update {
  0% {
    background-color: rgba(125, 211, 176, 0.14);
    box-shadow: inset 3px 0 0 rgba(125, 211, 176, 0.82), 0 0 0 1px rgba(125, 211, 176, 0.22);
  }
  100% {
    background-color: rgba(255, 255, 255, 0.04);
  }
}

@keyframes market-live-dot {
  0%, 100% {
    opacity: 0.72;
    box-shadow: 0 0 0 0 rgba(125, 211, 176, 0.30);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 0 5px rgba(125, 211, 176, 0);
  }
}

.context-row.bullish {
  border-color: rgba(125, 211, 176, 0.26);
  box-shadow: inset 3px 0 0 rgba(125, 211, 176, 0.72);
}

.context-row.bearish {
  border-color: rgba(242, 167, 181, 0.30);
  box-shadow: inset 3px 0 0 rgba(242, 167, 181, 0.78);
}

.context-row.neutral {
  border-color: rgba(246, 223, 154, 0.24);
  box-shadow: inset 3px 0 0 rgba(246, 223, 154, 0.70);
}

.context-row.bullish strong {
  color: var(--green);
  background: rgba(125, 211, 176, 0.11);
}

.context-row.bearish strong {
  color: var(--red);
  background: rgba(242, 167, 181, 0.12);
}

.context-row.neutral strong {
  color: #f6df9a;
  background: rgba(246, 223, 154, 0.10);
}

.context-row.muted strong,
.context-row.muted small { color: var(--muted); }

@media (max-width: 760px) {
  .market-context-grid,
  .left-market-context-box .market-context-grid {
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  }

  .context-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .context-row strong {
    justify-self: stretch;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .market-context-live,
  .context-row.context-row-updated {
    animation: none;
  }
}

.debug-details {
  margin-top: 4px;
}

.debug-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .sim-shell {
    height: auto;
    grid-template-columns: 1fr;
  }
  .chart-pane {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(360px, 70vh) minmax(320px, 55vh) minmax(320px, 55vh);
    grid-template-areas:
      "settings"
      "chart1m"
      "chart15m"
      "chart5m";
  }
  .chart-pane.focus-mode {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(420px, 70vh);
    grid-template-areas:
      "settings"
      "chart1m";
  }
.multi-chart-title {
  left: 10px;
  right: auto;
}
.chart-overlay-control {
  left: 10px;
  right: auto;
  top: 48px;
}
.overlay-grid {
  left: 0;
  right: auto;
}
.quadrant-resizer { display: none; }
}

.training-persistence-warning {
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 800;
}

.training-persistence-warning:not(.is-active) {
  display: none !important;
}

.data-persistence-status {
  grid-column: 1 / -1;
}

/* Dark matte theme harmonization layer. Keep this late so legacy component rules inherit the product palette. */
.admin-developer,
.account-shell,
.training-hub,
.sim-shell {
  background: transparent;
}

.trade-card,
.chart-pane,
.box,
.selected-box,
.training-hub-header,
.admin-dev-section,
.account-card,
.trainer-chart-card,
.trainer-metric-card,
.tester-onboarding-panel,
.cloud-sync-card,
.data-health-status,
.data-collection-status,
.data-persistence-status,
.telemetry-panel {
  border-color: var(--border-soft);
  background-color: rgba(244, 240, 231, 0.038);
}

details.box,
details.admin-dev-section,
details.telemetry-panel,
details.data-health-status,
details.data-collection-status,
details.data-persistence-status {
  background: linear-gradient(180deg, rgba(244, 240, 231, 0.050), rgba(244, 240, 231, 0.026));
}

details > summary {
  color: var(--text-secondary);
}

.quality-chip,
.pill,
.session-state-strip span,
.replay-status-box span,
.stat-chip,
.control-chip,
.exec-chip,
.regime-badge {
  border-color: var(--border-soft);
  background: rgba(244, 240, 231, 0.052);
  color: var(--muted);
}

.release-safety-flags {
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
}

.quality-chip b,
.pill b,
.session-state-strip b,
.replay-status-box b,
.stat-chip b,
.exec-chip b {
  color: var(--text-primary);
}

.dashboard-filter-row,
.journal-auto-stats,
.journal-mode-note,
.recent-session-row,
.recent-session-empty,
.training-filter-grid,
.cloud-sync-map span,
.account-storage-diagnostics {
  border-color: var(--border-soft);
  background: rgba(244, 240, 231, 0.045);
}

.recent-session-header,
.admin-metrics-table thead tr {
  background: rgba(244, 240, 231, 0.066);
}

.admin-metrics-table tr:hover,
.recent-session-row:hover {
  background: rgba(120, 198, 163, 0.075);
}

.input,
select,
textarea,
button {
  border-color: var(--border-soft);
}

.btn.buy-call,
.buy-action-btn.buy-call {
  background: linear-gradient(180deg, rgba(120, 198, 163, 0.94), rgba(120, 198, 163, 0.56));
  border-color: rgba(120, 198, 163, 0.64);
  color: #08110d;
  box-shadow: 0 18px 44px rgba(120, 198, 163, 0.14);
}

.btn.buy-put {
  background: linear-gradient(180deg, rgba(215, 98, 88, 0.94), rgba(215, 98, 88, 0.56));
  border-color: rgba(215, 98, 88, 0.64);
  color: #180807;
  box-shadow: 0 18px 44px rgba(215, 98, 88, 0.13);
}

#sell25.action-hotkey-btn,
#sell50.action-hotkey-btn,
#sell100.action-hotkey-btn {
  background: linear-gradient(180deg, rgba(214, 181, 109, 0.30), rgba(244, 240, 231, 0.055));
  border-color: rgba(214, 181, 109, 0.30);
}

.account-danger-placeholder,
.btn.danger,
.danger {
  border-color: rgba(215, 98, 88, 0.48);
  color: #efaaa3;
}

.training-persistence-warning {
  border-color: rgba(215, 98, 88, 0.45);
  background: rgba(215, 98, 88, 0.10);
  color: #efc1bc;
}
