/* order book and trades board */
.ob-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 14px; }
.ob-top .grow { flex: 1; }
.ob-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.ob-conn { white-space: nowrap; }

/* symbol picker */
.ob-pick { position: relative; }
.ob-cur { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); font-size: 15px; max-width: 100%; }
.ob-cur:hover { border-color: var(--text-3); }
.ob-cur b { font-weight: 680; letter-spacing: -.01em; white-space: nowrap; }
.ob-cur small { color: var(--text-3); font-size: 12.5px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 14em; }
.ob-cur > .i { width: 14px; height: 14px; color: var(--text-3); }
.ob-cb { display: inline-grid; }
.ob-cb img, .ob-cb .cbadge { width: 22px; height: 22px; border-radius: 50%; }
.ob-dd { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: min(420px, calc(100vw - 2 * var(--gut))); padding: 10px; display: grid; gap: 8px; background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 60px -20px rgba(10, 6, 16, .38); }
.ob-dd[hidden] { display: none; }
.ob-dd .search-in { min-width: 0; }
.ob-res { max-height: min(56vh, 420px); overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.ob-it { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; text-align: left; width: 100%; }
.ob-it:hover, .ob-it[aria-selected="true"] { background: var(--bg-soft); }
.ob-it img, .ob-it .cbadge { width: 22px; height: 22px; border-radius: 50%; }
.ob-in { display: grid; min-width: 0; line-height: 1.3; }
.ob-in b { font-size: 14px; font-weight: 650; }
.ob-in small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-ip { display: grid; justify-items: end; font-size: 13px; line-height: 1.3; }
.ob-ip em { font-style: normal; font-size: 12px; font-weight: 600; }
.ob-empty { padding: 18px; text-align: center; color: var(--text-3); font-size: 14px; }

.ob-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 16px; }
.ob-stats .sv { font-size: 21px; }
.ob-stats .ss { overflow-wrap: anywhere; }

/* three columns: book, depth and imbalance, trades */
.ob-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); grid-template-areas: "book center tape"; gap: 16px; align-items: start; }
.ob-book { grid-area: book; }
.ob-center { grid-area: center; display: grid; gap: 16px; min-width: 0; }
.ob-tape { grid-area: tape; }
.board > .ob-main + .grid { margin-top: 16px; }

/* book */
.ob-f { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.ob-f .sel { height: 32px; font-size: 13.5px; }
.ob-bh, .ob-r { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.ob-bh { padding: 10px 16px 6px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.ob-bh span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-bh .r, .ob-q, .ob-t { text-align: right; }
.ob-side { display: grid; padding: 0 8px; }
.ob-r { position: relative; height: 24px; padding: 0 8px; font-size: 13px; border-radius: 4px; }
.ob-r > span { position: relative; z-index: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-t { color: var(--text-3); }
.ob-r .ob-bar { position: absolute; top: 2px; bottom: 2px; right: 0; width: 0; border-radius: 3px; transition: width .25s var(--ease); }
.ob-asks .ob-bar { background: var(--down-soft); }
.ob-bids .ob-bar { background: var(--up-soft); }
.ob-asks .ob-p { color: var(--down); }
.ob-bids .ob-p { color: var(--up); }
.ob-r.wall { background: color-mix(in oklab, var(--amber) 18%, transparent); }
.ob-r.wall span { font-weight: 700; }
.ob-r.wall .ob-t { color: var(--text-2); }
html[data-motion="off"] .ob-r .ob-bar { transition: none; }
.ob-midrow { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin: 6px 8px; padding: 8px 8px; border-block: 1px solid var(--line); }
.ob-midrow b { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.ob-midrow span { font-size: 12.5px; color: var(--text-3); }
.ob-ratio { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 16px 14px; font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ob-rbar, .ob-fbar, .ob-bbar { display: flex; border-radius: 4px; overflow: hidden; background: var(--bg-sunk); }
.ob-rbar { height: 6px; }
.ob-rbar i, .ob-fbar i, .ob-bbar i { display: block; height: 100%; flex: none; transition: width .4s var(--ease); }
.ob-rbar .b, .ob-fbar .b, .ob-bbar .b { background: var(--up); }
.ob-rbar .a, .ob-fbar .a, .ob-bbar .a { background: var(--down); }
html[data-motion="off"] .ob-rbar i, html[data-motion="off"] .ob-fbar i, html[data-motion="off"] .ob-bbar i { transition: none; }

/* depth chart */
.ob-depth .panel-h, .ob-imb .panel-h { flex-wrap: wrap; row-gap: 10px; }
.ob-depth .panel-h h2, .ob-imb .panel-h h2 { white-space: nowrap; }
.ob-depth .chart-box .cv { position: absolute; inset: 8px 10px 12px; }
.ob-depth .cv canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.ob-tip { position: absolute; z-index: 3; display: grid; gap: 2px; min-width: 160px; padding: 8px 10px; border-radius: 9px; background: var(--bg-raised); border: 1px solid var(--line-strong); font-size: 12.5px; line-height: 1.45; pointer-events: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ob-tip[hidden] { display: none; }
.ob-tip b { font-weight: 650; }
.lg-bid { background: var(--up); }
.lg-ask { background: var(--down); }
.lg-wall { background: var(--amber-deep); border-radius: 50% !important; }
.lg-ref { background: transparent; height: 0 !important; border-top: 2px dashed var(--text-2); vertical-align: 3px !important; }
.lg-gap { background: var(--bg-sunk); border: 1px solid var(--line-strong); }

/* imbalance bands */
.ob-bands { display: grid; gap: 12px; }
.ob-band { display: grid; grid-template-columns: 50px 72px minmax(0, 1fr) 72px 40px; align-items: center; gap: 10px; font-size: 13px; }
.ob-band.off { grid-template-columns: 50px minmax(0, 1fr); }
.ob-bl { font-weight: 650; color: var(--text-2); }
.ob-bv { text-align: right; font-weight: 620; }
.ob-av { font-weight: 620; }
.ob-bbar { height: 12px; }
.ob-bs { text-align: right; color: var(--text-2); font-weight: 650; }
.ob-boff { color: var(--text-3); font-size: 12.5px; line-height: 1.45; }

/* trades */
.ob-tape .panel-h .sp { gap: 6px; }
.ob-tape .chip .i { width: 15px; height: 15px; }
.ob-flow { display: grid; gap: 9px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ob-fr { display: grid; grid-template-columns: minmax(0, 1.1fr) 60px minmax(0, 1fr) 60px 48px; gap: 8px; align-items: center; font-size: 12.5px; }
.ob-fl { color: var(--text-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-fv { font-weight: 620; white-space: nowrap; }
.ob-fv.up { text-align: right; }
.ob-fbar { height: 8px; }
.ob-fs { text-align: right; font-weight: 680; white-space: nowrap; }
.ob-fnote { margin: 0; line-height: 1.45; }
.ob-tbar { padding: 10px 16px; }
.ob-twrap { max-height: 600px; min-height: 360px; overflow: auto; }
.ob-ttbl td { padding-top: 5px; padding-bottom: 5px; font-size: 13px; }
.ob-ttbl th { padding-top: 8px; padding-bottom: 8px; }
.ob-ttbl .ob-tt { color: var(--text-3); font-size: 12.5px; }
.ob-ttbl tr.big td { font-weight: 700; }
.ob-ttbl tr.big.ob-B { background: var(--up-soft); }
.ob-ttbl tr.big.ob-S { background: var(--down-soft); }
.ob-ttbl tr.ob-new.ob-B:not(.big) { animation: ob-in-b 1.2s var(--ease); }
.ob-ttbl tr.ob-new.ob-S:not(.big) { animation: ob-in-s 1.2s var(--ease); }
@keyframes ob-in-b { 0% { background-color: var(--up-soft); } 100% { background-color: transparent; } }
@keyframes ob-in-s { 0% { background-color: var(--down-soft); } 100% { background-color: transparent; } }
html[data-motion="off"] .ob-ttbl tr.ob-new { animation: none; }

/* walls and the market order preview */
.ob-walls { display: flex; flex-direction: column; }
.ob-wgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 1; }
.ob-wcol { padding: 14px 18px 16px; min-width: 0; }
.ob-wcol + .ob-wcol { border-left: 1px solid var(--line); }
.ob-wh { font-size: 14px; font-weight: 650; margin: 0 0 6px; }
.ob-wl { display: grid; }
.ob-w { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 58px minmax(64px, .8fr); gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ob-w:last-child { border-bottom: 0; }
.ob-whd { padding: 4px 0 6px; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.ob-whd span:not(:first-child) { text-align: right; }
.ob-w > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-wp { font-weight: 650; }
.ob-wv, .ob-wd, .ob-wm { text-align: right; }
.ob-wd { color: var(--text-3); }
.ob-wm { color: var(--text-2); }
.ob-wm.hi { color: var(--accent-ink); font-weight: 700; }
.ob-simb { display: grid; gap: 14px; }
.ob-simin { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; }
.ob-amt { display: grid; gap: 6px; font-size: 13px; font-weight: 620; color: var(--text-2); flex: 1 1 190px; min-width: 0; }
.ob-amt .inp { height: 40px; }
.ob-amt .inp input { font-size: 15px; }
.ob-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.ob-simres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ob-simres .res { padding: 12px 14px; }
.ob-simres .rv { font-size: 20px; }
.ob-simnote { margin: 0; line-height: 1.55; }

/* same coin elsewhere */
.ob-cmpstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ob-cmpstats[hidden] { display: none; }
.ob-cs { display: grid; gap: 2px; padding: 10px 14px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--line); }
.ob-cs .sl { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.ob-cs .num { font-size: 19px; font-weight: 680; letter-spacing: -.01em; }
.ob-cm { display: inline-flex; align-items: center; gap: 8px; }
.ob-cm img { width: 16px; height: 16px; border-radius: 4px; }
.ob-ctbl tr.self td { font-weight: 650; }
.ob-cmp .panel-h { flex-wrap: wrap; row-gap: 6px; }
.ob-cmp .panel-h .sp { text-align: right; }
.ob-ctbl td .pill { min-width: 70px; justify-content: center; }

@media (max-width: 1180px) {
  .ob-main { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "book tape" "center center"; }
  .ob-center { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  .ob-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .ob-center { grid-template-columns: minmax(0, 1fr); }
  .ob-lower { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ob-main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "book" "center" "tape"; }
  .ob-twrap { max-height: 460px; min-height: 280px; }
}
@media (max-width: 560px) {
  .ob-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ob-stats .sv { font-size: 19px; }
  .ob-pick { flex: 1 1 100%; }
  .ob-cur { width: 100%; }
  .ob-cur > .i { margin-left: auto; }
  .ob-top > .seg { flex: 1 1 100%; }
  .ob-top > .seg button { flex: 1; padding: 0 8px; }
  .ob-conn { display: none; }
  .ob-band { grid-template-columns: 44px 62px minmax(0, 1fr) 62px 36px; gap: 7px; font-size: 12.5px; }
  .ob-band.off { grid-template-columns: 44px minmax(0, 1fr); }
  .ob-fr { grid-template-columns: minmax(0, 1fr) 56px minmax(0, .8fr) 56px 46px; gap: 6px; font-size: 12px; }
  .ob-wgrid { grid-template-columns: minmax(0, 1fr); }
  .ob-wcol + .ob-wcol { border-left: 0; border-top: 1px solid var(--line); }
  .ob-simres { gap: 8px; }
  .ob-simres .res { padding: 10px 12px; }
  .ob-simres .rv { font-size: 16.5px; }
  .ob-simres .rs { font-size: 12px; }
  .ob-ttbl th, .ob-ttbl td { padding-left: 8px; padding-right: 8px; }
  .ob-ctbl th:nth-child(2), .ob-ctbl td:nth-child(2), .ob-ctbl th:nth-child(3), .ob-ctbl td:nth-child(3) { display: none; }
}
