/* Extracted from wealthtracker.us index.css: chain + ticket chrome */

.chain-root {
  --chain-bg: var(--wt-metal, #111216);
  --chain-row: #14151c;
  --chain-row-alt: #161822;
  --chain-header: #1a1b22;
  --chain-strike: #22242e;
  --chain-hover: rgba(82, 227, 155, 0.1);
  --chain-grid: rgba(255, 255, 255, 0.07);
  --chain-bid: #5bc97d;
  --chain-ask: #ff6c6c;
  --chain-neutral: #d8d8e0;
  /* Reserved: translucent orange on the strike column for ± expected range only */
  --chain-expected-range: rgba(180, 95, 35, 0.38);
  /* Spot / ATM hairline — not the expected-range fill */
  --chain-atm: #e0a020;
  --chain-ivx-chg: #7eb8e8;
  /* Expanded expiry — purple-tinted metal (was blue-navy) */
  --chain-selected-exp: rgba(82, 227, 155, 0.12);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  background: var(--chain-bg);
  color: var(--chain-neutral);
  font-size: 12px;
  font-weight: 500;
}

/* Quiet symbol-switch / chain metadata wait */
.chain-load-bar-track {
  width: min(200px, 72%);
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.chain-load-bar {
  width: 42%;
  height: 100%;
  border-radius: 2px;
  background: rgba(82, 227, 155, 0.55);
  animation: chainLoadSlide 1.1s ease-in-out infinite;
}

@keyframes chainLoadSlide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(200%);
  }
}

.chain-loading-host {
  position: relative;
  width: 100%;
}

.chain-loading-host.is-loading {
  min-height: min(320px, 48vh);
}

/* Cold start: cover the scroll body under the sticky column header */
.chain-loading-host--panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 34px; /* CHAIN_HEADER_HEIGHT */
  bottom: 0;
  z-index: 25;
  min-height: min(420px, 62vh);
}

.chain-loading-veil {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(17, 18, 22, 0.92);
}

.chain-loading-quiet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.chain-loading-caption {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a747c;
}

.chain-loading-row {
  display: grid;
  width: 100%;
  border-bottom: 1px solid #222;
  background: #121212;
}

.chain-loading-row.is-even {
  background: #141414;
}

.chain-loading-cell {
  display: block;
  min-width: 0;
  margin: 4px;
  border-radius: 2px;
  background: #1e1e1e;
}

/* Shared cell alignment (numbers right, strike/DTE center) */
.chain-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  border-right: none;
  padding: 0 6px;
  box-sizing: border-box;
}

.chain-cell--end {
  justify-content: flex-end;
  text-align: right;
}

.chain-cell--center {
  justify-content: center;
  text-align: center;
}

.chain-cell--strike {
  position: relative;
  z-index: 1;
  background: var(--chain-strike);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}

/* Strike ladder tick marks — short every row, longer every 5th */
.chain-cell--strike::before,
.chain-cell--strike::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 4px;
  height: 1px;
  transform: translateY(-50%);
  background: rgba(200, 200, 200, 0.28);
  pointer-events: none;
  z-index: 2;
}
.chain-cell--strike::before {
  left: 2px;
}
.chain-cell--strike::after {
  right: 2px;
}
.chain-cell--strike.is-tick-long::before,
.chain-cell--strike.is-tick-long::after,
.chain-strike-row[data-tick="long"] .chain-cell--strike::before,
.chain-strike-row[data-tick="long"] .chain-cell--strike::after {
  width: 8px;
  background: rgba(200, 200, 200, 0.45);
}

.chain-strike-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  letter-spacing: 0;
}

.chain-cell--strike-head {
  background: var(--chain-strike);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #c8c8c8;
  font-weight: 600;
  font-size: 11px;
  padding: 0 6px;
}

/* DTE uses the exact same track + box model as Strike header / strike numbers */
.chain-cell--dte {
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #c8c8c8;
  padding: 0 4px;
  line-height: 18px;
  height: 18px;
}

.chain-cell--dte.is-expanded {
  color: #f0f0f0;
}

/* Expiry row center cluster under Strike: Calls | DTE | Puts */
.chain-exp-atm {
  min-width: 0;
}

.chain-exp-dte {
  border-right: none;
}

.chain-exp-side-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.88);
  text-transform: uppercase;
}

.chain-exp-side-tag.is-expanded {
  color: #fff;
}

.chain-exp-meta,
.chain-exp-right {
  min-width: 0;
}

.chain-exp-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
}

.chain-exp-date {
  font-size: 12px;
  font-weight: 600;
  color: #e8e8e8;
  font-variant-numeric: tabular-nums;
}

.chain-exp-week {
  font-size: 10px;
  font-weight: 700;
  text-transform: lowercase;
  color: #c9a040;
  letter-spacing: 0.02em;
}

.chain-exp-chevron {
  color: #888;
  transition: transform 120ms ease;
  transform: rotate(-90deg);
}
.chain-exp-chevron.is-expanded {
  transform: rotate(0deg);
  color: #aaa;
}

.chain-ivx {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
}
.chain-ivx-label {
  color: #c8c8c8;
  font-weight: 600;
}
.chain-ivx-pct {
  color: #fff;
  font-weight: 600;
}
.chain-ivx-chg {
  color: var(--chain-ivx-chg);
  font-weight: 500;
}

.chain-head {
  background: var(--chain-header);
  border-bottom: 1px solid var(--chain-grid);
  color: #9a9a9a;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chain-head .chain-cell {
  border-right: none;
  font-weight: 600;
  font-size: 11px;
}

.chain-head-bid {
  color: var(--chain-bid) !important;
}
.chain-head-ask {
  color: var(--chain-ask) !important;
}

/* Sticky column header inside scroll body (shared width with rows) */
.chain-head-sticky {
  box-shadow: none;
  border-bottom: 1px solid var(--chain-grid);
  background: var(--chain-header);
}

.chain-exp-track {
  border-right: none;
}

.chain-stale-banner {
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1.35;
  color: #f5e6b8;
  background: #3a2f14;
  border-bottom: 1px solid #6b5420;
}

.chain-pill {
  display: inline-flex;
  height: 18px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  color: #ffffff;
  text-transform: none;
  box-shadow: none;
}

.chain-pill-working {
  background: #70520b;
  border: 1px solid #b98d24;
  box-shadow: none;
}

.chain-pill-position {
  background: #323232;
  border: 1px solid #4a4a4a;
  box-shadow: none;
}

/* —— Chain side gutters (W / B# / S#) —— */
.chain-gutter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
  background: var(--chain-bg);
  border-right: none;
}

.chain-gutter--put {
  border-right: 0;
  border-left: none;
}

.chain-gutter--head,
.chain-gutter--exp {
  background: transparent;
  border-color: transparent;
}

.chain-ticket-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  min-width: 22px;
  padding: 0 4px;
  border-radius: 2px 0 0 2px;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
  clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 50%, calc(100% - 4px) 100%, 0 100%);
}

.chain-ticket-badge.is-draggable {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.chain-ticket-badge.is-draggable:active {
  cursor: grabbing;
}

/* Pending ticket leg — the entire rail is the drag target, not just B#/S#. */
.chain-pending-leg {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 0;
  border-radius: 0;
  box-sizing: border-box;
  background: transparent;
  clip-path: none;
  box-shadow: none;
}

.chain-pending-leg.is-draggable {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.chain-pending-leg.is-draggable:active {
  cursor: grabbing;
}

.chain-pending-leg__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 100%;
  min-height: 100%;
  padding: 0 4px;
  border-radius: 0;
  box-sizing: border-box;
  pointer-events: none;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.chain-pending-leg__badge.is-buy {
  background: #1a8f5a;
}

.chain-pending-leg__badge.is-sell {
  background: #b03040;
}

.chain-gutter--call .chain-pending-leg {
  justify-content: flex-start;
}

.chain-gutter--put .chain-pending-leg {
  justify-content: flex-end;
}

.chain-gutter--put .chain-pending-leg__badge {
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 6px 100%, 0 50%);
}

.chain-ticket-drag-ghost {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chain-ticket-drag-ghost .chain-ticket-badge {
  opacity: 0.95;
}

.chain-ticket-drag-ghost__strike {
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #d8d8d8;
  background: #252525;
  border: 1px solid #4a4a4a;
  border-radius: 2px;
  padding: 1px 5px;
}

.chain-strike-row.is-drag-target {
  outline: 1px solid var(--wt-accent);
  outline-offset: -1px;
  box-shadow: inset 0 0 0 1px rgba(82, 227, 155, 0.2), var(--glow-purple);
}

.chain-ticket-badge.is-buy {
  background: #1a8f5a;
  box-shadow: none;
}

.chain-ticket-badge.is-sell {
  background: #b03040;
  box-shadow: none;
}

/* Keep the ticket flag colors aligned with the existing chain palette. */
.chain-pending-leg.is-buy {
  color: #fff;
}

.chain-pending-leg.is-sell {
  color: #fff;
}

/* Plain gold W — call gutter far left, put far right. */
.chain-working-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #c9a227;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}

.chain-working-badge.is-compact {
  font-size: 8px;
  margin-top: 1px;
}

/*
 * Side-only ticket marks (call half vs put half — never both unless each side
 * has its own leg). Working orders use plain gold W in the gutter only.
 * Top/bottom inset lines on side cells; outer edges on gutter + bid/ask edge cells.
 */
.chain-strike-row.chain-side-mark--call-buy .chain-side-call,
.chain-strike-row.chain-side-mark--call-buy .chain-gutter--call {
  box-shadow: inset 0 1.5px 0 0 #2a9d6a, inset 0 -1.5px 0 0 #2a9d6a;
  background-color: rgba(42, 157, 106, 0.06);
}
.chain-strike-row.chain-side-mark--call-buy .chain-gutter--call {
  box-shadow:
    inset 1.5px 0 0 0 #2a9d6a,
    inset 0 1.5px 0 0 #2a9d6a,
    inset 0 -1.5px 0 0 #2a9d6a;
}
.chain-strike-row.chain-side-mark--call-buy .chain-side-edge-end {
  box-shadow:
    inset -1.5px 0 0 0 #2a9d6a,
    inset 0 1.5px 0 0 #2a9d6a,
    inset 0 -1.5px 0 0 #2a9d6a;
}

.chain-strike-row.chain-side-mark--call-sell .chain-side-call,
.chain-strike-row.chain-side-mark--call-sell .chain-gutter--call {
  box-shadow: inset 0 1.5px 0 0 #c04050, inset 0 -1.5px 0 0 #c04050;
  background-color: rgba(192, 64, 80, 0.06);
}
.chain-strike-row.chain-side-mark--call-sell .chain-gutter--call {
  box-shadow:
    inset 1.5px 0 0 0 #c04050,
    inset 0 1.5px 0 0 #c04050,
    inset 0 -1.5px 0 0 #c04050;
}
.chain-strike-row.chain-side-mark--call-sell .chain-side-edge-end {
  box-shadow:
    inset -1.5px 0 0 0 #c04050,
    inset 0 1.5px 0 0 #c04050,
    inset 0 -1.5px 0 0 #c04050;
}

/* Put half mirrors call */
.chain-strike-row.chain-side-mark--put-buy .chain-side-put,
.chain-strike-row.chain-side-mark--put-buy .chain-gutter--put {
  box-shadow: inset 0 1.5px 0 0 #2a9d6a, inset 0 -1.5px 0 0 #2a9d6a;
  background-color: rgba(42, 157, 106, 0.06);
}
.chain-strike-row.chain-side-mark--put-buy .chain-gutter--put {
  box-shadow:
    inset -1.5px 0 0 0 #2a9d6a,
    inset 0 1.5px 0 0 #2a9d6a,
    inset 0 -1.5px 0 0 #2a9d6a;
}
.chain-strike-row.chain-side-mark--put-buy .chain-side-edge-start {
  box-shadow:
    inset 1.5px 0 0 0 #2a9d6a,
    inset 0 1.5px 0 0 #2a9d6a,
    inset 0 -1.5px 0 0 #2a9d6a;
}

.chain-strike-row.chain-side-mark--put-sell .chain-side-put,
.chain-strike-row.chain-side-mark--put-sell .chain-gutter--put {
  box-shadow: inset 0 1.5px 0 0 #c04050, inset 0 -1.5px 0 0 #c04050;
  background-color: rgba(192, 64, 80, 0.06);
}
.chain-strike-row.chain-side-mark--put-sell .chain-gutter--put {
  box-shadow:
    inset -1.5px 0 0 0 #c04050,
    inset 0 1.5px 0 0 #c04050,
    inset 0 -1.5px 0 0 #c04050;
}
.chain-strike-row.chain-side-mark--put-sell .chain-side-edge-start {
  box-shadow:
    inset 1.5px 0 0 0 #c04050,
    inset 0 1.5px 0 0 #c04050,
    inset 0 -1.5px 0 0 #c04050;
}

/* A selected side's wireframe is also a vertical ticket-drag surface. */
.chain-strike-row.chain-side-mark--call-buy [data-chain-side="call"],
.chain-strike-row.chain-side-mark--call-sell [data-chain-side="call"],
.chain-strike-row.chain-side-mark--put-buy [data-chain-side="put"],
.chain-strike-row.chain-side-mark--put-sell [data-chain-side="put"] {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

/* ITM is marked by the yellow ITM tags on the ATM band — not an orange wash.
   Orange translucent fill is reserved for expected-range on the strike column only. */

/* ATM separator (between OTM/ITM strikes) — gold line + flanking ITM badges */
.chain-atm-band {
  position: relative;
  display: block;
  height: 18px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--chain-bg);
  border-top: 1px solid var(--chain-atm);
  border-bottom: 1px solid transparent;
  box-shadow: none;
  z-index: 5;
}

/* Full-width hit targets: left = chart ATM call, right = chart ATM put */
.chain-atm-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
.chain-atm-hit--call {
  left: 0;
  width: 50%;
}
.chain-atm-hit--put {
  right: 0;
  width: 50%;
}
.chain-atm-hit--call:hover {
  background: linear-gradient(
    90deg,
    rgba(20, 220, 110, 0.1),
    rgba(20, 220, 110, 0.02)
  );
}
.chain-atm-hit--put:hover {
  background: linear-gradient(
    270deg,
    rgba(255, 60, 60, 0.1),
    rgba(255, 60, 60, 0.02)
  );
}
.chain-atm-hit.is-active {
  background: rgba(232, 200, 74, 0.12);
}

.chain-atm-itm {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 15px;
  padding: 0 6px 0 5px;
  border-radius: 3px;
  background: #e8c84a;
  color: #111;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 800;
  z-index: 2;
  cursor: pointer;
  user-select: none;
  letter-spacing: 0.04em;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.chain-atm-itm-arrow {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  fill: currentColor;
}

.chain-atm-itm--left {
  right: calc(50% + 28px);
}

.chain-atm-itm--right {
  left: calc(50% + 28px);
}

.chain-atm-itm.is-active {
  box-shadow: 0 0 0 1px #fff, 0 0 0 3px rgba(232, 200, 74, 0.55);
}

/* Position qty pill on bid/ask */
.chain-pos-qty {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 2px;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  background: #e8e8e8;
  color: #111;
  box-shadow: none;
}

.chain-pos-qty.is-short {
  background: #f0c0c8;
  color: #5a1018;
}

.chain-price {
  background: transparent;
  cursor: pointer;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: var(--chain-neutral);
  width: 100%;
  height: 100%;
  transition: none;
}

.chain-price--bid {
  color: var(--chain-bid);
}

.chain-price--ask {
  color: var(--chain-ask);
}

/* Frozen / last-fill when no live book (after hours) */
.chain-price--muted {
  color: #7a7a7a;
  font-weight: 400;
}

.chain-price-up {
  color: var(--chain-bid) !important;
}

.chain-price-down {
  color: var(--chain-ask) !important;
}

.chain-price:hover:not(:disabled) {
  background: var(--chain-hover);
}

.chain-num {
  color: var(--chain-neutral);
  font-size: 12px;
  font-weight: 500;
}

.chain-strike-row {
  background: var(--chain-row);
  border-bottom: 1px solid var(--chain-grid);
  color: var(--chain-neutral);
  font-size: 12px;
  font-weight: 500;
}

.chain-strike-row.is-alt {
  background: var(--chain-row-alt);
}

.chain-strike-row:hover {
  background: var(--chain-hover);
  box-shadow: inset 0 0 0 1px rgba(82, 227, 155, 0.18);
}

/* Staged / selected strike (ticket focus) */
.chain-strike-row.is-selected,
.chain-strike-row.is-staged,
.chain-strike-row[data-selected='true'] {
  background: rgba(82, 227, 155, 0.12);
  box-shadow: inset 2px 0 0 var(--wt-accent);
}

.chain-exp-row {
  background: var(--chain-header);
  border: none;
  border-top: 1px solid var(--chain-grid);
  border-bottom: 1px solid var(--chain-grid);
  color: #c8c8d0;
}

.chain-exp-row.is-expanded {
  background: var(--chain-selected-exp);
  box-shadow: inset 2px 0 0 var(--wt-accent);
}

/* Sticky variant needs an opaque backing — it pins in place while strike rows
   scroll underneath, and a translucent fill let their text bleed through. */
.chain-exp-row.chain-exp-row--sticky {
  background: linear-gradient(var(--chain-selected-exp), var(--chain-selected-exp)), var(--chain-header);
  box-shadow: inset 2px 0 0 var(--wt-accent);
}

.chain-exp-row:hover {
  background: var(--chain-hover);
  filter: none;
}

.chain-exp-row.is-expanded:hover {
  background: rgba(82, 227, 155, 0.16);
}

.chain-exp-row.chain-exp-row--sticky:hover {
  background: linear-gradient(rgba(82, 227, 155, 0.16), rgba(82, 227, 155, 0.16)), var(--chain-header);
}

/* Expanded expiry pins under sticky column header while strikes scroll */
.chain-exp-row--sticky {
  position: sticky;
  top: 34px; /* CHAIN_HEADER_HEIGHT */
  z-index: 25;
  box-shadow: none;
}

/* Chain fits window — vertical scroll only, no horizontal */
.chain-root,
.chain-head-wrap,
.chain-body,
.chain-head,
.chain-strike-row,
.chain-exp-row,
.chain-exp-group {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.chain-root,
.chain-body {
  overflow-x: hidden !important;
}

.chain-body {
  position: relative;
}

/* Symbol refresh: keep ladder mounted; dim instead of blanking the panel */
.chain-body--refreshing::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: rgb(0 0 0 / 38%);
}

.chain-head,
.chain-strike-row,
.chain-exp-row {
  display: grid;
  align-items: center;
  width: 100%;
  min-width: 0;
  /* Prevent grid from expanding past container (default min-width:auto on items) */
  overflow: hidden;
}

/* Grid children must shrink below content width or fr tracks still overflow */
.chain-head > *:not(.chain-gutter),
.chain-strike-row > *:not(.chain-gutter),
.chain-exp-row > *:not(.chain-gutter) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
 * Text-only flash (no background). Soft fade ~200ms.
 * Uses !important so bid/ask color rules don't block the pulse.
 */
.soft-flash-up {
  animation: softFlashTextUp 0.2s ease-in-out;
}

.soft-flash-down {
  animation: softFlashTextDown 0.2s ease-in-out;
}

.soft-flash-up.chain-flash-a {
  animation-name: softFlashTextUpA;
}

.soft-flash-up.chain-flash-b {
  animation-name: softFlashTextUpB;
}

.soft-flash-down.chain-flash-a {
  animation-name: softFlashTextDownA;
}

.soft-flash-down.chain-flash-b {
  animation-name: softFlashTextDownB;
}

@keyframes softFlashTextUp {
  0% {
    color: inherit;
  }
  40% {
    color: #69bd7b !important;
  }
  100% {
    color: inherit;
  }
}

@keyframes softFlashTextDown {
  0% {
    color: inherit;
  }
  40% {
    color: #e05d63 !important;
  }
  100% {
    color: inherit;
  }
}

@keyframes softFlashTextUpA {
  0% {
    color: inherit;
  }
  40% {
    color: #69bd7b !important;
  }
  100% {
    color: inherit;
  }
}

@keyframes softFlashTextUpB {
  0% {
    color: inherit;
  }
  40% {
    color: #69bd7b !important;
  }
  100% {
    color: inherit;
  }
}

@keyframes softFlashTextDownA {
  0% {
    color: inherit;
  }
  40% {
    color: #e05d63 !important;
  }
  100% {
    color: inherit;
  }
}

@keyframes softFlashTextDownB {
  0% {
    color: inherit;
  }
  40% {
    color: #e05d63 !important;
  }
  100% {
    color: inherit;
  }
}

@media (prefers-reduced-motion: reduce) {
  .soft-flash-up,
  .soft-flash-down {
    animation: none;
    transition: none;
  }
  .soft-flash-up.chain-flash-a,
  .soft-flash-up.chain-flash-b,
  .soft-flash-down.chain-flash-a,
  .soft-flash-down.chain-flash-b {
    animation: none;
  }
  .chain-exp-chevron {
    transition: none;
  }
}

/* Symbol search logos — square, sized to fit metric shell height */
.symbol-search-logo {
  position: relative;
  display: inline-flex;
  height: 18px;
  width: 18px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--desk-metric-radius);
  background: #2a2a2a;
}

.symbol-search-logo-fallback {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #c8c8c8;
}

.symbol-search-logo-img {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: contain;
  background: #fff;
}

/* ── Chain column settings (IBKR Trade DISPLAY style) ── */
.chain-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.chain-settings-modal {
  display: flex;
  width: min(820px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 48px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #4a5a62;
  background: #1c1c1c;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  color: #d8d8d8;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.chain-settings-header {
  display: grid;
  grid-template-columns: 148px 1fr;
  background: #7a9bb0;
  color: #0f1720;
}

.chain-settings-modules-label {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-right: 1px solid rgba(0, 0, 0, 0.12);
}

.chain-settings-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 6px 14px;
}

.chain-settings-title-row h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.chain-settings-close {
  display: inline-flex;
  height: 24px;
  width: 24px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #0f1720;
  cursor: pointer;
  border-radius: 2px;
}

.chain-settings-close:hover {
  background: rgba(0, 0, 0, 0.12);
}

.chain-settings-body {
  display: grid;
  grid-template-columns: 148px 1fr;
  min-height: 0;
  flex: 1;
}

.chain-settings-nav {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #333;
  background: #151515;
  padding-bottom: 8px;
}

.chain-settings-nav-item {
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #9a9a9a;
  border-bottom: 1px solid #2a2a2a;
}

.chain-settings-nav-item.is-active {
  background: #3a3a3a;
  color: #f0f0f0;
}

.chain-settings-ok {
  margin: auto 10px 8px;
  height: 26px;
  border: 1px solid #555;
  background: #2a2a2a;
  color: #ddd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.chain-settings-ok:hover {
  background: #333;
  border-color: #777;
}

.chain-settings-main {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #1a1a1a;
}

.chain-settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #333;
  background: #222;
  padding: 0 4px;
}

.chain-settings-tab {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #8a8a8a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.chain-settings-tab:hover {
  color: #ccc;
}

.chain-settings-tab.is-active {
  color: #fff;
  border-bottom-color: #c8c8c8;
  background: #1a1a1a;
}

.chain-settings-panel {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 16px 18px 14px;
}

.chain-settings-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.chain-settings-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  margin-bottom: 18px;
}

.chain-settings-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cfcfcf;
  cursor: pointer;
  user-select: none;
}

.chain-settings-check input {
  accent-color: #7a9bb0;
  width: 14px;
  height: 14px;
}

.chain-settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-top: 4px;
  border-top: 1px solid #2e2e2e;
  padding-top: 14px;
}

.chain-settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #e8e8e8;
}

.chain-settings-section-sub {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: #7a7a7a;
  max-width: 420px;
}

.chain-settings-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #5eb0e0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 4px 6px;
}

.chain-settings-reset:hover {
  color: #8cc8f0;
}

.chain-settings-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: 220px;
}

.chain-col-list {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border: 1px solid #333;
  background: #141414;
}

.chain-col-list-title {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #b8b8b8;
  border-bottom: 1px solid #2e2e2e;
  background: #1b1b1b;
}

.chain-col-list-body {
  min-height: 180px;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}

.chain-col-empty {
  padding: 24px 10px;
  text-align: center;
  font-size: 11px;
  color: #666;
}

.chain-col-item {
  display: grid;
  grid-template-columns: 16px 72px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding: 7px 8px;
  border: 1px solid #3a3a3a;
  background: #2c2c2c;
  color: #e6e6e6;
  font-size: 12px;
  cursor: grab;
  user-select: none;
}

.chain-col-item:hover {
  border-color: #555;
  background: #333;
}

.chain-col-item.is-dragging {
  opacity: 0.45;
}

.chain-col-item-label {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.chain-col-item-hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: #7a7a7a;
}

.chain-settings-footnote {
  margin: 12px 0 0;
  font-size: 10px;
  line-height: 1.45;
  color: #5e5e5e;
}

/* Positions page: slide-up order ticket (Close / roll / replace) */
