/* ---------- order book card (markup from web/dom.js) ----------
   bid = cold palette, ask = warm palette (app.js BUY / SELL). Quantities and states only. */
#dom { --bc: 40,110,255; --bt: 181,200,255; --ac: 205,0,0; --at: 255,181,154;   /* base + tint rgb per side */
  font: 11px/1.3 var(--mono); font-variant-numeric: tabular-nums; }
#dom .bid { --c: var(--bc); --t: var(--bt); } #dom .ask { --c: var(--ac); --t: var(--at); }

/* depth head: window segment, two sums, composition bar */
#dom .dh { padding: 2px 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
#dom .dh-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font: 600 11px var(--font); color: var(--muted); }
#dom .dh-top .px { font: 11px var(--mono); letter-spacing: 0; text-transform: none; color: var(--dim); white-space: nowrap; }
#dom .dh-top .tms { white-space: nowrap; }
#dom .dh-top .seg { margin-left: auto; }
#dom .seg button { padding: 2px 9px; font: 11px var(--mono); }
#dom .dh-sum { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
#dom .dh-sum b { font: 500 15px/1.1 var(--mono); color: rgb(var(--t)); }
#dom .dh-sum b small { margin-left: 3px; font: 400 11px var(--mono); color: var(--muted); }
#dom .mix { display: flex; gap: 3px; height: 12px; }
#dom .mix .sd { flex: 1; display: flex; gap: 1px; min-width: 0; border-radius: 3px; overflow: hidden; }   /* each half = 100 % of its side */
#dom .mix .sd.bid { flex-direction: row-reverse; }                 /* Binance next to the centre on both sides */
#dom .mix i { min-width: 0; overflow: hidden; font: 500 11px/12px var(--mono); font-style: normal; text-align: center; white-space: nowrap; color: #fff; }
#dom .mix .x0 { background-color: rgba(var(--c), .85); } #dom .mix .x1 { background-color: rgba(var(--c), .68); } #dom .mix .x2 { background-color: rgba(var(--c), .54); }
#dom .mix .x3 { background-color: rgba(var(--c), .42); } #dom .mix .x4 { background-color: rgba(var(--c), .32); } #dom .mix .x5 { background-color: rgba(var(--c), .24); }   /* fixed shade per venue: BN BY OKX GT BG HL */
#dom .pt { background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(15,20,29,.6) 3px 5px); }   /* covers only part of the window */

/* ladder rows: price | bar (fill = now, frame = 2 min ago) | M$ | event mark */
#dom .r { display: grid; grid-template-columns: 64px 1fr 40px 12px; align-items: center; gap: 0 6px; height: 18px; padding: 0 2px 0 4px; border-radius: 3px; }
#dom .r:hover { background: rgba(255,255,255,.035); }
/* + pulled / stacked column after the price (server tape): stacked = side colour to the right, pulled = grey to the left */
#dom .r.tp { grid-template-columns: 64px 26px 1fr 40px 12px; }
#dom .r .ps { position: relative; height: 10px; background: linear-gradient(90deg, transparent calc(50% - .5px), rgba(255,255,255,.14) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)); }
#dom .r .ps i { position: absolute; top: 1px; bottom: 1px; border-radius: 1px; }
#dom .r .ps .up { left: 50%; background: rgba(var(--t), .95); }
#dom .r .ps .dn { right: 50%; background: rgba(160,168,182,.8); }
/* traded in the last 5 min: a thin strip under the size bar, buys cold blue then sells warm red */
#dom .r .tb, #dom .r .ts { position: absolute; bottom: -5px; height: 3px; border-radius: 1px; }
#dom .r .tb { left: 0; background: rgb(122,162,255); } #dom .r .ts { background: rgb(255,122,92); }
#dom .r .p { color: rgba(var(--t), .9); }
#dom .r .v { text-align: right; color: var(--text); }
#dom .r .t { position: relative; height: 10px; }
#dom .r .f, #dom .r .g { position: absolute; left: 0; border-radius: 2px; }
#dom .r .f { top: 0; bottom: 0; }
#dom .r .g { top: -2px; bottom: -2px; border: 1px solid rgba(var(--t), .5); pointer-events: none; }
#dom .r .m { font-size: 11px; text-align: center; color: #e3c56a; }
#dom .r.in { background: rgba(var(--c), .08); }                    /* row at the touch: exact best price */
#dom .r.in .p { color: rgb(var(--t)); font-weight: 500; }
#dom .r.part .p, #dom .r.part .v { opacity: .55; }
#dom .r .f.pt { background-image: none; opacity: .5; }             /* beyond the common reach (lower bound): dimmed, no hatching */
#dom .bid .q0 { background-color: rgba(40,110,255,.30); } #dom .bid .q1 { background-color: rgba(40,110,255,.42); } #dom .bid .q2 { background-color: rgba(55,105,255,.55); }
#dom .bid .q3 { background-color: rgba(115,105,255,.70); } #dom .bid .q4 { background-color: rgba(180,150,255,.88); }
#dom .ask .q0 { background-color: rgba(205,0,0,.34); } #dom .ask .q1 { background-color: rgba(205,0,0,.46); } #dom .ask .q2 { background-color: rgba(215,20,0,.58); }
#dom .ask .q3 { background-color: rgba(240,75,25,.72); } #dom .ask .q4 { background-color: rgba(255,145,80,.88); }
#dom .cov { display: flex; align-items: center; gap: 6px; height: 12px; padding-left: 4px; font: 11px/1 var(--font); color: var(--dim); }
#dom .cov::before { content: ""; flex: 1; border-top: 1px dashed #2c3648; }   /* common coverage of all books in */

/* spread row: centred pill */
#dom .sp { display: flex; justify-content: center; align-items: center; height: 20px; margin: 3px 0; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); }
#dom .sp .s { padding: 1px 8px; border: 1px solid var(--line2); border-radius: 999px; font: 11px var(--mono); color: var(--muted); }
#dom .sp .s.wide { color: var(--warn); border-color: rgba(245,165,36,.55); background: rgba(245,165,36,.08); }   /* wider than 1 tick */

/* footer: legend + books not in */
#dom .ft { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font: 11px/1.4 var(--font); color: var(--dim); }
#dom .ft:empty { display: none; }                                  /* only books not in (the legend left 2026-11-24) */
#dom .ft .out { color: var(--muted); } #dom .ft .out::before { content: "● "; color: var(--warn); }

/* desktop: the ladder in its own column between the chart and the side bar, as high as the chart (dom.js moves #dom here) */
#domCol { position: relative; width: 262px; flex: none; display: flex; flex-direction: column; min-height: 0; padding: 8px 10px; border-left: 1px solid var(--line); background: var(--bg2); }
#domCol > #dom { flex: 1; min-height: 0; overflow: hidden auto; }
/* crankshaft behind the ladder (crank.js): the column is its own stacking context, the canvas lies under every row */
#domCol { isolation: isolate; }
#domCol > .crank { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none;
  opacity: .35; transition: opacity .3s ease-out; }                  /* opaque steel at 35 % = zone layer, weakest row text >= 4.7:1 */
#domCol > .crank.dim { opacity: .175; }                              /* mouse over the ladder: reading, the engine steps back */
/* view switch under the column (crank.js): DOM only / both / engine only, + engine sound on / off */
#domCol > .crk { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
#domCol > .crk .seg button { padding: 2px 8px; font: 11px var(--font); }
#domCol > .crk .snd { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 22px; margin-left: auto; padding: 0;
  border: 1px solid var(--line2); border-radius: 6px; background: transparent; color: var(--dim); }
#domCol > .crk .snd.on { color: var(--text); } #domCol > .crk .snd[hidden] { display: none; }
#domCol > .crk .snd svg { width: 14px; height: 14px; pointer-events: none; }
/* engine only: the rows step out (spread pill and the head stay), the engine comes forward */
#domCol.crank-only #dom .lad > .r, #domCol.crank-only #dom .lad > .cov, #domCol.crank-only #dom .cum { visibility: hidden; }
#domCol.crank-only > .crank, #domCol.crank-only > .crank.dim { opacity: .85; }
#domCol.crank-only #dom .sp .s { background: var(--bg); }          /* --bg2 is transparent in the new design (web2/neu.css) */
#domCol .dch { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 11px; color: var(--muted); }
#domCol .dch b { font-weight: 600; color: #aab3c2; }
#domCol .dch .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#domCol .dch .seg { margin-left: auto; flex: none; } #domCol .dch .seg button { padding: 2px 8px; font: 11px var(--mono); white-space: nowrap; }
html.nodom #domCol, .phone #domCol { display: none; }
@media (max-width: 1199px) { #domCol, #domBtn { display: none; } }   /* below that the chart would get too narrow */
#domCol .grip { position: absolute; left: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; touch-action: none; z-index: 2; }
#domCol .grip:hover, #domCol .grip:active { background: linear-gradient(90deg, transparent 2px, rgba(45,212,191,.55) 2px 4px, transparent 4px); }

/* time travel (Alt+click on the chart): badge on top of the column = the book of that moment; click = live again */
#dom .ttb { display: block; width: 100%; margin: 0 0 6px; padding: 4px 8px; border: 1px solid rgba(45,212,191,.6); border-radius: 6px;
  background: rgba(45,212,191,.12); font: 600 12px var(--mono); color: rgb(45,212,191); text-align: left; cursor: pointer; }
#dom .ttb b { float: right; font-weight: 400; color: var(--muted); }

/* ---------- fluid ladder (dom.js, user 2026-11-18 'flüssig, sanft, Apple'): lasting rows placed by translateY ----------
   rows slide on a recentre, enter / leave with a fade, bars glide; numbers are always the real value (a short neutral pulse
   on a big change, never a counting tween). Since 2026-11-28 always #dom.still (Sanft removed): hard updates. */
#dom .lad { position: relative; contain: layout; }
#dom .lad > .r, #dom .lad > .cov, #dom .lad > .sp { position: absolute; top: 0; left: 0; right: 0; will-change: transform;
  transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .2s ease-out, background-color .15s ease-out; }
#dom .lad > .new, #dom .lad > .gone { opacity: 0; }
#dom .lad > .gone { pointer-events: none; }
#dom .r:not(.tp) .ps { display: none; }
#dom .r .t { contain: layout; }
#dom .r .f { transition: width .24s ease-out, background-color .3s ease-out; }
#dom .r .g { transition: width .24s ease-out, opacity .2s ease-out; }
#dom .r .tb, #dom .r .ts, #dom .r .ps i { transition: width .24s ease-out, left .24s ease-out; }
#dom .r .v { border-radius: 3px; }
#dom .mix i { transition: flex-grow .3s cubic-bezier(.2,.8,.2,1); }
/* bar bigger than the scale (90 % cap): full width with a bright end cap, the M$ number stays real */
#dom .r .f::after { content: ""; position: absolute; right: -1px; top: -2px; bottom: -2px; width: 2px; border-radius: 1px;
  background: rgb(var(--t)); opacity: 0; transition: opacity .2s ease-out; }
#dom .r .f.ov::after { opacity: 1; }
/* biggest single wall in the zone (radar walls): a white tick across the bar at its size */
#dom .r .lt { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; border-radius: 1px; background: #fff;
  opacity: .85; pointer-events: none; transition: left .24s ease-out, opacity .2s ease-out; }
/* hover: the rows from the mid to the hovered one get a light tint + a floating sum pill (cumulative depth) */
#dom .r.cu { background: rgba(var(--c), .09); }
#dom .cum { position: absolute; top: 0; right: 66px; z-index: 3; height: 18px; padding: 0 8px; border-radius: 6px; pointer-events: none;
  font: 500 11px/18px var(--mono); color: var(--text); background: var(--bg2); opacity: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.10), 0 1px 2px rgba(0,0,0,.25), 0 4px 8px rgba(0,0,0,.20);
  transition: opacity .15s ease-out, transform .2s cubic-bezier(.2,.8,.2,1); }
#dom .cum.on { opacity: 1; }
/* mouse over the ladder: it stands still - the spread pill says so */
#dom.frz .sp .s { border-color: rgba(45,212,191,.6); color: rgb(45,212,191); }
#dom.frz .sp .s::before { content: "⏸ "; }
#dom.still *, #dom.still .lad > * { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) { #dom *, #dom .lad > * { transition: none !important; animation: none !important; } }

/* ---------- pressure pillars (pillars.js, user 2026-11-26): the 4th view of the switch ----------
   rows and spread step out (the head stays); canvas = tracks, pillars, glow; DOM = labels, "where" pills, tooltips */
#domCol > .crk { flex-wrap: wrap; row-gap: 4px; }                    /* 4 views + sound: the sound button wraps on a narrow column */
#domCol > .pillars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
#domCol:not(.pil-only) > .pillars { display: none; }                 /* another view: no last picture left behind the rows */
#domCol.pil-only #dom .lad, #domCol.pil-only #dom .cum { visibility: hidden; }
#domCol > .pil { display: none; position: absolute; inset: 0; pointer-events: none; }
#domCol.pil-only > .pil { display: block; }
#domCol > .pil .bid { --t: 181,200,255; } #domCol > .pil .ask { --t: 255,181,154; }
#domCol > .pil .ps { position: absolute; pointer-events: auto; }
#domCol > .pil .pp { position: absolute; left: 50%; top: 0; height: 18px; padding: 0 7px; border-radius: 9px; font: 500 11px/18px var(--mono);
  font-style: normal; font-variant-numeric: tabular-nums; white-space: nowrap; color: rgb(var(--t)); background: var(--bg);
  box-shadow: 0 0 0 1px rgba(var(--t), .35), 0 2px 6px rgba(0,0,0,.35); opacity: 0; transition: opacity .2s ease-out; }
#domCol > .pil .pp.on { opacity: 1; }
#domCol > .pil .pl { position: absolute; left: 0; right: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
#domCol > .pil .pl b { font: 600 11px/14px var(--font); color: var(--muted); }
#domCol > .pil .pl span { font: 500 13px/16px var(--mono); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
#domCol > .pil .lead .pl b, #domCol > .pil .lead .pl span { color: rgb(var(--t)); transition: color .3s ease-out; }
#domCol > .pil .stk { position: absolute; left: 0; top: 0; font: 11px/14px var(--font); font-style: normal; color: var(--dim); }
#domCol > .pil .pl, #domCol > .pil .stk { text-shadow: 0 0 2px var(--bg2), 0 0 5px var(--bg2), 0 0 8px var(--bg2); }   /* readable over the price line */
