/* Draw a trade (draw-trade.js): the overlay on the Trade page's chart, its chips, and the order card's Draw view. */
.dwcv { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; }
.dwzone { position: absolute; top: 0; z-index: 4; cursor: crosshair; touch-action: none; outline: none; }
.dwzone[hidden] { display: none; }
.dwzone:focus-visible { box-shadow: inset 0 0 0 2px rgba(244, 244, 245, 0.5); border-radius: 6px; }
.dwmodes { position: absolute; top: 4px; left: 0; z-index: 5; display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: #0c0c0e; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10); }
.dwmodes[hidden], .dwhz[hidden], html.rh .chfoot .rng[hidden] { display: none !important; }
.dwmodes button, .dwhz button { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: #8a8d95; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
@media (hover: hover) { .dwmodes button:hover, .dwhz button:hover { color: #fff; } }
.dwmodes button.on, .dwhz button.on { background: #121214; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5); color: #fff; font-weight: 600; }
.dwmodes button:disabled { opacity: 0.4; cursor: default; }
.dwhz { display: inline-flex; gap: 2px; margin: 6px 0; padding: 2px; border-radius: 999px; background: #0c0c0e; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10); }
.dwbtn { display: inline-flex; align-items: center; gap: 6px; height: 32px; margin-left: auto; margin-right: 16px; padding: 0 14px; border: 0; border-radius: 999px; background: #0c0c0e; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); }
@media (hover: hover) { .dwbtn:hover { background: #121214; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); } }
/* Done: the app's white primary, never the chart's direction colour (red read as sell / danger) */
.dwbtn.on { background: #fff; color: #000; box-shadow: none; }
.dwbtn svg { width: 14px; height: 14px; }
/* the card's Draw view */
.dwlead { font-size: 14px; line-height: 20px; color: #fff; }
.dwhow { margin: 0 0 8px; padding: 0; list-style: none; font-size: 13px; line-height: 18px; color: #b3b5bb; }
.dwhow li { padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.dwhow b { color: #fff; font-weight: 600; }
.dwamts { margin: 0; }
.dwfine { margin-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.dwfine summary { padding: 12px 0 4px; font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; list-style: none; }
.dwfine summary::-webkit-details-marker { display: none; }
.dwfine summary::after { content: " +"; color: #8a8d95; }
.dwfine[open] summary::after { content: " −"; }
.dwadjb { display: flex; flex-direction: column; gap: 10px; padding: 8px 0 4px; }
.dwlanes { display: flex; flex-wrap: wrap; gap: 6px; }
.dwstep { display: grid; grid-template-columns: 1fr 32px auto 32px; align-items: center; gap: 8px; font-size: 13px; }
.dwstep span { color: #b3b5bb; }
.dwstep b { min-width: 90px; text-align: center; font-weight: 600; }
.dwstep button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #121214; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); color: #fff; font: inherit; font-size: 16px; cursor: pointer; }
@media (hover: hover) { .dwstep button:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); } }
@media (max-width: 700px) {
  .dwbtn { margin-right: 0; height: 36px; }
  .dwmodes { left: 0; right: 0; justify-content: space-between; }
  .dwmodes button { padding: 0 8px; font-size: 12px; flex: 1; }
  .dwhz { flex: 1; }
  .dwhz button { flex: 1; padding: 0 6px; font-size: 12px; }
  html.rh body.dw-on .chfoot .rng { display: none; }
  /* drawing on a phone: a taller chart, the What wins chips above it rather than over the plot */
  /* round 21: sized from the room left above the review bar and the tab bar (a fixed 320px ran 47px under the bar at 320x640,
     119px at 320x568), so the time axis and the horizon tabs under the chart stay in view */
  html.rh body.dw-on .chartwrap, html.rh body.dw-on .chartwrap #chart { height: 320px; height: clamp(150px, calc(100vh - 230px - var(--bbar-h, 60px) - var(--rhbar-h, 77px) - 66px), 320px); height: clamp(150px, calc(100dvh - 230px - var(--bbar-h, 60px) - var(--rhbar-h, 77px) - 66px), 320px); }
  html.rh body.dw-on .chartwrap { margin-top: 56px; }
  body.dw-on .dwmodes { top: -46px; }
  .dwstep button { width: 40px; height: 40px; }
  .dwstep { grid-template-columns: 1fr 40px auto 40px; }
}
/* a small phone (320–380): the range tabs give way and Draw keeps only its pencil, so the row never pushes the page past the screen */
@media (max-width: 479px) { /* round 10: the range tabs are words, so Draw is its icon up to 479px */
  html.rh .chfoot { gap: 6px; }
  html.rh .chfoot .rng { min-width: 0; }
  html.rh .chfoot .rng button, html.rh.tk-simple .chfoot .rng button { min-width: 0; padding: 0 5px; letter-spacing: 0.06em; }
  .dwbtn { flex: none; width: 36px; padding: 0; justify-content: center; }
  .dwbtn span { display: none; } /* the button keeps its name: aria-label="Draw" (draw-trade.js) */
  /* four What wins chips: tighter, so Target + stop stays on screen at 320-479px */
  .dwmodes { gap: 0; }
  .dwmodes button { flex: 1 1 auto; padding: 0 4px; font-size: 11.5px; letter-spacing: -0.01em; }
}
@media (max-width: 359px) { .dwmodes button { font-size: 10.5px; padding: 0 3px; } }
/* Target + stop: the card's levels in the trade colours, a quote above the risk in amber, the short notice */
.rhr > b.down { color: var(--ob-down); }
.rhmsg.warn { color: var(--ob-amber); }
.dwkofix:empty { display: none; }
.dwkofix { margin: 0 0 8px; }
.dwshort { margin: 0 0 4px; font-size: 13px; line-height: 18px; color: #d4d4d8; }
.dwfix { margin: 0; }
.rhpill.is-placed:disabled { opacity: 1; background: var(--ob-ok, #34d399); color: #000; }
