/* /chart right-click passive orders (orders.js) — LOOK A "TradingView", the user's pick (2026-10-05); each order's STOP
   (the draft's, a resting order's) is look C's ink tab (.ord-sl, the position-stops pick) — see the section below.
   The LINE is a vendor price line (dashed, side colour, its own axis tag); this sheet styles the PILL docked just
   left of the price axis, the size popover and the menu rows' side colours. Every rule is scoped to orders.js's own
   DOM (.ord-pill, #ord-size) or to a class only orders.js puts on a #chart-menu row (cm-long / cm-short / cm-mute),
   so a page without the script matches none of it. Colours are /chart's tokens: --pos / --neg follow the theme.
   A CHASE (the server re-prices it to the touch) is the same pill — .ord-pill.chase, its side segment reading
   "🧲 CHASE LONG" — with no drag cursor, a muted reprice budget and a quiet `keep` beside the ×; its "🧲 Chase …" menu
   rows are cm-long / cm-short like the limit rows (chart.js applies ONE class per menu row). */

/* ---- the menu rows (chart.js applies a row's {cls} to its .cm-item button) ---- */
.cm-item.cm-long { color: var(--pos); }
.cm-item.cm-short { color: var(--neg); }
.cm-item.cm-mute { color: var(--muted); }

/* ---- the pill: [📌 LONG][0.0232][$2,000][×] — a filled side segment, then neutral ones ----
   Positioned by orders.js with a transform (its right edge on the plot's, centred on the line); z 8 sits above the
   canvas, #draw-overlay (5) and #ind-chips (6), below the inspector (10), the rail (15), the toasts (22) and
   #chart-menu (40). */
.ord-pill {
  --c: var(--pos);
  --on-side: #ffffff;
  position: absolute; left: 0; top: 0; z-index: 8;
  display: inline-flex; align-items: center;
  height: 20px; overflow: hidden;
  white-space: nowrap; font-size: 11px; line-height: 1; font-variant-numeric: tabular-nums;
  background: var(--panel); color: var(--fg);
  border: 1px solid var(--c); border-radius: 3px;
  cursor: ns-resize; touch-action: none; user-select: none; -webkit-user-select: none;
}
.ord-pill[hidden] { display: none; } /* the display above would otherwise beat the [hidden] attribute */
.ord-pill.short { --c: var(--neg); }
.ord-pill .sg {
  height: 100%; display: inline-flex; align-items: center; padding: 0 7px; margin: 0;
  border: 0; border-left: 1px solid color-mix(in srgb, var(--c) 38%, transparent); border-radius: 0;
  background: transparent; color: inherit; font: inherit;
}
.ord-pill .sg:first-child { border-left: 0; }
.ord-pill .side { background: var(--c); color: var(--on-side); font-weight: 700; letter-spacing: 0.3px; }
.ord-pill .px { font-weight: 600; }
.ord-pill .dist, .ord-pill .nt { color: var(--muted); }
.ord-pill .ro { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.5px; }
.ord-pill button { cursor: pointer; }
.ord-pill .x { color: var(--muted); font-size: 13px; }
.ord-pill .x:hover { color: var(--fg); background: color-mix(in srgb, var(--c) 18%, transparent); }
.ord-pill .dr { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.6px; }
.ord-pill .place { background: var(--c); color: var(--on-side); font-weight: 700; }
.ord-pill .place:hover { filter: brightness(1.1); }
.ord-pill .tob {
  background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c);
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
}
/* DRAFT: [DRAFT][📌 LONG (outlined)][qty · $][@ px][Place ✓][×] with a dashed border — never mistaken for a live order. */
.ord-pill.draft { border-style: dashed; }
.ord-pill.draft .side { background: transparent; color: var(--c); }
.ord-pill:hover, .ord-pill.drag { box-shadow: 0 0 0 1px var(--c); }
.ord-pill.moving, .ord-pill.placing, .ord-pill.cancelling { cursor: progress; }
.ord-pill.cancelling { opacity: 0.6; }
/* A draft waiting on its automatic stop (no 5m ATR yet): Place is disabled. */
.ord-pill .place:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
/* CHASE: [DRAFT][🧲 CHASE LONG][qty · $][@ bid px][Place ✓][×] / [🧲 CHASE LONG][rem/size][$][7/60][keep][×] — nothing to
   drag (the server moves it), so no ns-resize; the budget and `keep` are as quiet as the × beside them. */
.ord-pill.chase { cursor: default; }
.ord-pill .bud { color: var(--muted); }
.ord-pill .keep { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.4px; }
.ord-pill .keep:hover { color: var(--fg); background: color-mix(in srgb, var(--c) 18%, transparent); }
.ord-pill.stopping { cursor: progress; opacity: 0.6; }

/* ---- the STOP of a draft / a resting order (look C "Risk band", the user's pick): an ink tab on the stop's line,
   [SL][85,316][1.5 ATR · risk −$3.75], the drag handle. The line is a vendor price line in the same ink. ---- */
.ord-sl {
  --ink: #eae5d8;
  --ink-line: rgba(234, 229, 216, 0.55);
  --ink-soft: rgba(234, 229, 216, 0.76);
  position: absolute; left: 0; top: 0; z-index: 8;
  display: inline-flex; align-items: center; gap: 6px;
  height: 20px; padding: 0 7px;
  white-space: nowrap; font-size: 11px; line-height: 1; font-variant-numeric: tabular-nums;
  background: var(--panel); color: var(--ink-soft);
  border: 1px solid var(--border); border-radius: 3px;
  cursor: ns-resize; touch-action: none; user-select: none; -webkit-user-select: none;
}
:root[data-theme="light"] .ord-sl {
  --ink: #2f3440;
  --ink-line: rgba(47, 52, 64, 0.55);
  --ink-soft: rgba(47, 52, 64, 0.82);
}
.ord-sl[hidden] { display: none; }
.ord-sl .k { color: var(--neg); font-weight: 700; font-size: 10px; letter-spacing: 0.6px; }
.ord-sl .px { color: var(--ink); font-weight: 600; }
.ord-sl .mut { color: var(--muted); }
.ord-sl .tob { color: var(--ink); font-size: 9.5px; letter-spacing: 0.3px; }
.ord-sl:hover, .ord-sl.drag { border-color: var(--ink-line); color: var(--ink); }
.ord-sl.draft { border-style: dashed; opacity: 0.85; }
.ord-sl.moving, .ord-sl.placing { cursor: progress; opacity: 0.6; }
/* A chase draft's stop PREVIEW: the server places the real one on the fill — a fixed tab, nothing to drag. */
.ord-sl.chase { cursor: default; }

/* ---- the size popover (opened from the menu's "Size $1,000 · 5x…" row, at the menu's place) ---- */
#ord-size {
  position: absolute; z-index: 41; width: 252px; max-width: calc(100% - 16px); padding: 10px;
  display: flex; flex-direction: column; gap: 9px;
  background: var(--panel); color: var(--fg);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  font-size: 12px;
}
#ord-size[hidden] { display: none; }
.ord-size-h { font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.ord-size-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.ord-size-presets button {
  padding: 4px 0; background: var(--panel-2); color: var(--fg);
  border: 1px solid var(--border); border-radius: 6px;
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.ord-size-presets button:hover { border-color: var(--muted); }
.ord-size-presets button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.ord-size-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ord-size-money {
  display: flex; align-items: center; gap: 4px; width: 132px; height: 28px; padding: 0 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--muted);
}
.ord-size-money:focus-within { border-color: var(--accent); }
.ord-size-money input {
  width: 100%; min-width: 0; border: 0; outline: none; background: transparent; color: var(--fg);
  font: inherit; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums;
}
.ord-size-step { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.ord-size-step button { width: 28px; height: 26px; border: 0; background: var(--panel-2); color: var(--fg); font-size: 14px; cursor: pointer; }
.ord-size-step button:disabled { color: var(--muted); cursor: default; }
.ord-size-step output { min-width: 44px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.ord-size-meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ord-size-meta.err { color: var(--neg); }
.ord-size-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ord-size-rem { color: var(--muted); }
.ord-size-done {
  padding: 5px 14px; background: var(--accent); color: #fff;
  border: 0; border-radius: 6px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
