/* ReplayLab · one canonical workstation design system.
   Flat institutional UI, compact but legible. Existing palette and interactions retained. */
:root {
  --type-xs:11px; --type-sm:12px; --type-md:13px; --type-base:14px;
  --type-lg:16px; --type-heading:18px; --type-display:20px;
  --space-1:2px; --space-2:4px; --space-3:6px; --space-4:8px;
  --space-5:12px; --space-6:16px; --space-7:20px; --space-8:24px;
  --space-9:32px; --space-10:48px;
  --radius-xs:2px; --radius-sm:4px;
  --control-small:32px; --control-standard:40px; --control-primary:48px;
  --field-stacked:60px; --header-height:68px;
  --note-min-height:56px;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
.app {
  height: 100dvh;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.icon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  pointer-events: none;
}
.topbar {
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
  position: relative;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
}
.toolbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: transparent;
  padding: 0;
}
.toolbtn.text {
  width: auto;
  white-space: nowrap;
}
.toolbtn.text .icon {
  width: 13px;
  height: 13px;
  color: var(--text-muted);
}
.toolbtn.symbol {
  border-color: var(--line);
}
.toolbar-line {
  width: 1px;
  flex: 0 0 1px;
}
.topgroup,
.player-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.play-main {
  background: var(--blue);
  color: var(--on-action);
  border-radius: var(--radius-sm);
  border-color: var(--blue);
  box-shadow: none;
}
.play-main:hover {
  background: var(--accent-press);
  color: var(--on-action);
}
.workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  overflow: hidden;
}
.left-rail {
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  flex-direction: column;
}
.rail-btn {
  position: relative;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rail-sep {
  height: 1px;
  width: 25px;
  margin: var(--space-3) 0;
}
.chart-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.charts {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
.charts.chart-custom {
  position: relative;
  grid-template-rows: minmax(0,1fr);
}
.chart-row-handle {
  position: absolute;
  left: 0;
  right: 0;
  height: 10px;
  transform: translateY(-50%);
  z-index: 6;
  cursor: row-resize;
  background: transparent;
  border: 0;
  padding: 0;
  touch-action: none;
}
.chart-row-handle:after {
  content: "";
  position: absolute;
  left: calc(50% - 24px);
  top: 3px;
  width: 48px;
  height: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.chart-row-handle:hover:after,
.chart-row-handle:focus-visible:after {
  opacity: 1;
}
.chart-tile {
  min-width: 0;
  min-height: 0;
  position: relative;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background-color: var(--chart-canvas);
  background-size: 10% 20%;
}
.chart-tile-head {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  pointer-events: none;
}
/* Unified trades and journal: one shared Swiss-minimalist density and type scale. */
.drawer-body.unified-trades-body {
  padding: var(--space-2) var(--space-5) var(--space-6);
}
.unified-trades-tabs {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: thin;
  gap: var(--space-1);
  margin: 0 0 var(--space-2);
  border-bottom: 1px solid var(--border);
}
.unified-trades-tabs button {
  flex: 0 0 auto;
  min-height: var(--control-small);
  padding: 0 var(--space-2);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--type-xs);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.unified-trades-tabs button:hover {color: var(--text-primary);}
.unified-trades-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.unified-trades-tabs:not(.secondary) button {flex: 1 1 0;min-width: 0;}
.unified-trades-tabs.secondary {gap: var(--space-5);margin-bottom: var(--space-2);border-bottom: 0;}
.unified-trades-tabs.secondary button {min-height: calc(var(--control-small) - var(--space-2));padding: 0 var(--space-1);border-bottom: 0;font-weight: 500;}
.unified-trades-tabs.secondary button.active {font-weight: 600;}
.unified-trades-filter {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: 0 0 var(--space-2);
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.unified-trades-filter-control {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 1 auto;
  min-width: 0;
  min-height: var(--control-small);
  padding: 0 var(--space-1);
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--type-xs);
  white-space: nowrap;
  cursor: pointer;
}
.unified-trades-filter-label {color: var(--text-muted);}
.unified-trades-filter-value {font-weight: 600;}
.unified-trades-filter-value.selected {color: var(--accent);}
.unified-trades-filter-control:hover .unified-trades-filter-value {color: var(--accent);}
.unified-trades-filter-control:focus-visible {outline: 2px solid var(--focus-ring);outline-offset: 2px;}
.unified-trades-filter-sort {display: inline-flex;flex: none;flex-direction: column;gap: 2px;color: var(--text-muted);}
.unified-trades-filter-sort::before,.unified-trades-filter-sort::after {content: "";width: 0;height: 0;border-left: 3px solid transparent;border-right: 3px solid transparent;}
.unified-trades-filter-sort::before {border-bottom: 4px solid currentColor;}
.unified-trades-filter-sort::after {border-top: 4px solid currentColor;}
.unified-trades-list {border-top: 1px solid var(--border);}
.trade-history-row {
  margin: 0 calc(-1 * var(--space-5));
  padding: 0 var(--space-5);
  border-bottom: 1px solid var(--border);
}
.trade-history-summary {position: relative;padding: var(--space-4) 0;}
.trade-history-row:not(.selected) .trade-history-summary:has(.trade-history-select:hover) {
  margin: 0 calc(-1 * var(--space-5));
  padding: var(--space-4) var(--space-5);
  background: var(--surface-hover);
}
.trade-history-row.selected .trade-history-summary {
  margin: 0 calc(-1 * var(--space-5));
  padding: var(--space-4) var(--space-5);
  background: var(--accent-subtle);
}
.trade-history-select {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.trade-history-select:focus-visible {outline: 2px solid var(--focus-ring);outline-offset: -2px;}
.trade-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
}
.trade-history-heading strong:first-child {
  min-width: 0;
  font-size: var(--type-base);
  font-weight: 700;
}
.trade-history-side {font-weight: 600;}
.trade-history-side.long {color: var(--positive);}
.trade-history-side.short {color: var(--negative);}
.trade-history-pnl {
  flex: none;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--numeric-font);
  font-size: var(--type-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.trade-history-pnl.positive {color: var(--positive);background: color-mix(in srgb,var(--positive) 11%,var(--surface));}
.trade-history-pnl.negative {color: var(--negative);background: color-mix(in srgb,var(--negative) 11%,var(--surface));}
.trade-history-fields {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  margin-top: var(--space-3);
}
.trade-history-overview {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.trade-history-volume {
  display: grid;
  grid-template-columns: 68px max-content;
  align-items: baseline;
  column-gap: var(--space-2);
  min-width: 0;
  color: var(--text-secondary);
  font-size: var(--type-sm);
  line-height: 1.4;
}
.trade-history-volume span {color: var(--text-muted);}
.trade-history-volume strong {color: var(--text-primary);font-weight: 700;font-variant-numeric: tabular-nums;}
.trade-history-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
  margin-left: auto;
}
.trade-history-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--type-xs);
  font-weight: 600;
  white-space: nowrap;
}
.trade-history-status::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
}
.trade-history-status.open {color: var(--positive);}
.trade-history-event {
  display: grid;
  grid-template-columns: 68px max-content minmax(0,1fr);
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
  font-size: var(--type-sm);
  line-height: 1.4;
}
.trade-history-event-label {color: var(--text-muted);}
.trade-history-event-price {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.trade-history-event-time {
  min-width: 0;
  color: var(--text-muted);
  font-size: var(--type-xs);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.trade-history-jump {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--control-small);
  width: var(--control-small);
  height: var(--control-small);
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.trade-history-jump:hover {background: var(--surface-hover);color: var(--accent);}
.trade-history-jump:focus-visible {outline: 2px solid var(--focus-ring);outline-offset: 1px;}
.trade-history-jump .icon {width: 15px;height: 15px;}
.trade-inline-preview {
  padding: var(--space-4) 0 var(--space-5);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface);
}
.trade-inline-fee {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--type-sm);
  color: var(--text-secondary);
}
.trade-inline-fee strong {
  min-width: 0;
  text-align: right;
  color: var(--text-primary);
  font-family: var(--numeric-font);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.trade-inline-diary {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-4);
  margin-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}
.trade-inline-diary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.trade-inline-diary-heading strong {font-size: var(--type-sm);font-weight: 600;color: var(--text-primary);}
.trade-inline-diary-status {color: var(--text-secondary);font-size: var(--type-xs);white-space: nowrap;}
.trade-inline-diary-status.complete {color: var(--accent);}
.trade-inline-diary-summary {margin: 0;color: var(--text-primary);font-size: var(--type-sm);line-height: 1.4;}
.trade-inline-diary-note,
.trade-inline-diary-missing {margin: 0;color: var(--text-secondary);font-size: var(--type-xs);line-height: 1.4;}
.trade-inline-open {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-2) 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: var(--type-sm);
  font-weight: 600;
  cursor: pointer;
}
.trade-inline-open:hover {color: var(--accent-press);text-decoration: underline;}
.trade-inline-open:focus-visible {outline: 2px solid var(--focus-ring);outline-offset: 2px;}
.trade-inline-open .icon {width: 15px;height: 15px;}
.unified-empty {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-2);
  font-size: var(--type-sm);
  color: var(--text-secondary);
}
.unified-empty strong {color: var(--text-primary);}
.order-history-heading {flex-wrap: wrap;}
.order-history-status-wrap {display: inline-flex;align-items: center;gap: var(--space-3);margin-left: auto;color: var(--text-muted);}
.order-history-status-wrap .icon {width: 14px;height: 14px;}
.order-status {
  flex: none;
  color: var(--text-secondary);
  font-size: var(--type-xs);
  font-weight: 600;
}
.order-status.pending,.order-status.open,.order-status.partially_filled {color: var(--accent);}
.order-status.filled {color: var(--positive);}
.order-history-price {display: flex;align-items: baseline;gap: var(--space-2);font-size: var(--type-sm);color: var(--text-secondary);}
.order-history-price strong {color: var(--text-primary);font-weight: 600;font-variant-numeric: tabular-nums;}
.order-history-meta {display: flex;align-items: baseline;justify-content: space-between;flex-wrap: wrap;gap: var(--space-2);}
.order-history-fill {display: inline-flex;align-items: baseline;gap: var(--space-2);min-width: 0;font-size: var(--type-sm);}
.order-history-fill span {color: var(--text-muted);}
.order-history-fill strong {color: var(--text-primary);font-weight: 600;font-variant-numeric: tabular-nums;white-space: nowrap;}
.order-history-date {color: var(--text-muted);font-size: var(--type-xs);font-variant-numeric: tabular-nums;text-align: right;white-space: nowrap;}
.order-history-fact + .order-history-fact {border-top: 1px solid var(--border-subtle);}
.order-history-notional {display: flex;flex-direction: column;align-items: flex-end;gap: var(--space-1);min-width: 0;text-align: right;}
.order-history-notional strong {color: var(--text-primary);font-family: var(--numeric-font);font-weight: 600;font-variant-numeric: tabular-nums;}
.order-history-notional span {font-size: var(--type-xs);color: var(--text-muted);}
.order-history-reason {margin: var(--space-3) 0 0;color: var(--text-secondary);font-size: var(--type-xs);line-height: 1.45;}
.order-history-cancel {margin-top: var(--space-4);padding: var(--space-2) 0;border: 0;background: transparent;color: var(--text-secondary);font-size: var(--type-xs);text-decoration: underline;cursor: pointer;}
.order-history-cancel:hover {color: var(--negative);}
.journal-detail-body {padding-top: var(--space-4);}
.journal-detail-back {display: inline-flex;align-items: center;gap: var(--space-2);padding: 0;border: 0;background: transparent;color: var(--text-primary);font-size: var(--type-base);font-weight: 700;cursor: pointer;}
.journal-detail-pager {display: inline-flex;align-items: center;gap: var(--space-1);white-space: nowrap;color: var(--text-secondary);font-family: var(--numeric-font);font-size: var(--type-xs);font-variant-numeric: tabular-nums;}
.journal-detail-pager .toolbtn {width: var(--control-small);}
.journal-detail-summary {padding-bottom: var(--space-5);border-bottom: 1px solid var(--border);}
.journal-detail-symbol {display: flex;align-items: baseline;justify-content: space-between;gap: var(--space-3);margin-bottom: var(--space-4);}
.journal-detail-symbol strong {font-size: var(--type-heading);font-weight: 700;}
.journal-detail-side.long {color: var(--positive);}
.journal-detail-side.short {color: var(--negative);}
.journal-detail-status {flex-shrink: 0;padding: var(--space-2) var(--space-3);border: 1px solid var(--border);border-radius: var(--radius-sm);background: var(--surface);color: var(--text-secondary);font-size: var(--type-xs);font-weight: 600;}
.journal-detail-status.open {color: var(--positive);border-color: color-mix(in srgb,var(--positive) 28%,var(--border));}
.journal-detail-facts {display: grid;gap: var(--space-1);}
.journal-detail-facts > div {display: flex;justify-content: space-between;align-items: baseline;gap: var(--space-4);padding: var(--space-1) 0;font-size: var(--type-sm);line-height: 1.35;color: var(--text-secondary);}
.journal-detail-facts strong {font-family: var(--numeric-font);font-weight: 600;color: var(--text-primary);font-variant-numeric: tabular-nums;white-space: nowrap;}
.journal-detail-facts strong.positive {color: var(--positive);}
.journal-detail-facts strong.negative {color: var(--negative);}
.journal-detail-analysis {padding: var(--space-5) 0;border-bottom: 1px solid var(--border);}
.journal-detail-analysis:last-child {border-bottom: 0;}
.journal-detail-section-title {display: flex;align-items: baseline;justify-content: space-between;gap: var(--space-2);margin-bottom: var(--space-3);}
.journal-detail-section-title strong {font-size: var(--type-base);color: var(--text-primary);}
.journal-detail-field {position: relative;padding: var(--space-3) 0 var(--space-4);}
.journal-detail-field + .journal-detail-field::before {content: "";position: absolute;top: 0;left: 0;right: 0;height: 1px;background: var(--border-subtle);pointer-events: none;}
.journal-detail-field-head {display: flex;align-items: center;justify-content: space-between;gap: var(--space-3);color: var(--text-secondary);font-size: var(--type-sm);font-weight: 600;}
.journal-detail-value:hover {color: var(--accent);}
.journal-detail-value {display: block;width: 100%;border: 0;background: transparent;text-align: left;padding: var(--space-2) 0 0;color: var(--text-primary);font-size: var(--type-base);line-height: 1.45;cursor: pointer;overflow-wrap: anywhere;}
.journal-detail-conditions {display: grid;gap: var(--space-1);padding-top: var(--space-2);}
.journal-detail-condition {display: grid;grid-template-columns: minmax(0,1fr) auto;align-items: baseline;gap: var(--space-3);width: 100%;padding: var(--space-1) 0;border: 0;background: transparent;color: var(--text-primary);font-size: var(--type-sm);line-height: 1.45;text-align: left;cursor: pointer;}
.journal-detail-condition:hover {color: var(--accent);}
.journal-detail-condition-result {font-weight: 400;color: var(--text-primary);white-space: nowrap;}
.journal-detail-condition-result.empty {color: var(--text-muted);font-weight: 400;}
.detail-checks-menu {padding: var(--space-2) var(--space-4) var(--space-3);}
.detail-checks-menu .menu-title {padding: var(--space-4) var(--space-2);}
.detail-checks-item {display: grid;grid-template-columns: minmax(0,1fr) auto;align-items: center;gap: var(--space-2);padding: var(--space-4) var(--space-2);}
.detail-checks-item + .detail-checks-item {border-top: 1px solid var(--border);}
.detail-checks-label {min-width: 0;color: var(--text-secondary);font-size: var(--type-sm);line-height: 1.35;}
.detail-checks-choice {display: flex;flex-shrink: 0;gap: var(--space-1);}
.detail-checks-choice button {min-width: 34px;padding: var(--space-2);border: 1px solid var(--border);border-radius: var(--radius-sm);background: var(--surface);color: var(--text-secondary);font-size: var(--type-xs);cursor: pointer;}
.detail-checks-choice button:hover {background: var(--surface-hover);}
.detail-checks-choice button.active {background: var(--accent-subtle);border-color: var(--accent);color: var(--accent);font-weight: 600;}
.journal-detail-add {border: 0;background: transparent;color: var(--accent);padding: 0;font-size: var(--type-sm);font-weight: 600;cursor: pointer;white-space: nowrap;}
.journal-detail-add.unfilled {color: var(--warning);}
.journal-detail-add:hover {text-decoration: underline;}
.journal-detail-text-editor {padding-top: var(--space-2);}
.journal-detail-text-editor textarea {width: 100%;min-height: var(--field-stacked);}
.journal-detail-text-actions {display: flex;justify-content: flex-end;gap: var(--space-2);margin-top: var(--space-2);}
.journal-detail-text-actions .btn-light {font-size: var(--type-xs);}
@media(max-width:430px) {
  .trade-history-volume {grid-template-columns: 62px max-content;}
  .trade-history-event {grid-template-columns: 62px max-content minmax(0,1fr);font-size: var(--type-xs);}
}
@media(max-width:360px) {
  .trade-history-event {grid-template-columns: 62px minmax(0,1fr);}
  .trade-history-event-time {grid-column: 2;text-align: left;}
}
.right-drawer {
  width: var(--drawer-width);
  flex: 0 0 var(--drawer-width);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 10;
}
.right-drawer.hidden {
  display: none;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  border-bottom: 1px solid var(--line);
}
.drawer-header h2 {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.drawer-footer {
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.right-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-left: 1px solid var(--line);
  z-index: 11;
}
.rail-spacer {
  flex: 1;
}
.field-label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: center;
}
.field-label:first-child {
  margin-top: 0;
}
.field-label a,
.muted-link {
  cursor: pointer;
}
.select-field {
  min-height: var(--control-standard);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  text-align: left;
  min-width: 0;
}
.select-field span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hint {
  margin: var(--space-3) 0;
}
.fine {
  font-size: var(--type-xs);
}
.rule {
  height: 1px;
  margin: var(--space-5) 0;
}
.account-card {
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
}
.balance {
  font-size: var(--type-display);
  font-weight: 700;
  letter-spacing: -.5px;
  margin: var(--space-3) 0 var(--space-2);
  white-space: nowrap;
}
.row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}
.between {
  justify-content: space-between;
}
.split {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: var(--space-3);
}
.split>* {
  min-width: 0;
}
.ghost-btn {
  padding: var(--space-4) var(--space-4);
  min-height: var(--control-small);
  font-size: var(--type-sm);
  text-align: center;
}
.ghost-btn.active {
  font-weight: 600;
}
.order-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-top: var(--space-5);
}
.order-tabs button {
  border: 0;
  background: transparent;
  border-bottom: 2px solid transparent;
}
.order-tabs button.active {
  font-weight: 700;
}
.input {
  width: 100%;
  min-height: var(--control-standard);
  outline: 0;
}
textarea.input {
  resize: none;
  line-height: 1.5;
  max-height: 105px;
  overflow-y: auto;
  min-height: 39px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  margin-top: var(--space-4);
}
.metric small {
  display: block;
  margin-bottom: var(--space-2);
}
.metrics .metric:last-child {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.metrics .metric:last-child small {
  margin: 0;
}
.btn-primary {
  border: 1px solid var(--blue);
  padding: var(--space-5) var(--space-5);
  font-weight: 700;
  width: 100%;
  text-align: center;
}
.btn-light {
  padding: var(--space-4) var(--space-5);
  font-size: var(--type-sm);
}
.switch {
  border: 0;
  position: relative;
  flex-shrink: 0;
}
.switch:after {
  content: "";
  position: absolute;
  border-radius: 50%;
  transition: transform .15s;
}
.micro-progress {
  overflow: hidden;
}
.micro-progress span {
  display: block;
  height: 100%;
  transition: width .2s;
}
.micro-question {
  line-height: 1.4;
  margin-bottom: var(--space-4);
}
.micro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.choice-list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.choice-list button {
  border: 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: var(--space-4) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.choice-list button:last-child {
  border-bottom: 0;
}
.choice-list button.chosen {
  font-weight: 600;
}
.choice-list .circle-mark {
  font-size: var(--type-lg);
}
.choice-list button.chosen .circle-mark {
  color: var(--blue);
}
.mini-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-5);
  font-size: var(--type-xs);
}
.mini-foot button {
  border: 0;
  background: transparent;
  font-size: var(--type-xs);
  padding: var(--space-1) var(--space-1);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
}
.summary-box {
  margin-bottom: var(--space-5);
  line-height: 1.6;
}
.summary-box strong {
  color: var(--text);
}
.popover {
  position: fixed;
  z-index: 100;
  width: 260px;
  max-height: min(460px,80vh);
  overflow: auto;
  padding: var(--space-3);
  display: none;
}
.popover.open {
  display: block;
}
.popover.over-modal {
  z-index: 140;
}
.menu-title {
  padding: var(--space-4) var(--space-5);
}
.menu-caption {
  padding: var(--space-1) var(--space-5) var(--space-3);
  font-size: var(--type-xs);
  line-height: 1.5;
}
.menu-opt {
  border: 0;
  background: transparent;
  padding: var(--space-4) var(--space-4);
  min-height: var(--control-standard);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  text-align: left;
}
.menu-opt.selected {
  font-weight: 700;
}
.menu-sep {
  height: 1px;
  margin: var(--space-3);
}
.menu-opt .right {
  text-align: right;
  font-size: var(--type-xs);
}
.speed-menu {
  padding: var(--space-4) var(--space-5) var(--space-5);
}
.speed-menu-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-7);
  font-size: var(--type-sm);
  font-weight: 600;
}
.speed-menu-head strong {
  font-size: var(--type-lg);
  font-variant-numeric: tabular-nums;
}
.speed-slider {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  margin: 0 0 var(--space-5);
  border: 0;
  cursor: pointer;
}
.speed-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
}
.speed-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
}
.speed-slider:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 6px;
}
.speed-ticks {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--type-xs);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.slider-mark {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: var(--radius-xs);
  padding: var(--space-2) var(--space-1);
  min-height: 28px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.slider-mark:not(:disabled):hover,
.slider-mark:focus-visible {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.slider-mark:focus-visible {
  outline: 1px solid var(--focus-ring);
  outline-offset: 1px;
}
.slider-mark:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.replay-toggle {
  width: 100%;
  min-height: var(--control-standard);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-4);
  background: transparent;
  border: 0;
  text-align: left;
  font-size: var(--type-sm);
}
.replay-toggle .switch {
  width: 34px;
  height: 19px;
  flex: none;
  border-radius: var(--radius-sm);
  position: relative;
}
.replay-toggle .switch:after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  transition: transform .15s;
}
.replay-toggle[aria-checked="true"] .switch:after {
  transform: translateX(15px);
}
.replay-pause-group {
  margin: var(--space-2) var(--space-4) var(--space-4);
  overflow: hidden;
}
.replay-pause-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  font-size: var(--type-sm);
  font-weight: 700;
}
.replay-pause-head .icon {
  width: 15px;
  height: 15px;
}
.replay-pause-group .replay-toggle {
  border-radius: 0;
  padding: var(--space-3) var(--space-5);
  min-height: var(--control-standard);
  background: transparent;
  font-size: var(--type-sm);
}
.replay-pause-group .replay-toggle+.replay-toggle {
  border-top: 1px solid var(--border);
}
.date-menu {
  padding: var(--space-4) var(--space-4) var(--space-5);
}
.date-menu-title {
  font-size: var(--type-md);
  font-weight: 700;
  margin: 0 0 var(--space-4);
}
.date-menu-label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: center;
  font-size: var(--type-sm);
  margin-bottom: var(--space-4);
}
.date-menu-label strong {
  font-size: var(--type-md);
}
.date-slider {
  width: 100%;
  height: 5px;
  margin: var(--space-1) 0 var(--space-4);
  cursor: pointer;
}
.date-presets {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.date-presets button {
  min-height: var(--control-small);
  padding: 0 var(--space-4);
  font-size: var(--type-xs);
}
.date-presets button.active {
  font-weight: 600;
}
.date-caption {
  font-size: var(--type-xs);
  line-height: 1.5;
  margin: 0 0 var(--space-5);
}
.date-menu input[type="datetime-local"] {
  min-width: 0;
  width: 100%;
  height: var(--control-standard);
  padding: var(--space-3) var(--space-4);
  font-size: var(--type-sm);
}
.date-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.date-actions button {
  min-height: var(--control-standard);
  padding: var(--space-4) var(--space-5);
  font-size: var(--type-sm);
  font-weight: 600;
}
.layout-menu {
  padding: var(--space-5) var(--space-4) var(--space-5);
}
.layout-grid {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-5);
}
.layout-pick {
  aspect-ratio: 1.12;
  min-width: 0;
  padding: var(--space-2);
  display: grid;
  place-items: center;
}
.layout-preview {
  width: 100%;
  height: 100%;
  display: grid;
  gap: var(--space-1);
  padding: var(--space-1);
}
.layout-cell {
  display: block;
  min-width: 0;
  min-height: 0;
}
.layout-reset {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-5);
  font-size: var(--type-sm);
  font-weight: 600;
  text-align: left;
}
.chart-type-menu {
  padding: var(--space-2);
}
.chart-type-option {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  width: 100%;
  min-height: 40px;
  padding: var(--space-4) var(--space-5);
  border: 0;
  font-size: var(--type-md);
  text-align: left;
}
.chart-type-option .chart-type-icon {
  width: 24px;
  height: 24px;
  flex: none;
}
.chart-type-separator {
  height: 1px;
  margin: var(--space-2) var(--space-3);
}
.chart-type-icon {
  width: 21px;
  height: 21px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.65;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-tooltip {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  max-width: min(340px,calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  padding: var(--space-4) var(--space-5);
  font-size: var(--type-sm);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .005em;
  overflow-wrap: break-word;
  opacity: 0;
  visibility: hidden;
  transition: opacity .08s;
}
.ui-tooltip.visible {
  opacity: 1;
  visibility: visible;
}
.ui-tooltip::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
}
.ui-tooltip[data-side="top"]::after {
  top: calc(100% - 5px);
  left: calc(var(--arrow-x,50%) - 4px);
}
.ui-tooltip[data-side="bottom"]::after {
  bottom: calc(100% - 5px);
  left: calc(var(--arrow-x,50%) - 4px);
}
.ui-tooltip[data-side="right"]::after {
  right: calc(100% - 5px);
  top: calc(var(--arrow-y,50%) - 4px);
}
.ui-tooltip[data-side="left"]::after {
  left: calc(100% - 5px);
  top: calc(var(--arrow-y,50%) - 4px);
}
.menu-disabled {
  opacity: .55;
  cursor: default;
}
.menu-disabled:hover {
  background: transparent;
}
.left-menu {
  position: fixed;
  z-index: 60;
  bottom: 0;
  left: 0;
  border-right: 1px solid var(--line);
  display: none;
  flex-direction: column;
}
.left-menu.open {
  display: flex;
}
.menu-heading {
  font-size: var(--type-heading);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin: var(--space-2) var(--space-1) var(--space-7);
}
.menu-group-title {
  font-size: var(--type-xs);
  letter-spacing: .09em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: var(--space-5) var(--space-4) var(--space-4);
}
.nav-item {
  border: none;
  background: var(--surface);
  color: var(--text-primary);
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-4);
  border-radius: var(--radius-sm);
  text-align: left;
}
.nav-item:hover,
.nav-item.active {
  background: var(--accent-subtle);
  color: var(--blue);
}
.avatar {
  height: 33px;
  width: 33px;
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--text-primary);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: var(--type-sm);
}
.menu-account {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: var(--space-5);
}
.menu-backdrop {
  position: fixed;
  inset: 64px 0 0;
  z-index: 50;
  display: none;
}
.menu-backdrop.open {
  display: block;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}
.modal-backdrop.open {
  display: flex;
}
.modal {
  width: min(380px,100%);
  padding: var(--space-7);
}
.modal h3 {
  font-size: var(--type-lg);
  margin: 0 0 var(--space-4);
}
.account-modal-body {
  padding: var(--space-6) var(--space-7) var(--space-7);
  display: grid;
  gap: var(--space-5);
}
.account-modal-caption {
  font-size: var(--type-xs);
  line-height: 1.4;
}
.account-modal-section-title {
  font-size: var(--type-sm);
  font-weight: 600;
  margin: 0 0 var(--space-3);
}
.account-modal-list {
  display: grid;
  gap: var(--space-3);
}
.account-modal-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 73px;
  padding: var(--space-4) var(--space-5);
  transition: border-color .15s,background .15s;
}
.account-select-btn {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.account-select-btn .account-selector-dot {
  flex: none;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.account-modal-item.active .account-selector-dot:after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.account-select-info {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}
.account-select-info strong {
  font-size: var(--type-md);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-select-info .account-modal-balance {
  font-size: var(--type-md);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.account-select-info small {
  font-size: var(--type-xs);
}
.account-card-rates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  font-size: var(--type-xs);
  font-variant-numeric: tabular-nums;
}
.account-card-rates b {
  font-weight: 600;
}
.account-edit-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--control-small);
  height: var(--control-small);
  border: 0;
  background: transparent;
}
.account-edit-panel {
  display: grid;
  gap: var(--space-4);
  width: 100%;
  min-width: 0;
}
.account-edit-heading {
  display: flex;
  align-items: end;
  gap: var(--space-3);
}
.account-edit-heading>div:first-child {
  flex: 1;
  min-width: 0;
}
.account-edit-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: var(--space-4);
}
.account-edit-grid .account-field-label {
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  line-height: 1.25;
}
.account-rate-input {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding-right: var(--space-4);
}
.account-rate-input .account-field {
  box-shadow: none;
}
.account-rate-input span {
  font-size: var(--type-sm);
}
.account-field-label {
  display: block;
  font-size: var(--type-xs);
  margin-bottom: var(--space-3);
  font-weight: 600;
}
.account-field {
  height: var(--control-standard);
  width: 100%;
  min-width: 0;
  padding: var(--space-4) var(--space-4);
  font-size: var(--type-sm);
}
.account-mini-btn {
  height: var(--control-standard);
  white-space: nowrap;
  padding: 0 var(--space-5);
  font-size: var(--type-sm);
  font-weight: 600;
}
.account-new-trigger {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--control-standard);
  width: 100%;
  font-size: var(--type-sm);
  font-weight: 600;
}
.account-new-form {
  padding: var(--space-5);
  display: grid;
  gap: var(--space-5);
}
.account-new-rates {padding-top: var(--space-4);border-top: 1px solid var(--border);}
.account-new-rates-title {margin: 0 0 var(--space-4);color: var(--text-secondary);font-size: var(--type-xs);font-weight: 700;}
.account-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-4);
}
.account-muted-rule {
  height: 1px;
  margin: var(--space-1) 0;
}
.account-manage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.account-manage-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.account-text-action {
  padding: var(--space-2) 0;
  border: 0;
  background: transparent;
  font-size: var(--type-sm);
}
.account-text-action:hover {
  text-decoration: underline;
}
.account-warning {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
  font-size: var(--type-sm);
  line-height: 1.5;
}
.account-warning .icon {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: var(--space-1);
}
.account-warning > div > strong:first-child {
  display: block;
  font-size: var(--type-md);
  margin-bottom: var(--space-2);
}
.account-confirm-details {
  display: grid;
  gap: var(--space-4);
  font-size: var(--type-sm);
  line-height: 1.5;
}
.account-confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-4);
}
.account-danger-btn {
  height: var(--control-standard);
  border: 1px solid var(--negative);
  padding: 0 var(--space-5);
  font-size: var(--type-sm);
  font-weight: 600;
}
.account-danger-btn:disabled {
  opacity: 1;
}
@media(max-width:480px) {
  .modal-backdrop {
    padding: var(--space-4);
  }
  .account-modal-body {
    padding: var(--space-5) var(--space-6) var(--space-6);
  }
  .account-manage-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
.toast-area {
  position: fixed;
  right: 72px;
  bottom: 22px;
  z-index: 140;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: min(370px,calc(100vw - 30px));
}
.toast {
  box-shadow: var(--shadow);
  padding: var(--space-5) var(--space-6);
  font-size: var(--type-sm);
  line-height: 1.4;
  animation: slide-up .18s ease;
}
.toast strong {
  display: block;
  margin-bottom: var(--space-1);
}
@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media(max-width:1130px) {
  .topbar {
    gap: var(--space-3);
  }
}
@media(max-width:900px) {
  .right-drawer {
    position: absolute;
    top: 0;
    bottom: 0;
  }
  .right-drawer.hidden {
    display: none;
  }
}
@media(max-width:580px) {
  .left-rail {
    padding-left: var(--space-1);
    padding-right: var(--space-1);
  }
  .toast-area {
    right: 10px;
    bottom: 12px;
  }
}
body {
  font-size: var(--type-md);
  font-synthesis: none;
}
.icon {
  width: 21px;
  height: 21px;
  stroke-width: 1.75;
}
.icon.small {
  width: 16px;
  height: 16px;
}
.icon.tiny {
  width: 12px;
  height: 12px;
}
.icon.large {
  width: 21px;
  height: 21px;
}
.topbar {
  padding: 0 var(--space-6);
}
.topbar-shell {
  position: relative;
  z-index: 22;
  display: flex;
  align-items: stretch;
  border-bottom: 0;
}
.topbar-shell .topbar {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  padding: 0 var(--space-4);
  border-bottom: 0;
}
.topbar-shell .topbar>* {
  flex-shrink: 0;
}
.topbar-fixed {
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 53px;
  min-width: 53px;
}
.topbar-fixed.start::after,
.topbar-fixed.end::before {
  position: absolute;
  content: "";
  width: 1px;
}
.topbar-fixed.start::after {
  right: 0;
}
.topbar-fixed.end::before {
  left: 0;
}
.topbar-scroll-btn {
  position: absolute;
  z-index: 24;
  top: 12px;
  bottom: 12px;
  width: 38px;
  padding: 0;
  border: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  color: var(--on-action);
  transition: opacity .16s ease,visibility .16s ease,background .16s ease;
  cursor: pointer;
}
.topbar-scroll-btn.left {
  left: 53px;
}
.topbar-scroll-btn.right {
  right: 53px;
}
.topbar-scroll-disc {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: transparent;
}
.topbar-scroll-btn .icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}
.topbar-shell:hover .topbar-scroll-btn.can-scroll,
.topbar-shell:focus-within .topbar-scroll-btn.can-scroll {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.topbar-scroll-btn:focus-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  outline: 2px solid var(--focus-ring);
  outline-offset: -3px;
}
@media(max-width:580px) {
  .topbar-fixed {
    flex-basis: 44px;
    min-width: 44px;
  }
  .topbar-scroll-btn.left {
    left: 44px;
  }
  .topbar-scroll-btn.right {
    right: 44px;
  }
  .topbar-scroll-btn {
    width: 34px;
  }
}
@media(prefers-reduced-motion:reduce) {
  .topbar-scroll-btn,
.topbar-scroll-disc {
    transition: none;
  }
}
.brand-mark .icon {
  width: 24px;
  height: 24px;
}
.toolbtn {
  width: 33px;
  height: 36px;
  min-width: 33px;
  border: 0;
  transition: background .12s;
}
.toolbtn.active {
  border: 0;
}
.toolbtn.text {
  min-width: 53px;
  font-size: var(--type-md);
  font-weight: 500;
  padding: 0 var(--space-3);
}
.toolbtn.symbol {
  border: 0;
  min-width: 0;
  font-size: var(--type-lg);
  font-weight: 600;
  gap: var(--space-2);
  padding: 0;
  justify-content: center;
}
.toolbtn.chart-type {
  width: 45px;
  min-width: 45px;
  gap: var(--space-1);
}
.player-group .toolbtn.text {
  width: auto;
}
.player-group .toolbar-line {
  height: 23px;
  margin: 0 var(--space-1);
}
.topbar [data-menu=indicators] {
  min-width: 33px;
  font-size: var(--type-lg);
  font-style: italic;
  font-weight: 600;
}
.left-rail {
  flex-basis: 54px;
}
.right-rail {
  padding: var(--space-6) var(--space-3);
}
.rail-btn {
  width: 40px;
  height: 40px;
  border: 0;
}
.right-rail .rail-btn,
.rail-btn.active {
  border: 0;
}
.rail-btn .icon {
  width: 21px;
  height: 21px;
}
.field-label {
  font-size: var(--type-sm);
  font-weight: 600;
  margin: var(--space-5) 0 var(--space-4);
}
.field-label a,
.muted-link {
  text-decoration: underline;
  font-weight: 500;
  font-size: var(--type-sm);
}
.hint {
  font-size: var(--type-sm);
  line-height: 1.5;
}
.select-field,
.input {
  padding: var(--space-4) var(--space-4);
  font-size: var(--type-sm);
}
.order-tabs button.active {
  border-bottom: 2px solid var(--text-primary);
}
.metrics {
  gap: var(--space-4);
  padding: var(--space-5) var(--space-4);
}
.metric small {
  font-size: var(--type-xs);
}
.metric strong {
  font-size: var(--type-sm);
}
.btn-primary {
  min-height: var(--control-primary);
}
.switch {
  width: 39px;
  height: 23px;
  border-radius: var(--radius-sm);
}
.switch:after {
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border: 1px solid var(--border);
  box-shadow: none;
}
.switch.on:after {
  transform: translateX(16px);
}
.quick-quiz {
  overflow: hidden;
}
.quick-summary {
  color: var(--text-primary);
  font-size: var(--type-md);
  font-weight: 400;
  line-height: 1.45;
}
.quick-summary-line {
  margin: 0;
  padding: 0;
  overflow-wrap: anywhere;
  font-weight: 400;
}
.quick-summary-confirmation {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--positive) !important;
}
.quick-quiz-top {
  position: relative;
}
.quick-quiz-body {
  min-width: 0;
}
.quick-quiz-viewport {
  position: relative;
  overflow: hidden;
  transition: height .28s cubic-bezier(.2,.7,.2,1);
}
.quick-quiz-viewport>.quick-quiz-body {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  transition: transform .28s cubic-bezier(.2,.7,.2,1),opacity .28s ease;
  will-change: transform;
}
.quick-quiz-viewport>.quick-quiz-body.entering {
  opacity: .65;
}
.quick-quiz .mini-foot {
  min-height: 26px;
}
.quick-quiz .mini-foot button {
  min-width: 52px;
  text-align: left;
}
.quick-quiz .mini-foot button:last-child {
  text-align: right;
}
.settings-quiz-pills {flex-wrap: wrap;}
.settings-quiz-pills button {flex: 1 1 calc(25% - var(--space-2));}
.settings-quiz-textarea {width: 100%;max-height: 140px;resize: vertical;}
@media(prefers-reduced-motion:reduce) {
  .quick-quiz-viewport,
.quick-quiz-viewport>.quick-quiz-body {
    transition: none!important;
  }
}
.micro-head {
  font-size: var(--type-xs);
}
.micro-progress {
  height: 3px;
  margin: var(--space-4) 0 var(--space-4);
}
.choice-list {
  border-color: var(--border);
}
.pill {
  font-size: var(--type-xs);
}
.summary-box {
  font-size: var(--type-sm);
  padding: var(--space-5);
}
.summary-box strong {
  font-size: var(--type-md);
}
.menu-title {
  font-size: var(--type-base);
  font-weight: 600;
}
.menu-opt {
  font-size: var(--type-sm);
}
.left-menu {
  width: 345px;
  padding: var(--space-7) var(--space-7) var(--space-6);
}
.left-menu .menu-heading {
  font-size: var(--type-heading);
  font-weight: 600;
  margin: 0 0 var(--space-6);
}
.left-menu .menu-group-title {
  font-size: var(--type-xs);
  font-weight: 600;
  letter-spacing: .12em;
  margin: var(--space-6) 0 var(--space-4);
}
.left-menu .nav-item {
  height: 49px;
  font-size: var(--type-lg);
  padding: 0 var(--space-5);
  gap: var(--space-5);
}
.left-menu .avatar {
  height: 38px;
  width: 38px;
  font-size: var(--type-md);
}
.trade-pills {
  display: flex;
  gap: var(--space-2);
  flex-wrap: nowrap;
  margin: var(--space-3) 0 var(--space-5);
}
.trade-pills button {
  padding: var(--space-3) var(--space-3);
  flex: 1;
  font-size: var(--type-xs);
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}
.trade-pills button .icon {
  width: 11px;
  height: 11px;
}
.trade-pills button.active {
  font-weight: 600;
}
.trade-order-kind {
  font-size: var(--type-sm);
  font-weight: 600;
  margin: 0 0 var(--space-3);
}
.trade-order-field {
  min-width: 0;
}
.trade-order-label {
  font-weight: 500;
}
.trade-order-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}
.trade-order-value input {
  width: 100%;
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.trade-order-value input:disabled {
  opacity: .65;
}
.trade-order-unit {
  flex: none;
  white-space: nowrap;
}
.trade-order-unit.selector {
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.trade-order-unit .icon {
  width: 11px;
  height: 11px;
}
.position-size {
  margin: 0;
}
.position-slider {
  display: block;
  width: calc(100% - 16px);
  height: 2px;
  margin: var(--space-6) var(--space-4) var(--space-3);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.position-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}
.position-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}
.position-slider-labels {
  display: flex;
  justify-content: space-between;
  gap: var(--space-1);
  font-variant-numeric: tabular-nums;
}
.position-result {
  display: grid;
  border: 0;
  border-radius: 0;
  background: transparent;
  margin-top: var(--space-2);
  min-height: 52px;
  font-size: var(--type-sm);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.position-result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  min-width: 0;
}
.position-result-row span {
  white-space: nowrap;
}
.position-result-row strong {
  text-align: right;
  white-space: nowrap;
}
.position-mode-note {
  font-size: var(--type-xs);
  line-height: 1.4;
  margin: var(--space-2) 0 var(--space-1);
}
.exit-stack {
  display: grid;
}
.exit-line {
  display: grid;
  align-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  min-width: 0;
}
.exit-line.off {
  opacity: .55;
}
.exit-toggle {
  flex: none;
  width: 22px;
  height: 13px;
  border: 0;
  border-radius: var(--radius-sm);
  position: relative;
  padding: 0;
}
.exit-toggle:after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.exit-toggle.on:after {
  left: 11px;
}
.exit-label {
  font-weight: 600;
}
.exit-combo {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--border);
  overflow: hidden;
}
.exit-combo:focus-within {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 1px var(--focus-ring);
}
.exit-combo input {
  width: 100%;
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0 var(--space-3);
  border: 0;
  outline: 0;
  background: transparent;
  font-variant-numeric: tabular-nums;
}
.exit-combo input:focus-visible {
  outline: 0;
  box-shadow: none;
}
.exit-combo input:disabled {
  opacity: .55;
}
.exit-combo-summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 var(--space-3);
  font-size: var(--type-xs);
}
.exit-combo-mode {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-width: 52px;
  height: 100%;
  padding: 0 var(--space-2);
  border: 0;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}
.exit-action-placeholder {
  width: 40px;
  height: var(--control-standard);
}
.exit-add-mini {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: var(--control-standard);
  border: 1px solid var(--border);
  font-size: var(--type-xs);
  font-weight: 600;
  white-space: nowrap;
  padding: 0;
}
.exit-partials {
  border-left: 1px solid var(--border);
  margin: calc(-1 * var(--space-1)) 0 0 var(--space-5);
  padding: var(--space-1) 0 var(--space-1) var(--space-4);
  display: grid;
  gap: var(--space-2);
}
.exit-partial-line {
  display: grid;
  grid-template-columns: 25px minmax(0,1fr) 54px var(--control-small);
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-small);
  font-size: var(--type-xs);
  min-width: 0;
}
.exit-partial-line input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  padding: var(--space-3) var(--space-2);
  font-size: var(--type-sm);
  font-variant-numeric: tabular-nums;
}
.exit-partial-line button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--type-lg);
  padding: 0;
}
.exit-partial-line button:not(.share) {
  width: var(--control-small);
  height: var(--control-small);
  display: grid;
  place-items: center;
}
.exit-partial-line button.share {
  width: 100%;
  min-height: var(--control-small);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 0 var(--space-1);
  border: 1px solid var(--border);
  font-size: var(--type-xs);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.exit-partial-line button.share .icon {
  width: 10px;
  height: 10px;
}
.exit-partial-line input:focus-visible {
  border-color: var(--focus-ring);
  outline: 0;
  box-shadow: 0 0 0 1px var(--focus-ring);
}
.trade-estimate-group {
  margin: 0;
}
.trade-metrics {
  display: grid;
  grid-template-columns: 1fr 1.13fr .7fr;
  background: transparent;
  border-radius: 0;
  margin: 0;
}
.trade-estimate-group .trade-metrics {
  margin-top: 0;
}
.tp-share-menu {
  padding: var(--space-5);
}
.tp-share-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  margin-bottom: var(--space-7);
  font-size: var(--type-sm);
  font-weight: 650;
}
.tp-share-head strong {
  font-size: var(--type-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tp-share-slider:disabled {
  cursor: not-allowed;
  opacity: .55;
}
.tp-share-note {
  margin: var(--space-5) 0 0;
  color: var(--text-muted);
  font-size: var(--type-xs);
  line-height: 1.5;
}
.exit-partial-line button.share.no-volume {
  color: var(--text-muted);
}
.trade-metrics .trade-metric {
  min-width: 0;
  text-align: left;
  font-size: var(--type-xs);
}
.trade-metrics .trade-metric:last-child {
  text-align: right;
}
.trade-metrics .trade-metric span {
  display: block;
  margin-bottom: var(--space-2);
  white-space: nowrap;
}
.trade-metrics .trade-metric strong {
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.position-info {
  margin: var(--space-3) 0 var(--space-5);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}
.position-info summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  list-style: none;
  cursor: pointer;
  font-weight: 600;
}
.position-info summary::-webkit-details-marker {
  display: none;
}
.position-info .direction {
  margin-left: auto;
  font-size: var(--type-xs);
  font-weight: 600;
  white-space: nowrap;
}
.position-info .disclosure-label {
  margin-left: auto;
  font-size: var(--type-xs);
  font-weight: 500;
  white-space: nowrap;
}
.position-info .disclosure-label .expanded,
.position-info[open] .disclosure-label .collapsed {
  display: none;
}
.position-info[open] .disclosure-label .expanded {
  display: inline;
}
.position-info .chevron {
  width: 11px;
  height: 11px;
  transition: transform .15s;
}
.position-info[open] .chevron {
  transform: rotate(180deg);
}
.position-info-body {
  border-top: 0;
  padding: 0 0 var(--space-5);
  display: grid;
  gap: var(--space-4);
}
.position-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--type-xs);
  line-height: 1.4;
}
.position-info-row strong {
  font-size: var(--type-xs);
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.trade-action-row {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: var(--space-4);
}
.trade-action-row button {
  min-width: 0;
  width: 100%;
  color: var(--on-action);
  border: 0;
}
.trade-action-row button:hover {
  filter: brightness(.94);
}
@media(max-width:580px) {
  .topbar {
    padding: 0 var(--space-4);
  }
  .left-menu {
    width: min(345px,calc(100vw - 16px));
  }
}
:root {
  color-scheme: light;
  --app-canvas: #F7F7F5;
  --chart-canvas: #FFFFFF;
  --surface: #FFFFFF;
  --surface-subtle: #F3F4F2;
  --surface-hover: #ECEFEC;
  --surface-pressed: #E4E9E5;
  --input-surface: #FFFFFF;
  --text-primary: #181A1C;
  --text-secondary: #626A70;
  --text-muted: #758087;
  --border: #D4DAD8;
  --border-subtle: color-mix(in srgb,var(--border) 40%,var(--surface));
  --border-strong: #B9C1BE;
  --chart-grid: #E5E9E7;
  --chart-axis: #525B61;
  --chart-line: #315E59;
  --chart-warm: #BD923B;
  --chart-vwap: #7D799C;
  --accent: #315E59;
  --accent-subtle: #E6F0EC;
  --accent-press: #315E59;
  --focus-ring: #315E59;
  --positive: #16836F;
  --negative: #B84953;
  --warning: #9A7130;
  --draft-ink: #687C9C;
  --action-long: #15745F;
  --action-short: #A7434D;
  --on-action: #FFFFFF;
  --note-border: #9AA6A1;
  --note-text: #242A29;
  --overlay-backdrop: rgba(16,19,20,.34);
  --tooltip-bg: #202624;
  --tooltip-text: #FFFFFF;
  --bg: var(--app-canvas);
  --soft: var(--surface-subtle);
  --hover: var(--surface-hover);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --text: var(--text-primary);
  --sub: var(--text-secondary);
  --muted: var(--text-muted);
  --blue: var(--accent);
  --blue-soft: var(--accent-subtle);
  --green: var(--positive);
  --red: var(--negative);
  --shadow: 0 5px 16px rgba(15,28,25,.10);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --app-canvas: #121517;
  --chart-canvas: #15191C;
  --surface: #1A1E21;
  --surface-subtle: #22272B;
  --surface-hover: #292F33;
  --surface-pressed: #323A3E;
  --input-surface: #202529;
  --text-primary: #ECEFEE;
  --text-secondary: #B3BDC1;
  --text-muted: #98A3A8;
  --border: #353C41;
  --border-strong: #4B565C;
  --chart-grid: #2E3539;
  --chart-axis: #BBC4C8;
  --chart-line: #7DB8AA;
  --chart-warm: #D0A253;
  --chart-vwap: #A5A0C8;
  --accent: #7DB8AA;
  --accent-subtle: #263B39;
  --accent-press: #3D776C;
  --focus-ring: #A4D9CE;
  --positive: #4AB498;
  --negative: #D86B76;
  --warning: #D0A154;
  --draft-ink: #9AADD0;
  --action-long: #256D59;
  --action-short: #953A45;
  --on-action: #FFFFFF;
  --note-border: #626E70;
  --note-text: #E2E8E6;
  --overlay-backdrop: rgba(0,0,0,.58);
  --tooltip-bg: #DDE3DF;
  --tooltip-text: #171B1D;
  --shadow: 0 5px 18px rgba(0,0,0,.30);
}
body {
  color: var(--text-primary);
  background: var(--app-canvas);
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 0;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 1px var(--focus-ring);
}
input[type="range"]:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: none;
}
input,
textarea {
  accent-color: var(--accent);
}
button:disabled {
  opacity: .5;
}
.topbar-shell {
  background: var(--surface);
}
.topbar,
.topbar-shell .topbar {
  background: var(--surface);
  color: var(--text-primary);
  scrollbar-color: var(--border-strong) transparent;
}
.topbar-fixed {
  background: var(--surface);
}
.topbar-fixed.start::after,
.topbar-fixed.end::before,
.toolbar-line {
  background: var(--border);
}
.brand-mark {
  width: 35px;
  height: 35px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  box-shadow: none;
}
.toolbtn,
.toolbtn.text,
.toolbtn.symbol,
.toolbtn.symbol .icon,
.player-group .toolbtn {
  color: var(--text-primary);
}
.toolbtn,
.toolbtn.symbol,
.rail-btn,
.right-rail .rail-btn {
  border-radius: var(--radius-sm);
}
.toolbtn:hover,
.rail-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.toolbtn.active,
.rail-btn.active {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: transparent;
}
.toolbtn.symbol {
  height: 36px;
}
.player-group {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.player-group .play-main {
  border-radius: var(--radius-sm);
  color: var(--on-action);
  background: var(--accent-press);
  box-shadow: none;
}
.player-group .play-main:hover {
  background: var(--accent);
  color: var(--chart-canvas);
}
.topbar-scroll-btn {
  border-radius: 0;
  backdrop-filter: none;
}
.topbar-scroll-btn.left {
  background: linear-gradient(90deg,rgba(35,48,45,.76),rgba(35,48,45,.20));
}
.topbar-scroll-btn.right {
  background: linear-gradient(270deg,rgba(35,48,45,.76),rgba(35,48,45,.20));
}
.topbar-scroll-btn.left:hover {
  background: linear-gradient(90deg,rgba(35,48,45,.90),rgba(35,48,45,.30));
}
.topbar-scroll-btn.right:hover {
  background: linear-gradient(270deg,rgba(35,48,45,.90),rgba(35,48,45,.30));
}
.left-menu {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.menu-backdrop {
  background: var(--overlay-backdrop);
}
.left-menu .menu-heading,
.left-menu .nav-item {
  color: var(--text-primary);
}
.left-menu .menu-group-title {
  color: var(--text-muted);
}
.left-menu .nav-item {
  background: transparent;
  border-radius: var(--radius-sm);
}
.left-menu .nav-item:hover {
  background: var(--surface-hover);
}
.left-menu .nav-item.active {
  background: var(--accent-subtle);
  color: var(--accent);
}
.left-menu .menu-account {
  border-color: var(--border);
}
.left-menu .avatar {
  background: var(--surface-subtle);
  color: var(--text-primary);
}
.workspace,
.left-rail,
.right-rail,
.right-drawer {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: none;
}
.drawer-header,
.drawer-footer {
  background: var(--surface);
  box-shadow: none;
}
.left-rail {
  padding-top: var(--space-4);
}
.right-rail {
  padding-top: var(--space-4);
  gap: var(--space-2);
}
.rail-btn,
.right-rail .rail-btn {
  color: var(--text-secondary);
}
.rail-sep {
  background: var(--border);
}
.drawer-header h2 {
  color: var(--text-primary);
}
.drawer-header,
.drawer-footer {
  border-color: var(--border);
}
.drawer-body {
  scrollbar-color: var(--border-strong) transparent;
}
.chart-pane,
.charts,
.chart-tile {
  background: var(--chart-canvas);
  border-color: var(--border);
}
.chart-tile {
  background-image: none;
}
.chart-tile-head strong {
  color: var(--text-primary);
}
.chart-tile-head {
  color: var(--text-muted);
}
.chart-row-handle:after {
  background: var(--border-strong);
  border-radius: var(--radius-xs);
}
.field-label {
  color: var(--text-secondary);
}
.position-mode-note {
  color: var(--text-secondary);
}
.field-label a,
.muted-link {
  color: var(--accent);
}
.fine,
.hint,
.position-slider-labels,
.trade-metrics .trade-metric span {
  color: var(--text-muted);
}
.rule,
.account-muted-rule {
  background: var(--border);
}
.account-card,
.position-info,
.trade-metrics {
  border-color: var(--border);
}
.order-tabs {
  border-bottom-color: var(--border);
}
.order-tabs button {
  color: var(--text-secondary);
}
.order-tabs button.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.select-field,
.input,
.trade-order-field {
  background: var(--input-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}
.select-field:hover,
.trade-order-unit.selector:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.input:focus,
.account-field:focus {
  background: var(--input-surface);
  border-color: var(--focus-ring);
}
.trade-order-label,
.trade-order-unit,
.trade-order-kind {
  color: var(--text-muted);
}
.trade-order-value input {
  color: var(--text-primary);
}
.trade-order-unit.selector,
.exit-combo-mode {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-secondary);
}
.position-slider {
  border-radius: var(--radius-xs);
  background: linear-gradient(to right,color-mix(in srgb,var(--accent) 62%,var(--border)) 0%,color-mix(in srgb,var(--accent) 62%,var(--border)) var(--filled),var(--border-subtle) var(--filled),var(--border-subtle) 100%);
}
.position-slider::-webkit-slider-thumb,
.position-slider::-moz-range-thumb {
  background: var(--accent);
  border: 2px solid var(--chart-canvas);
}
.position-result-row span {
  color: var(--text-secondary);
}
.position-result-row strong {
  color: var(--text-primary);
}
.trade-metrics {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.trade-metrics .negative,
.negative,
.red {
  color: var(--negative);
}
.trade-metrics .positive,
.positive {
  color: var(--positive);
}
.position-info summary,
.position-info-row {
  color: var(--text-secondary);
}
.position-info-row strong {
  color: var(--text-primary);
}
.position-info .direction {
  color: var(--positive);
}
.position-info .direction.short {
  color: var(--negative);
}
.position-info .disclosure-label,
.position-info .chevron,
.exit-label,
.exit-combo-summary,
.exit-partial-line {
  color: var(--text-secondary);
}
.exit-combo,
.exit-add-mini,
.exit-partial-line input,
.exit-partial-line button.share {
  background: var(--input-surface);
  border-color: var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}
.exit-combo-mode {
  background: transparent;
  border-radius: 0;
  color: var(--text-secondary);
}
.exit-combo input {
  color: var(--text-primary);
}
.exit-combo-mode:hover,
.exit-add-mini:hover,
.exit-partial-line button.share:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.exit-partials {
  border-left-color: var(--border);
}
.exit-toggle {
  background: var(--border-strong);
}
.exit-toggle.on {
  background: var(--accent);
}
.exit-toggle:after {
  background: var(--surface);
}
.trade-action-row button {
  border-radius: var(--radius-sm);
}
.trade-action-row .open-long {
  background: var(--action-long);
  color: var(--on-action);
  border-color: var(--action-long);
}
.trade-action-row .open-short {
  background: var(--action-short);
  color: var(--on-action);
  border-color: var(--action-short);
}
.btn-primary {
  background: var(--accent-press);
  border-color: var(--accent-press);
  border-radius: var(--radius-sm);
  color: var(--on-action);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--chart-canvas);
}
.btn-light,
.ghost-btn,
.trade-pills button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.btn-light:hover,
.ghost-btn:hover,
.trade-pills button:hover {
  background: var(--surface-hover);
}
.ghost-btn.active,
.btn-light.active,
.trade-pills button.active {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}
.metrics {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text-secondary);
}
.summary-box {
  background: transparent;
  border: 0;
  border-radius: 0;
}
.metric small {
  color: var(--text-secondary);
}
.metrics .metric:last-child {
  border-color: var(--border);
}
.micro-card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: var(--space-5) 0;
  margin-top: var(--space-5);
}
.micro-progress {
  background: var(--border);
  border-radius: 0;
}
.micro-progress span {
  background: var(--accent);
}
.micro-head,
.mini-foot,
.summary-box {
  color: var(--text-secondary);
}
.micro-head strong,
.micro-question {
  color: var(--text-primary);
}
.choice-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.choice-list button {
  background: var(--surface);
  color: var(--text-secondary);
  border-color: var(--border);
}
.choice-list button:hover {
  background: var(--surface-hover);
}
.choice-list button.chosen {
  background: var(--accent-subtle);
  color: var(--accent);
}
.choice-list .circle-mark {
  color: var(--text-muted);
}
.mini-foot button {
  color: var(--accent);
}
.pill {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}
.switch,
.replay-toggle .switch {
  background: var(--border-strong);
}
.switch.on,
.replay-toggle[aria-checked="true"] .switch {
  background: var(--accent-press);
}
.switch:after,
.replay-toggle .switch:after {
  background: var(--surface);
}
.popover {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  color: var(--text-primary);
}
.menu-title {
  color: var(--text-primary);
}
.menu-caption,
.menu-opt .right,
.speed-menu-head,
.speed-ticks,
.date-caption {
  color: var(--text-muted);
}
.menu-opt {
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}
.menu-opt:hover {
  background: var(--surface-hover);
}
.menu-opt.selected {
  background: var(--accent-subtle);
  color: var(--accent);
}
.menu-sep,
.chart-type-separator {
  background: var(--border);
}
.speed-menu-head strong {
  color: var(--text-primary);
}
.date-menu-label strong {
  color: var(--text-primary);
}
.speed-slider {
  border-radius: var(--radius-xs);
  background: linear-gradient(to right,var(--accent) 0%,var(--accent) var(--filled),var(--border) var(--filled),var(--border) 100%);
}
.speed-slider::-webkit-slider-thumb,
.speed-slider::-moz-range-thumb {
  background: var(--accent);
  box-shadow: none;
}
.speed-slider:focus-visible {
  outline-color: var(--focus-ring);
}
.replay-toggle {
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
}
.replay-toggle:hover,
.replay-pause-group .replay-toggle:hover {
  background: var(--surface-hover);
}
.replay-pause-group {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.replay-pause-head {
  background: var(--surface-subtle);
  border-color: var(--border);
  color: var(--text-primary);
}
.replay-pause-head .icon {
  color: var(--accent);
}
.replay-pause-group .replay-toggle+.replay-toggle {
  border-top-color: var(--border);
}
.date-menu-title,
.date-menu-label {
  color: var(--text-secondary);
}
.date-slider {
  accent-color: var(--accent);
}
.date-presets button,
.date-actions button,
.date-menu input[type="datetime-local"] {
  background: var(--input-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}
.date-presets button:hover,
.date-actions button:hover {
  background: var(--surface-hover);
}
.date-presets button.active {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}
.date-menu input[type="datetime-local"]:focus-visible {
  border-color: var(--focus-ring);
  outline: 0;
  box-shadow: 0 0 0 1px var(--focus-ring);
}
.date-actions .date-start {
  background: var(--accent-press);
  border-color: var(--accent-press);
  color: var(--on-action);
}
.layout-pick {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.layout-pick:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.layout-pick.active {
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
}
.layout-cell {
  background: var(--text-secondary);
  border-radius: var(--radius-xs);
}
.layout-reset {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}
.layout-reset:hover {
  background: var(--surface-hover);
}
.chart-type-option {
  background: var(--surface);
  color: var(--text-primary);
  border-radius: var(--radius-xs);
}
.chart-type-option:hover {
  background: var(--surface-hover);
}
.chart-type-option.selected,
.chart-type-option.selected:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}
.ui-tooltip {
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
}
.ui-tooltip::after {
  background: var(--tooltip-bg);
}
.modal-backdrop {
  background: var(--overlay-backdrop);
}
.modal {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.modal h3 {
  color: var(--text-primary);
}
.account-modal-caption,
.account-modal-section-title,
.account-field-label,
.account-confirm-details {
  color: var(--text-secondary);
}
.account-modal-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.account-modal-item.active {
  background: var(--accent-subtle);
  border-color: var(--accent);
}
.account-select-btn,
.account-select-info .account-modal-balance {
  color: var(--text-primary);
}
.account-select-btn .account-selector-dot {
  border-color: var(--border-strong);
}
.account-modal-item.active .account-selector-dot {
  border-color: var(--accent);
}
.account-modal-item.active .account-selector-dot:after {
  background: var(--accent);
}
.account-select-info small,
.account-card-rates {
  color: var(--text-muted);
}
.account-card-rates b {
  color: var(--text-secondary);
}
.account-edit-btn {
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
}
.account-edit-btn:hover {
  background: var(--surface-hover);
  color: var(--accent);
}
.account-edit-btn.save {
  background: var(--accent-subtle);
  color: var(--accent);
}
.account-edit-btn.save:hover {
  background: var(--surface-hover);
}
.account-field,
.account-rate-input {
  background: var(--input-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}
.account-rate-input:focus-within {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 1px var(--focus-ring);
}
.account-rate-input .account-field {
  background: transparent;
  border: 0;
}
.account-rate-input .account-field:focus-visible {
  outline: 0;
  box-shadow: none;
}
.account-rate-input span {
  color: var(--text-muted);
}
.account-mini-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}
.account-new-trigger {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.account-mini-btn:hover,
.account-new-trigger:hover {
  background: var(--surface-hover);
}
.account-mini-btn.primary {
  background: var(--accent-press);
  border-color: var(--accent-press);
  color: var(--on-action);
}
.account-new-trigger {
  border-style: dashed;
  color: var(--accent);
}
.account-new-form {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.account-new-form .account-field {
  background: var(--input-surface);
}
.account-text-action {
  color: var(--text-secondary);
}
.account-text-action:hover {
  color: var(--accent);
}
.account-text-action.danger:hover {
  color: var(--negative);
}
.account-warning {
  background: var(--surface-subtle);
  border: 1px solid var(--negative);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.account-warning .icon,
.account-warning > div > strong:first-child {
  color: var(--negative);
}
.account-danger-btn {
  background: var(--negative);
  border-color: var(--negative);
  color: var(--on-action);
  border-radius: var(--radius-sm);
}
.account-danger-btn:disabled {
  background: var(--surface-subtle);
  border-color: var(--border);
  color: var(--text-muted);
}
.account-danger-btn:not(:disabled):hover {
  filter: brightness(.92);
  background: var(--negative);
}
.toast {
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
@media(max-width:900px) {
  .right-drawer {
    box-shadow: -5px 0 18px rgba(0,0,0,.12);
  }
}
:root {
  --drawer-width: 350px;
  --ui-font: Arial,"Helvetica Neue",Helvetica,sans-serif;
  --numeric-font: ui-monospace,"SFMono-Regular",Menlo,Consolas,"Liberation Mono",monospace;
}
body,
button,
input,
textarea,
select {
  font-family: var(--ui-font);
}
.topbar-shell {
  height: var(--header-height);
  min-height: var(--header-height);
  flex: 0 0 var(--header-height);
}
.topbar-shell::after {
  content: "";
  position: absolute;
  z-index: 35;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border-strong);
  pointer-events: none;
}
.topbar-fixed.end {
  flex: 0 0 auto;
  min-width: 0;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: 0 var(--space-4) 0 var(--space-2);
}
.topbar-account {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  white-space: nowrap;
  color: var(--text-primary);
}
.topbar-account-picker,
.topbar-account-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-standard);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.topbar-account-picker {
  gap: var(--space-2);
  min-width: 0;
  max-width: 164px;
  padding: 0 var(--space-2);
  font-size: var(--type-base);
  font-weight: 650;
}
.topbar-account-picker .icon {
  flex: none;
  color: var(--text-secondary);
}
.topbar-account-name {
  display: block;
  min-width: 0;
  max-width: 135px;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}
.topbar-account-name.is-truncated {
  -webkit-mask-image: linear-gradient(90deg,#000 calc(100% - 17px),transparent);
  mask-image: linear-gradient(90deg,#000 calc(100% - 17px),transparent);
}
.topbar-account-eye {
  width: var(--control-small);
  flex: none;
  color: var(--text-secondary);
}
.topbar-account-picker:hover,
.topbar-account-eye:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.topbar-account-picker:focus-visible,
.topbar-account-eye:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}
.topbar-account-balance {
  flex: none;
  font-family: var(--numeric-font);
  font-size: var(--type-base);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
}
.topbar-account-separator {
  height: 32px;
  width: 1px;
  flex: none;
  margin: 0 var(--space-2);
  background: var(--border);
}
.topbar-fixed.end > .toolbtn {
  flex: none;
}
@media(max-width:760px) {
  .topbar-account-name {max-width: 80px;}
  .topbar-account-picker {max-width: 109px;}
  .topbar-fixed.end {gap: var(--space-1);padding-right: var(--space-2);}
}
@media(max-width:470px) {
  .topbar-account-name {max-width: 52px;}
  .topbar-account-picker {max-width: 83px;padding-left: 2px;padding-right: 2px;}
  .topbar-account {gap: 2px;}
  .topbar-account-eye {width: 26px;}
  .topbar-account-balance {font-size: var(--type-xs);}
  .topbar-account-separator {margin: 0 2px;}
}
.topbar,
.topbar-shell .topbar {
  height: var(--header-height);
  min-height: var(--header-height);
  padding-left: var(--space-5);
  padding-right: var(--space-5);
  gap: var(--space-5);
}
.topbar-fixed.start::after,
.topbar-fixed.end::before {
  top: 17px;
  height: 32px;
}
.topbar .toolbtn {
  height: var(--control-standard);
  min-height: var(--control-standard);
}
.topbar .toolbtn.text {
  font-size: var(--type-base);
  font-weight: 600;
}
.topbar .toolbtn.symbol {
  font-size: var(--type-heading);
  font-weight: 700;
  letter-spacing: -.01em;
}
.brand {
  gap: 0;
}
.brand-square {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 5px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--text-primary);
  color: var(--surface);
  cursor: pointer;
  flex: none;
}
.brand-square .icon {
  width: 26px;
  height: 26px;
  stroke-width: 1.7;
}
.brand-square:hover {
  background: var(--accent-press);
  color: var(--on-action);
}
.brand-square:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
.toolbar-line {
  height: 30px;
  margin: 0 var(--space-2);
}
.topgroup {
  gap: var(--space-3);
}
.player-group {
  gap: var(--space-3);
  padding: 0 var(--space-2);
}
.player-group .toolbtn {
  width: 39px;
  min-width: 39px;
  height: 41px;
}
.player-group .toolbtn.text {
  padding: 0 var(--space-4);
  min-width: 57px;
}
.player-group .play-main {
  height: 43px;
  width: 43px;
  min-width: 43px;
}
.left-menu,
.menu-backdrop {
  top: var(--header-height);
}
.left-rail {
  width: 68px;
  flex: 0 0 68px;
  padding: var(--space-6) var(--space-4);
  gap: var(--space-4);
}
.left-rail .rail-btn {
  width: 46px;
  height: 43px;
}
.right-rail {
  width: 54px;
  min-width: 54px;
}
.right-rail .rail-btn {
  width: 40px;
  height: 40px;
}
.chart-tile-head {
  font-size: var(--type-md);
  gap: var(--space-5);
}
.chart-tile-head strong {
  font-size: var(--type-base);
  font-weight: 700;
}
.drawer-header {
  height: var(--header-height);
  min-height: var(--header-height);
  padding: 0 var(--space-6);
}
.drawer-header h2 {
  font-size: var(--type-display);
  line-height: 1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .015em;
}
.drawer-header-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-2);
  min-width: 0;
}
.drawer-header .toolbtn {
  width: 30px;
  min-width: 30px;
  height: var(--control-small);
}
.drawer-body {
  padding: var(--space-6) var(--space-7) var(--space-7);
}
.drawer-footer {
  padding: var(--space-5) var(--space-7) var(--space-6);
}
.order-tabs {
  gap: var(--space-8);
  margin: var(--space-4) 0 var(--space-5);
}
.order-tabs button {
  font-size: var(--type-base);
  padding: var(--space-4) 0 var(--space-5);
}
.trade-order-field {
  height: var(--control-standard);
  min-height: var(--control-standard);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-5);
  margin: var(--space-3) 0;
  overflow: hidden;
  cursor: text;
}
.trade-order-label { cursor: text; }
.exit-combo,.exit-partial-line,.account-rate-input { cursor: text; }
.trade-order-field:has(.trade-order-unit.selector) {
  padding-right: 0;
}
.trade-order-field:focus-within {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 1px var(--focus-ring);
}
.trade-order-label {
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
  font-size: var(--type-sm);
  line-height: 1.25;
  margin: 0;
}
.trade-order-value {
  flex: 1 1 auto;
  height: 100%;
  justify-content: flex-end;
}
.trade-order-value:has(.selector) {
  gap: 0;
}
.trade-order-value input {
  height: 100%;
  text-align: right;
  font-family: var(--numeric-font);
  font-size: var(--type-lg);
  font-weight: 600;
  letter-spacing: -.025em;
}
.trade-order-value input:focus-visible {
  outline: 0;
  box-shadow: none;
}
.trade-order-value:has(.selector) input {
  padding-right: var(--space-4);
}
.trade-order-unit {
  font-size: var(--type-sm);
}
.trade-order-unit.selector {
  height: 100%;
  min-height: 0;
  padding: 0 var(--space-5);
  font-size: var(--type-sm);
}
.trade-order-unit.selector .icon,
.exit-combo-mode .icon {
  width: 12px;
  height: 12px;
}
.trade-order-unit.selector:focus-visible,
.exit-combo-mode:focus-visible {
  outline: 0;
  background: var(--accent-subtle);
  box-shadow: inset 0 -2px 0 var(--focus-ring);
}
.position-slider {
  margin-top: var(--space-7);
  margin-bottom: var(--space-4);
}
.position-slider-labels {
  font-family: var(--numeric-font);
  font-size: var(--type-sm);
  margin-bottom: var(--space-4);
}
.position-result {
  gap: var(--space-4);
  padding: var(--space-5) 0;
}
.position-result-row span {
  font-size: var(--type-sm);
}
.position-result-row strong {
  font-family: var(--numeric-font);
  font-size: var(--type-md);
  font-weight: 700;
}
.trade-metrics {
  padding: var(--space-5) 0 var(--space-6);
  gap: var(--space-4);
}
.trade-metrics .trade-metric span {
  font-size: var(--type-xs);
}
.trade-metrics .trade-metric strong {
  font-family: var(--numeric-font);
  font-size: var(--type-sm);
}
.exit-stack {
  gap: var(--space-5);
  margin: var(--space-6) 0 var(--space-6);
}
.exit-line {
  grid-template-columns: 28px 26px minmax(0,1fr) 42px;
  gap: var(--space-3);
  min-height: 38px;
}
.exit-label {
  width: 26px;
  font-size: var(--type-md);
}
.exit-combo {
  height: var(--control-standard);
}
.exit-combo input {
  font-family: var(--numeric-font);
  font-size: var(--type-sm);
}
.exit-combo-mode {
  font-size: var(--type-sm);
}
.position-info summary {
  min-height: 44px;
  font-size: var(--type-md);
}
.micro-head strong {
  font-size: var(--type-base);
  font-weight: 700;
  text-transform: uppercase;
}
.micro-question {
  font-size: var(--type-md);
  font-weight: 600;
}
.choice-list button {
  min-height: var(--control-standard);
  font-size: var(--type-md);
}
.trade-action-row button {
  min-height: var(--control-primary);
  font-size: var(--type-base);
  font-weight: 700;
}
@media(max-width:900px) {
  .right-drawer {
    right: 54px;
    width: min(var(--drawer-width),calc(100vw - 54px));
  }
}
@media(max-width:580px) {
  .left-rail {
    width: 46px;
    flex-basis: 46px;
    padding: var(--space-4) var(--space-1);
  }
  .left-rail .rail-btn {
    width: 40px;
  }
  .drawer-body {
    padding: var(--space-5) var(--space-5) var(--space-6);
  }
  .drawer-footer {
    padding: var(--space-5) var(--space-5);
  }
  .topbar-shell .topbar {
    gap: var(--space-4);
  }
}
@media(max-width:350px) {
  .trade-order-field {
    height: auto;
    min-height: var(--field-stacked);
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    padding: var(--space-2) var(--space-5);
  }
  .trade-order-value {
    height: var(--control-small);
    flex: 0 0 var(--control-small);
  }
  .trade-order-value input {
    text-align: left;
  }
}
#notesLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}
.sticky-note {
  --note-accent: var(--text-secondary);
  --note-paper: var(--surface);
  position: fixed;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 150px;
  min-height: var(--note-min-height);
  box-shadow: 0 5px 16px rgba(10,20,25,.11);
  background: var(--note-paper);
  border: 1px solid rgba(34,43,45,.13);
  border-top: 3px solid var(--note-accent);
  border-radius: var(--radius-xs);
  transform: none;
  overflow: visible;
  pointer-events: auto;
}
.sticky-note.is-active {
  outline: 2px solid var(--note-accent);
  outline-offset: 1px;
  box-shadow: 0 8px 25px rgba(10,20,25,.18);
}
.note-rich-editor {
  display: block;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overflow-wrap: anywhere;
  padding: var(--space-5);
  outline: 0;
  color: #202628;
  font-size: var(--type-sm);
  line-height: 1.45;
  white-space: pre-wrap;
  cursor: text;
}
.sticky-note:not(.is-editing) .note-rich-editor {
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.sticky-note:not(.is-editing) .note-rich-editor:active {cursor: grabbing;}
.note-rich-editor:empty::before,
.notes-inline-editor:empty::before {
  content: attr(data-placeholder);
  color: #737E7E;
  pointer-events: none;
}
.note-editor-toolbar {
  position: absolute;
  z-index: 6;
  bottom: calc(100% + var(--space-3));
  left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  align-items: center;
  width: max-content;
  max-width: min(360px,calc(100vw - 24px));
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.sticky-note.is-active .note-editor-toolbar {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.sticky-note.toolbar-align-right .note-editor-toolbar {left: auto;right: 0;}
.sticky-note.toolbar-below .note-editor-toolbar {top: calc(100% + var(--space-3));bottom: auto;}
.note-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  height: 30px;
  min-width: 29px;
  padding: 0 var(--space-2);
  color: var(--text-secondary);
  font-size: var(--type-sm);
  line-height: 1;
  background: transparent;
  border: 0;
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.note-toolbar-btn:hover,
.note-toolbar-btn:focus-visible {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.note-toolbar-btn:focus-visible {outline: 2px solid var(--accent);outline-offset: -2px;}
.note-drag-handle {
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.note-drag-handle:active {cursor: grabbing;}
.note-toolbar-separator {width: 1px;height: 19px;background: var(--border);margin: 0 var(--space-1);}
.note-paper-swatch {
  width: 16px;
  height: 16px;
  background: var(--note-accent);
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 50%;
}
.note-text-color {font-weight: 700;text-decoration: underline;text-decoration-color: var(--accent);text-decoration-thickness: 2px;text-underline-offset: 3px;}
.note-danger-action:hover {color: var(--negative);}
.note-toolbar-popover {
  position: absolute;
  z-index: 9;
  top: calc(100% + var(--space-2));
  left: 0;
  width: 236px;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
}
.sticky-note.toolbar-align-right .note-toolbar-popover {left: auto;right: 0;}
.note-toolbar-popover strong {display: block;margin-bottom: var(--space-4);font-size: var(--type-sm);color: var(--text-primary);}
.note-swatch-grid {display: grid;grid-template-columns: repeat(6,1fr);gap: var(--space-3);}
.note-swatch {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  padding: var(--space-1);
  cursor: pointer;
}
.note-swatch:hover,
.note-swatch.active,
.note-swatch:focus-visible {
  border-color: var(--accent);
  background: var(--accent-subtle);
}
.note-swatch > span {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(0,0,0,.12);
}
.note-size-popover {display: grid;grid-template-columns: repeat(4,1fr);gap: var(--space-2);width: 224px;}
.note-size-popover button {padding: var(--space-3) 0;border: 0;background: transparent;color: var(--text-primary);border-radius: var(--radius-xs);cursor: pointer;font-size: var(--type-xs);}
.note-size-popover button:hover {background: var(--accent-subtle);}
.note-resize-handle {
  position: absolute;
  z-index: 3;
  background: transparent;
  touch-action: none;
}
.note-resize-handle.right {
  width: 9px;
  right: -5px;
  top: 10px;
  bottom: 10px;
  cursor: ew-resize;
}
.note-resize-handle.bottom {
  height: 9px;
  left: 10px;
  right: 14px;
  bottom: -5px;
  cursor: ns-resize;
}
.note-resize-handle.corner {
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
}
.note-resize-handle.corner::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 9px;
  height: 9px;
  border-bottom: 2px solid var(--text-muted);
  border-right: 2px solid var(--text-muted);
  opacity: .55;
}
.sticky-note:hover .note-resize-handle.corner::after,
.sticky-note:focus-within .note-resize-handle.corner::after {
  opacity: 1;
}

/* The same action/field treatments are shared across all sticker rows. */
.notes-panel {padding-top: var(--space-5);}
.notes-panel-top {display: flex;align-items: center;justify-content: space-between;gap: var(--space-4);padding-bottom: var(--space-5);border-bottom: 1px solid var(--border);}
.notes-panel-filters {display: inline-flex;align-items: center;gap: var(--space-1);min-width: 0;}
.notes-panel-filters button {border: 0;border-radius: var(--radius-xs);padding: var(--space-3) var(--space-4);background: transparent;color: var(--text-secondary);font-size: var(--type-sm);cursor: pointer;white-space: nowrap;}
.notes-panel-filters button.active {background: var(--accent-subtle);color: var(--accent);font-weight: 600;}
.notes-add-btn {display: inline-flex;align-items: center;gap: var(--space-2);padding: var(--space-3) var(--space-4);border: 1px solid var(--border-strong);border-radius: var(--radius-xs);color: var(--accent);background: transparent;font-size: var(--type-sm);font-weight: 600;white-space: nowrap;cursor: pointer;}
.notes-add-btn:hover {background: var(--accent-subtle);}
.notes-list {display: grid;}
.notes-item {padding: var(--space-5) 0;border-bottom: 1px solid var(--border);}
.notes-item-heading {display: flex;align-items: center;gap: var(--space-2);min-width: 0;}
.notes-item-title {min-width: 0;overflow-wrap: anywhere;font-size: var(--type-sm);color: var(--text-primary);font-weight: 600;}
.notes-item-icon {display: grid;place-items: center;flex: none;width: 24px;height: 24px;padding: 0;border: 0;background: transparent;border-radius: var(--radius-xs);color: var(--text-secondary);cursor: pointer;}
.notes-item-icon:hover {background: var(--surface-hover);color: var(--accent);}
.notes-hidden-status {margin-left: auto;color: var(--text-muted);font-size: var(--type-xs);white-space: nowrap;}
.notes-item-preview {margin: var(--space-2) 0 var(--space-3);font-size: var(--type-sm);line-height: 1.45;white-space: pre-wrap;color: var(--text-secondary);overflow-wrap: anywhere;}
.notes-item-actions {display: flex;align-items: center;gap: var(--space-5);}
.notes-item-actions button {display: inline-flex;align-items: center;gap: var(--space-1);padding: var(--space-2) 0;border: 0;background: transparent;font-size: var(--type-xs);font-weight: 600;color: var(--accent);cursor: pointer;}
.notes-item-actions button:hover {text-decoration: underline;}
.notes-item-actions button.danger {color: var(--negative);}
.notes-title-input {min-width: 0;width: 100%;height: 32px;border: 1px solid var(--border-strong);border-radius: var(--radius-xs);padding: var(--space-2) var(--space-3);background: var(--surface);color: var(--text-primary);font-size: var(--type-sm);}
.notes-edit-block {position: relative;margin: var(--space-3) 0;}
.notes-inline-toolbar {position: relative;top: auto;bottom: auto;left: auto;right: auto;z-index: 7;visibility: visible;opacity: 1;pointer-events: auto;width: 100%;max-width: none;border-radius: var(--radius-xs) var(--radius-xs) 0 0;border-bottom: 0;box-shadow: none;}
.notes-inline-toolbar .note-toolbar-popover {top: calc(100% + var(--space-1));left: 0;right: auto;}
.notes-inline-editor {min-height: 80px;max-height: 210px;overflow: auto;padding: var(--space-4);margin: 0;border: 1px solid var(--border-strong);border-radius: 0 0 var(--radius-xs) var(--radius-xs);background: var(--surface);color: var(--text-primary);font-size: var(--type-sm);line-height: 1.45;white-space: pre-wrap;outline-color: var(--accent);}
.notes-empty {padding: var(--space-8) var(--space-2);font-size: var(--type-sm);color: var(--text-secondary);}
.note-delete-modal {max-width: 410px;}
.note-delete-modal h3 {margin-bottom: var(--space-4);font-size: var(--type-lg);}
.note-delete-modal p {margin: 0;color: var(--text-secondary);font-size: var(--type-sm);line-height: 1.5;}
.note-delete-actions {display: flex;justify-content: flex-end;gap: var(--space-4);margin-top: var(--space-7);}
.note-delete-confirm {padding: var(--space-4) var(--space-5);border: 1px solid var(--negative);border-radius: var(--radius-xs);background: var(--negative);color: #fff;font-size: var(--type-sm);font-weight: 600;cursor: pointer;}
.note-delete-confirm:hover {filter: brightness(.94);}
@media(max-width:400px) {
  .notes-panel-top {flex-wrap: wrap;}
  .notes-panel-filters {flex: 1;}
}

/* Unified settings — one editor for accounts, entry data and journal. */
.modal.settings-modal {
  display: flex;
  flex-direction: column;
  width: min(850px,100%);
  height: min(720px,calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  gap: var(--space-5);
  min-height: 72px;
  padding: var(--space-5) var(--space-7);
  border-bottom: 1px solid var(--border);
}
.settings-header h2 {margin: 0;font-size: var(--type-heading);font-weight: 700;}
.settings-header p {margin: var(--space-2) 0 0;font-size: var(--type-xs);color: var(--text-muted);}
.settings-layout {display: grid;grid-template-columns: 194px minmax(0,1fr);flex: 1;min-height: 0;}
.settings-sidebar {display: flex;flex-direction: column;gap: var(--space-1);padding: var(--space-5) var(--space-4);background: var(--surface-subtle);border-right: 1px solid var(--border);}
.settings-nav-item {display: flex;align-items: center;gap: var(--space-4);min-height: var(--control-standard);padding: 0 var(--space-4);background: transparent;border: 1px solid transparent;border-radius: var(--radius-sm);color: var(--text-secondary);font-size: var(--type-sm);font-weight: 600;text-align: left;white-space: nowrap;}
.settings-nav-item .icon {width: 16px;height: 16px;}
.settings-nav-item:hover {background: var(--surface-hover);color: var(--text-primary);}
.settings-nav-item.active {color: var(--accent);background: var(--accent-subtle);border-color: var(--border);}
.settings-pane {min-width: 0;overflow: auto;overscroll-behavior: contain;padding: var(--space-7);scrollbar-width: thin;}
.settings-pane-heading {margin-bottom: var(--space-6);}
.settings-pane-heading h3 {margin: 0;color: var(--text-primary);font-size: var(--type-heading);font-weight: 700;}
.settings-pane-heading p {margin: var(--space-3) 0 0;color: var(--text-muted);font-size: var(--type-sm);line-height: 1.55;}
.settings-diary-tabs {display: flex;gap: var(--space-5);margin-bottom: var(--space-6);border-bottom: 1px solid var(--border);overflow-x: auto;scrollbar-width: none;}
.settings-diary-tabs button {flex: none;min-height: var(--control-standard);padding: 0 var(--space-2);border: 0;border-bottom: 2px solid transparent;background: transparent;color: var(--text-secondary);font-size: var(--type-sm);font-weight: 600;white-space: nowrap;}
.settings-diary-tabs button:hover {color: var(--text-primary);}
.settings-diary-tabs button.active {color: var(--accent);border-bottom-color: var(--accent);}
.settings-diary-list-note {margin: 0 0 var(--space-5);color: var(--text-muted);font-size: var(--type-xs);line-height: 1.5;}
.settings-journal-behavior {padding-bottom: var(--space-6);}
.settings-journal-section {padding: 0 0 var(--space-7);margin-bottom: var(--space-7);border-bottom: 1px solid var(--border);}
.settings-journal-section h4 {margin: 0 0 var(--space-5);font-size: var(--type-base);font-weight: 700;line-height: 1.4;color: var(--text-primary);}
.settings-journal-quick-fields {margin-top: var(--space-5);}
.settings-journal-quick-fields p {margin: 0 0 var(--space-3);color: var(--text-muted);font-size: var(--type-xs);line-height: 1.5;}
.settings-journal-fields {border: 1px solid var(--border);border-radius: var(--radius-sm);overflow: hidden;}
.settings-journal-field {display: flex;align-items: center;justify-content: space-between;gap: var(--space-4);min-height: var(--control-standard);padding: var(--space-3) var(--space-4);cursor: pointer;}
.settings-journal-field+.settings-journal-field {border-top: 1px solid var(--border);}
.settings-journal-field:hover {background: var(--surface-hover);}
.settings-journal-field>span {display: grid;gap: var(--space-1);min-width: 0;}
.settings-journal-field strong {font-size: var(--type-sm);font-weight: 600;color: var(--text-primary);}
.settings-journal-field small {font-size: var(--type-xs);color: var(--text-muted);line-height: 1.4;}
.settings-journal-field input {width: 18px;height: 18px;flex: none;margin: 0;accent-color: var(--accent);cursor: pointer;}
.settings-journal-prompt {display: grid;justify-items: start;gap: var(--space-3);}
.settings-journal-prompt h4 {margin-bottom: var(--space-2);}
.settings-journal-prompt .settings-journal-label {font-size: var(--type-sm);font-weight: 600;color: var(--text-secondary);}
.settings-journal-prompt .select-field {max-width: 100%;width: min(100%,440px);}
.settings-pane .account-modal-body {padding: 0 0 var(--space-4);}
.settings-pane .account-edit-grid {gap: var(--space-3);}
.settings-option-group {padding: var(--space-5) 0 var(--space-6);border-top: 1px solid var(--border);}
.settings-group-heading {display: flex;align-items: flex-start;justify-content: space-between;gap: var(--space-3);margin-bottom: var(--space-4);}
.settings-group-heading h4 {margin: 0;font-size: var(--type-base);font-weight: 700;color: var(--text-primary);}
.settings-group-heading p {margin: var(--space-2) 0 0;color: var(--text-muted);font-size: var(--type-xs);line-height: 1.5;}
.settings-option-count {font-family: var(--numeric-font);color: var(--text-muted);font-size: var(--type-xs);}
.settings-option-list {border: 1px solid var(--border);border-radius: var(--radius-sm);overflow: hidden;}
.settings-option-row {display: flex;align-items: center;min-height: var(--control-standard);gap: var(--space-2);padding: var(--space-2) var(--space-4);font-size: var(--type-sm);color: var(--text-primary);}
.settings-option-row+.settings-option-row {border-top: 1px solid var(--border);}
.settings-option-row>span {flex: 1;min-width: 0;overflow-wrap: anywhere;}
.settings-option-row>.settings-reorder {display: inline-flex;align-items: center;gap: 0;flex: none;min-width: auto;white-space: nowrap;border-right: 1px solid var(--border);padding-right: var(--space-2);margin-right: var(--space-1);}
.settings-timeframe-choice {display: inline-flex;align-items: center;gap: var(--space-3);flex: 1;min-width: 0;cursor: pointer;}
.settings-timeframe-choice input {width: 18px;height: 18px;margin: 0;flex: none;accent-color: var(--accent);cursor: pointer;}
.settings-option-row.editing {background: var(--surface-subtle);}
.settings-scenario-meta {flex: none;color: var(--text-muted);font-family: var(--numeric-font);font-size: var(--type-xs);white-space: nowrap;}
.settings-scenario-editor {background: var(--surface-subtle);border-bottom: 1px solid var(--border);}
.settings-scenario-checks {padding: var(--space-5);border-top: 1px solid var(--border);}
.settings-scenario-checks-head {display: flex;align-items: flex-start;justify-content: space-between;gap: var(--space-3);margin-bottom: var(--space-4);}
.settings-scenario-checks-head h5 {margin: 0;font-size: var(--type-sm);font-weight: 700;color: var(--text-primary);}
.settings-scenario-checks-head p {margin: var(--space-2) 0 0;font-size: var(--type-xs);line-height: 1.45;color: var(--text-muted);}
.settings-scenario-checks .settings-option-list {background: var(--surface);}
.settings-empty-checklist {margin: 0;padding: var(--space-4);font-size: var(--type-xs);color: var(--text-muted);}
.settings-option-input {flex: 1;height: var(--control-small);padding: 0 var(--space-3);}
.settings-icon-btn {display: grid;place-items: center;flex: none;width: var(--control-small);height: var(--control-small);padding: 0;color: var(--text-muted);background: transparent;border: 1px solid transparent;border-radius: var(--radius-sm);}
.settings-icon-btn .icon {width: 16px;height: 16px;}
.settings-icon-btn:hover {color: var(--text-primary);background: var(--surface-hover);}
.settings-icon-btn:disabled {opacity: .3;cursor: default;pointer-events: none;}
.settings-icon-btn.save {color: var(--accent);background: var(--accent-subtle);}
.settings-icon-btn.danger:hover {color: var(--negative);}
.settings-confirm-delete {height: var(--control-small);padding: 0 var(--space-4);border: 1px solid var(--negative);border-radius: var(--radius-sm);background: transparent;color: var(--negative);font-size: var(--type-sm);font-weight: 600;}
.settings-add-option {display: inline-flex;align-items: center;gap: var(--space-3);min-height: var(--control-small);padding: 0 var(--space-2);margin-top: var(--space-3);border: 0;background: transparent;color: var(--accent);font-size: var(--type-sm);font-weight: 600;}
.settings-add-option .icon {width: 15px;height: 15px;}
.settings-preference-list {border-top: 1px solid var(--border);}
.settings-preference {display: flex;align-items: center;justify-content: space-between;gap: var(--space-4);min-height: var(--control-primary);width: 100%;padding: 0 var(--space-3);border: 0;border-bottom: 1px solid var(--border);background: transparent;text-align: left;color: var(--text-primary);font-size: var(--type-sm);}
.settings-preference.settings-journal-visibility {border: 0;}
.settings-preference:not(div):hover {background: var(--surface-hover);}
.settings-preference>span:first-child {display: inline-flex;align-items: center;gap: var(--space-4);}
.settings-preference .icon {width: 16px;height: 16px;color: var(--text-muted);}
.settings-preference-value {margin-left: auto;color: var(--text-muted);}
.settings-language-options {display: flex;gap: var(--space-3);padding: var(--space-4) var(--space-3);border-bottom: 1px solid var(--border);}
.settings-language-options button {display: inline-flex;align-items: center;gap: var(--space-2);min-height: var(--control-small);padding: 0 var(--space-4);border: 1px solid var(--border);border-radius: var(--radius-sm);background: var(--surface);color: var(--text-secondary);font-size: var(--type-sm);}
.settings-language-options button:hover {background: var(--surface-hover);}
.settings-language-options button span {color: var(--text-muted);font-size: var(--type-xs);}
.settings-language-options .icon {width: 13px;height: 13px;color: var(--accent);}
.field-help {display: inline-grid;place-items: center;width: 22px;height: 22px;margin-left: var(--space-1);padding: 0;border: 0;border-radius: var(--radius-sm);background: transparent;color: var(--text-muted);vertical-align: middle;}
.field-help:hover {color: var(--accent);background: var(--surface-hover);}
.field-help .icon {width: 14px;height: 14px;}
.trade-conditions {display: flex;align-items: center;justify-content: space-between;gap: var(--space-2);width: 100%;margin-top: var(--space-3);padding: var(--space-2) 0;border: 0;background: transparent;text-align: left;color: var(--text-muted);font-size: var(--type-xs);line-height: 1.35;}
.trade-conditions b {color: var(--text-secondary);font-family: var(--numeric-font);font-variant-numeric: tabular-nums;font-weight: 600;}
.trade-conditions .icon {width: 15px;height: 15px;color: var(--text-muted);}
.trade-conditions:hover b,.trade-conditions:hover .icon {color: var(--accent);}
.trade-conditions-dot {padding: 0 var(--space-1);}
.trade-drawer-header {height: 60px;min-height: 60px;padding: 0 var(--space-7);gap: var(--space-3);}
.trade-header-identity {display: flex;flex-direction: column;justify-content: center;gap: 3px;min-width: 0;flex: 1 1 auto;}
.trade-header-kicker {color: var(--text-muted);font-size: var(--type-xs);font-weight: 600;line-height: 1;letter-spacing: .045em;text-transform: uppercase;}
.trade-drawer-header .trade-header-identity h2 {min-width: 0;margin: 0;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;color: var(--text-primary);font-size: var(--type-heading);font-weight: 750;letter-spacing: .01em;line-height: 1.15;}
.trade-header-actions {gap: var(--space-3);flex: 0 0 auto;}
.trade-header-leverage {display: inline-flex;align-items: center;gap: var(--space-1);padding: var(--space-2) 0;border: 0;background: transparent;color: var(--text-primary);font-size: var(--type-sm);font-weight: 700;white-space: nowrap;cursor: pointer;}
.trade-header-leverage .icon {width: 12px;height: 12px;color: var(--text-muted);}
.trade-header-leverage:hover {color: var(--accent);}
.trade-header-leverage:focus-visible {outline: 2px solid var(--focus-ring);outline-offset: 3px;}
.trade-drawer-body {padding-top: var(--space-2);}
.trade-conditions-bar {border-bottom: 1px solid var(--border);padding-bottom: var(--space-2);margin-bottom: var(--space-3);}
.trade-conditions-bar .trade-conditions {margin-top: 0;padding: var(--space-3) 0;font-weight: 400;}
.position-info-settings,.inline-settings-link {display: inline-flex;align-items: center;gap: var(--space-1);width: fit-content;padding: var(--space-2) 0;border: 0;background: transparent;color: var(--text-secondary);font-size: var(--type-xs);text-align: left;}
.position-info-settings:hover,.inline-settings-link:hover {color: var(--accent);}
.position-info-settings {margin-top: var(--space-3);}
.position-info-settings .icon {width: 12px;height: 12px;}
@media(max-width:640px){
  .modal.settings-modal {height: calc(100dvh - 20px);max-height: calc(100dvh - 20px);}
  .settings-layout {display: flex;flex-direction: column;}
  .settings-header {min-height: 64px;padding: var(--space-5);}
  .settings-header p {display: none;}
  .settings-sidebar {flex-direction: row;gap: var(--space-2);flex: none;padding: var(--space-3);overflow-x: auto;border-right: 0;border-bottom: 1px solid var(--border);scrollbar-width: none;}
  .settings-nav-item {padding: 0 var(--space-3);}
  .settings-nav-item .icon {display: none;}
  .settings-pane {padding: var(--space-5);}
  .settings-pane .account-edit-grid {grid-template-columns: 1fr;}
}

/* Indicators and chart templates use the same workstation tokens as the rest
   of ReplayLab. This panel is intentionally modeless: no screen backdrop. */
.chart-template-trigger {max-width: 156px;}
.chart-template-trigger span {overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
.chart-tile.is-active {box-shadow: inset 0 0 0 1px var(--accent);}
.chart-tile:not(.is-active):hover {box-shadow: inset 0 0 0 1px var(--border-strong);}
.chart-context-menu[hidden],.ind-window[hidden] {display: none;}
.chart-context-menu {position: fixed;z-index: 92;width: 242px;padding: var(--space-2);background: var(--surface);border: 1px solid var(--border-strong);border-radius: var(--radius-sm);box-shadow: var(--shadow);}
.chart-context-label {padding: var(--space-3) var(--space-4);font-size: var(--type-xs);color: var(--text-muted);border-bottom: 1px solid var(--border-subtle);}
.chart-context-menu button {display: flex;align-items: center;gap: var(--space-3);width: 100%;min-height: var(--control-small);border: 0;border-radius: var(--radius-xs);background: transparent;color: var(--text-primary);text-align: left;font-size: var(--type-md);padding: var(--space-3) var(--space-4);}
.chart-context-menu button:hover {background: var(--surface-hover);}
.chart-context-menu .icon {width: 16px;height: 16px;}
.ind-window {position: fixed;z-index: 90;display: flex;flex-direction: column;width: min(474px,calc(100vw - 16px));height: min(640px,calc(100dvh - 20px));max-height: calc(100dvh - 20px);min-height: 240px;background: var(--surface);color: var(--text-primary);border: 1px solid var(--border-strong);border-radius: var(--radius-sm);box-shadow: var(--shadow);overflow: hidden;}
.ind-window-head {flex: none;display: flex;align-items: center;justify-content: space-between;gap: var(--space-4);min-height: 58px;padding: var(--space-4) var(--space-6);border-bottom: 1px solid var(--border);cursor: grab;touch-action: none;user-select: none;}
.ind-window-head:active {cursor: grabbing;}
.ind-window-head>div {display: flex;flex-direction: column;gap: var(--space-1);}
.ind-window-head strong {font-size: var(--type-lg);font-weight: 700;line-height: 1.2;}
.ind-window-head span {font-size: var(--type-xs);color: var(--text-muted);}
.ind-window-content {min-height: 0;overflow-y: auto;overscroll-behavior: contain;padding: var(--space-5) var(--space-6) var(--space-6);scrollbar-color: var(--border-strong) transparent;}
.ind-chart-tabs {display: flex;gap: var(--space-2);padding-bottom: var(--space-5);margin-bottom: var(--space-5);border-bottom: 1px solid var(--border);overflow-x: auto;scrollbar-width: thin;}
.ind-chart-tab {display: inline-flex;flex: 1 0 auto;min-width: 82px;flex-direction: column;align-items: flex-start;justify-content: center;gap: var(--space-1);padding: var(--space-3) var(--space-4);border: 1px solid var(--border);border-radius: var(--radius-sm);background: transparent;color: var(--text-secondary);font-size: var(--type-md);}
.ind-chart-tab small {color: var(--text-muted);font-size: var(--type-xs);}
.ind-chart-tab:hover {background: var(--surface-hover);}
.ind-chart-tab.active {border-color: var(--accent);background: var(--accent-subtle);color: var(--accent);font-weight: 600;}
.ind-chart-tab.active small {color: var(--accent);font-weight: 400;}
.ind-section-heading {display: flex;align-items: center;gap: var(--space-3);margin: var(--space-2) 0 var(--space-4);}
.ind-section-heading strong {font-size: var(--type-md);font-weight: 700;}
.ind-section-heading span {font-size: var(--type-xs);color: var(--text-muted);}
.ind-installed-list {border-top: 1px solid var(--border-subtle);}
.ind-installed-row {border-bottom: 1px solid var(--border-subtle);}
.ind-installed-main {display: flex;align-items: center;gap: var(--space-3);min-height: var(--control-primary);padding: var(--space-2) 0;}
.ind-color-dot {width: 9px;height: 9px;flex: none;border-radius: 50%;}
.ind-installed-name {min-width: 0;flex: 1;display: flex;flex-direction: column;gap: var(--space-1);}
.ind-installed-name strong {font-size: var(--type-md);font-weight: 600;white-space: normal;}
.ind-installed-name small {font-size: var(--type-xs);color: var(--text-muted);}
.ind-installed-row.is-hidden .ind-installed-name strong {color: var(--text-muted);font-weight: 400;}
.ind-actions {display: flex;align-items: center;gap: var(--space-1);}
.ind-icon-button {display: inline-grid;flex: none;place-items: center;width: 29px;height: 29px;padding: 0;color: var(--text-secondary);background: transparent;border: 1px solid transparent;border-radius: var(--radius-sm);}
.ind-icon-button .icon {width: 16px;height: 16px;}
.ind-icon-button:hover {background: var(--surface-hover);color: var(--accent);}
.ind-copy-actions {display: flex;justify-content: flex-end;padding-top: var(--space-3);}
.ind-copy-actions button {display: inline-flex;align-items: center;gap: var(--space-2);padding: var(--space-2) 0;border: 0;background: transparent;color: var(--accent);font-size: var(--type-sm);font-weight: 600;}
.ind-copy-actions .icon {width: 14px;height: 14px;}
.ind-divider {height: 1px;background: var(--border);margin: var(--space-6) 0 var(--space-5);}
.ind-search-wrap {display: flex;align-items: center;gap: var(--space-3);height: var(--control-standard);padding: 0 var(--space-4);border: 1px solid var(--border);border-radius: var(--radius-sm);background: var(--input-surface);}
.ind-search-wrap .icon {width: 15px;height: 15px;color: var(--text-muted);}
.ind-search-wrap:focus-within {border-color: var(--focus-ring);}
.ind-search-wrap input {flex: 1;min-width: 0;height: 100%;padding: 0;border: 0;outline: 0!important;background: transparent;color: var(--text-primary);font-size: var(--type-md);}
.ind-category-tabs {display: flex;gap: var(--space-5);margin: var(--space-5) 0 var(--space-3);overflow-x: auto;}
.ind-category-tabs button {flex: none;padding: var(--space-2) 0;border: 0;border-bottom: 2px solid transparent;background: transparent;color: var(--text-secondary);font-size: var(--type-xs);}
.ind-category-tabs button:hover,.ind-category-tabs button.active {color: var(--accent);}
.ind-category-tabs button.active {border-color: var(--accent);font-weight: 700;}
.ind-catalog-list {border-top: 1px solid var(--border-subtle);}
.ind-catalog-row {display: flex;align-items: center;gap: var(--space-3);width: 100%;min-height: var(--control-primary);padding: var(--space-3) var(--space-2);border: 0;border-bottom: 1px solid var(--border-subtle);background: transparent;text-align: left;color: var(--text-primary);}
.ind-catalog-row:hover:not(:disabled) {background: var(--surface-hover);}
.ind-catalog-row:disabled {opacity: .62;}
.ind-catalog-meta {display: flex;flex: 1;min-width: 0;flex-direction: column;gap: var(--space-1);}
.ind-catalog-meta strong {font-size: var(--type-md);font-weight: 600;}
.ind-catalog-meta small {font-size: var(--type-xs);color: var(--text-muted);}
.ind-catalog-action {display: grid;place-items: center;flex: none;width: 26px;height: 26px;color: var(--accent);}
.ind-catalog-action .icon {width: 17px;height: 17px;}
.ind-empty {padding: var(--space-6) var(--space-2);color: var(--text-muted);font-size: var(--type-sm);}
.ind-panel-footer {margin-top: var(--space-5);font-size: var(--type-xs);line-height: 1.5;color: var(--text-muted);}

.chart-templates-menu {padding: var(--space-5);}
.chart-templates-menu .date-menu-title {padding: 0 0 var(--space-3);}
.chart-templates-menu .date-caption {margin: 0 0 var(--space-4);font-size: var(--type-xs);line-height: 1.4;}
.chart-template-list {max-height: 252px;overflow: auto;border-top: 1px solid var(--border-subtle);border-bottom: 1px solid var(--border-subtle);}
.chart-template-empty {padding: var(--space-5) var(--space-2);font-size: var(--type-sm);color: var(--text-muted);}
.chart-template-row {display: flex;align-items: stretch;min-height: var(--control-standard);border-bottom: 1px solid var(--border-subtle);}
.chart-template-row:last-child {border-bottom: 0;}
.chart-template-select {display: flex;align-items: center;justify-content: space-between;gap: var(--space-3);min-width: 0;flex: 1;padding: var(--space-3) var(--space-2);border: 0;background: transparent;text-align: left;color: var(--text-primary);font-size: var(--type-md);}
.chart-template-select span {overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
.chart-template-select small {font-size: var(--type-xs);color: var(--warning);white-space: nowrap;}
.chart-template-select .icon {width: 15px;height: 15px;}
.chart-template-select:hover,.chart-template-small-action:hover {background: var(--surface-hover);}
.chart-template-select.active {color: var(--accent);font-weight: 700;}
.chart-template-small-action {width: 32px;padding: 0;display: grid;place-items: center;border: 0;background: transparent;color: var(--text-muted);}
.chart-template-small-action .icon {width: 14px;height: 14px;}
.chart-template-actions {display: grid;grid-template-columns: 1fr 1fr;gap: var(--space-2);margin-top: var(--space-5);}
.chart-template-actions button,.chart-template-editor button,.chart-template-confirm button {display: inline-flex;align-items: center;justify-content: center;gap: var(--space-2);min-height: var(--control-small);padding: var(--space-2) var(--space-3);border: 1px solid var(--border);border-radius: var(--radius-sm);background: var(--surface);color: var(--text-primary);font-size: var(--type-xs);}
.chart-template-actions button:first-child {border-color: var(--accent);background: var(--accent-subtle);color: var(--accent);font-weight: 700;}
.chart-template-actions .icon {width: 14px;height: 14px;}
.chart-template-actions button:hover,.chart-template-editor button:hover,.chart-template-confirm button:hover {background: var(--surface-hover);}
.chart-template-editor {display: flex;align-items: center;gap: var(--space-2);padding: var(--space-3) var(--space-2);background: var(--surface-subtle);}
.chart-template-editor.create {margin-top: var(--space-4);}
.chart-template-editor input {flex: 1;min-width: 0;height: var(--control-small);padding: 0 var(--space-3);border: 1px solid var(--border);border-radius: var(--radius-sm);background: var(--input-surface);color: var(--text-primary);font-size: var(--type-md);}
.chart-template-editor button {padding-inline: var(--space-3);}
.chart-template-editor button .icon {width: 14px;height: 14px;}
.chart-template-confirm {padding: var(--space-3);font-size: var(--type-md);color: var(--text-primary);background: var(--surface-subtle);}
.chart-template-confirm>div {display: flex;justify-content: flex-end;gap: var(--space-2);margin-top: var(--space-3);}
.chart-template-confirm button.danger {color: var(--negative);border-color: var(--negative);}
@media(max-width:560px){
  .ind-window {width: calc(100vw - 16px);max-height: calc(100dvh - 16px);}
  .ind-window-head {min-height: 52px;}
  .ind-window-content {padding: var(--space-4);}
}

/* Shared drawing-object tree: presentation only, independent of timeframe. */
.object-panel {display: flex;flex-direction: column;overflow: hidden;padding: 0;}
.object-tree-toolbar {display: flex;align-items: center;gap: var(--space-1);min-height: 51px;padding: 0 var(--space-5);border-bottom: 1px solid var(--border);flex: none;}
.object-tree-icon-btn {display: inline-grid;place-items: center;width: var(--control-small);height: var(--control-small);padding: 0;border: 1px solid transparent;border-radius: var(--radius-sm);background: transparent;color: var(--text-secondary);}
.object-tree-icon-btn .icon {width: 19px;height: 19px;}
.object-tree-icon-btn:hover {background: var(--surface-hover);color: var(--accent);}
.object-toolbar-divider {width: 1px;height: 19px;margin: 0 var(--space-2);background: var(--border-subtle);}
.object-toolbar-spacer {flex: 1;}
.object-tree-scroll {flex: 1;min-height: 0;overflow: auto;padding: var(--space-3) 0 var(--space-4);overscroll-behavior: contain;scrollbar-color: var(--border-strong) transparent;}
.object-tree-row {display: flex;align-items: center;gap: var(--space-3);width: 100%;min-width: 0;min-height: 43px;padding: 0 var(--space-4) 0 calc(var(--space-2) + var(--object-depth) * 18px);color: var(--text-primary);font-size: var(--type-md);cursor: pointer;user-select: none;}
.object-tree-row:hover {background: var(--surface-hover);}
.object-tree-row.selected,.object-tree-row.selected:hover {background: var(--accent-subtle);}
.object-tree-row.is-hidden .object-tree-name,.object-tree-row.is-hidden .object-type-icon {opacity: .48;}
.object-tree-expand,.object-tree-expand-placeholder {display: inline-grid;place-items: center;width: 17px;height: 26px;flex: none;padding: 0;border: 0;background: transparent;color: var(--text-secondary);}
.object-tree-expand:hover {color: var(--accent);}
.object-tree-expand .icon {width: 13px;height: 13px;}
.object-type-icon {width: 20px;height: 20px;flex: none;stroke-width: 1.5;}
.object-tree-name {flex: 1;min-width: 0;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
.object-row-actions {display: flex;align-items: center;gap: var(--space-1);flex: none;opacity: 0;pointer-events: none;}
.object-tree-row:hover .object-row-actions,.object-tree-row.selected .object-row-actions,.object-tree-row:focus-within .object-row-actions {opacity: 1;pointer-events: auto;}
.object-row-actions button {display: inline-grid;place-items: center;width: 26px;height: 28px;padding: 0;border: 0;border-radius: var(--radius-xs);background: transparent;color: var(--text-muted);}
.object-row-actions button:hover {background: var(--surface-pressed);color: var(--accent);}
.object-row-actions .icon {width: 15px;height: 15px;}
.object-panel-note {flex: none;padding: var(--space-4) var(--space-6);border-top: 1px solid var(--border-subtle);color: var(--text-muted);font-size: var(--type-xs);line-height: 1.45;}

/* The chart library can replace the rail contents; only its outer container folds. */
.left-rail {position: relative;z-index: 8;overflow: visible;transition: width .18s ease,flex-basis .18s ease,padding .18s ease;}
.left-rail.is-collapsed {width: 0;flex: 0 0 0;padding: 0;border-right: 0;gap: 0;}
.left-rail.is-collapsed > :not(.drawing-rail-toggle) {display: none;}
.drawing-rail-toggle {position: absolute;top: 80%;right: -12px;z-index: 9;display: grid;place-items: center;width: 24px;height: var(--control-standard);padding: 0;border: 0;background: transparent;color: var(--text-secondary);transform: translateY(-50%);opacity: 0;pointer-events: none;transition: opacity .14s ease 2s;}
.drawing-rail-toggle::before {content: '';position: absolute;inset: 0 6px;border: 1px solid var(--border-strong);border-radius: var(--radius-sm);background: var(--surface);}
.drawing-rail-toggle .icon {position: relative;width: 9px;height: 9px;}
.left-rail:hover .drawing-rail-toggle,.drawing-rail-toggle:focus-visible {opacity: 1;pointer-events: auto;transition-delay: 0s;}
.drawing-rail-toggle:hover {color: var(--accent);}
.drawing-rail-toggle:hover::before {background: var(--surface-hover);border-color: var(--accent);}
.drawing-rail-toggle:focus-visible {outline: 2px solid var(--accent);outline-offset: 2px;}
.left-rail.is-collapsed .drawing-rail-toggle {right: -24px;opacity: 1;pointer-events: auto;transition: none;}
@media (hover: none) {.drawing-rail-toggle {opacity: 1;pointer-events: auto;transition: none;}}
@media (prefers-reduced-motion: reduce) {.left-rail {transition: none;}}
