/* ---------- trading view ---------- */
:root {
  --up-tx: #5BAE85;   /* book-up lifted for text on ink */
  --dn-tx: #CF6A5F;   /* book-down lifted for text on ink */
  --up-bg: rgb(62 143 106 / .14);
  --dn-bg: rgb(169 72 63 / .14);
  --up-bar: rgb(62 143 106 / .13);
  --dn-bar: rgb(169 72 63 / .13);
}
body.has-term { overflow: hidden; }
.term {
  --mk-w: 248px; --ob-w: 300px; --tk-w: 320px; --dock-h: 248px;
  --top-h: 56px; --hd-h: 36px; --rowh: 20px;
  position: fixed; inset: 0; z-index: 65; display: flex; flex-direction: column;
  background: var(--ink); color: var(--bone); font: 400 13px/1.35 var(--font);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  animation: fade-in 200ms var(--ease);
  -webkit-font-smoothing: antialiased;
}
.term:focus { outline: none; }
.term [hidden] { display: none !important; }
.term .num { font-variant-numeric: tabular-nums; letter-spacing: -0.005em; }
.term .mono { font-family: var(--mono); }
.term .is-up { color: var(--up-tx); }
.term .is-dn { color: var(--dn-tx); }
.tt-dim { color: var(--ash); }
:where(.term) button { border: 0; background: none; color: inherit; font: inherit; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:where(.term) button:disabled { cursor: default; }
:where(.term) input { -webkit-appearance: none; appearance: none; border: 0; border-radius: 0; background: none; color: inherit; font: inherit; caret-color: var(--uv); min-width: 0; }
.term input::-webkit-outer-spin-button, .term input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.term input::placeholder { color: var(--mute); }
.term :focus { outline: none; }
.term :focus-visible { outline: 1.5px solid var(--uv); outline-offset: 1px; border-radius: var(--r-s); }
.term input:focus, .term input:focus-visible { outline: none !important; box-shadow: none; }
.term ::selection { background: rgb(143 200 255 / .3); color: var(--bone); }
.term, .term * { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.term ::-webkit-scrollbar { width: 6px; height: 6px; }
.term ::-webkit-scrollbar-track { background: transparent; }
.term ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }
.term ::-webkit-scrollbar-thumb:hover { background: var(--mute); }
.term .ic { flex: none; display: block; }
.tt-badge {
  display: inline-flex; align-items: center; height: 16px; padding: 0 5px; border-radius: 3px;
  background: var(--ink-4); color: var(--ash); font-size: 10.5px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1;
}
.tt-empty { padding: 24px 16px; text-align: center; color: var(--ash); font-size: 12.5px; }

/* coin badge */
.tt-ico {
  position: relative; flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; overflow: hidden;
  background: hsl(var(--hue, 0) 28% 22%); color: hsl(var(--hue, 0) 45% 78%); font-size: 10.5px; font-weight: 600; line-height: 1;
}
.tt-ico b { font-weight: inherit; }
.tt-ico img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; opacity: 0; transition: opacity 160ms; }
.tt-ico img.is-in { opacity: 1; }
.tt-ico:has(img.is-in) { background: #E4E1DA; } /* a light disc: logos drawn for light grounds (ETH) stay legible */
.tt-ico:has(img.is-in) b { visibility: hidden; }
.tt-hue0 { --hue: 0; } .tt-hue1 { --hue: 30; } .tt-hue2 { --hue: 60; } .tt-hue3 { --hue: 90; } .tt-hue4 { --hue: 120; } .tt-hue5 { --hue: 150; } .tt-hue6 { --hue: 180; } .tt-hue7 { --hue: 210; } .tt-hue8 { --hue: 240; } .tt-hue9 { --hue: 270; } .tt-hue10 { --hue: 300; } .tt-hue11 { --hue: 330; }

/* icon button + tooltip */
.tt-ib {
  position: relative; flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-m);
  color: var(--ash); transition: color 120ms, background-color 120ms, transform 100ms;
}
.tt-ib:hover { color: var(--bone); background: var(--ink-3); }
.tt-ib:active { transform: scale(.96); }
.tt-ib[aria-pressed="true"] { color: var(--bone); background: var(--ink-3); }
.tt-ib--s { width: 30px; height: 30px; }
.tt-ib--star[aria-pressed="true"] { color: #E7C66A; background: var(--ink-3); }
.tt-ib--star[aria-pressed="true"] .ic { fill: currentColor; }
.tt-ib--xs { width: 22px; height: 22px; border-radius: var(--r-s); }
.tt-ib--xs .ic { width: 13px; height: 13px; }
.tt-tip {
  position: fixed; z-index: 80; padding: 4px 8px; border-radius: var(--r-s); background: var(--ink-4); border: 1px solid var(--line-2); color: var(--bone);
  font-size: 11.5px; font-weight: 400; white-space: nowrap; pointer-events: none; animation: tt-tip 120ms var(--ease);
}
@keyframes tt-tip { from { opacity: 0; } }

/* ---------- site header ---------- */
.tt-site {
  flex: none; display: flex; align-items: center; gap: 28px; height: 48px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); min-width: 0;
}
.tt-brand { flex: none; display: inline-flex; align-items: center; height: 32px; padding: 0 4px; border-radius: var(--r-s); }
.tt-brand img { display: block; height: 16px; width: auto; }
.tt-nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tt-nav button {
  height: 32px; padding: 0 12px; border-radius: var(--r-m); color: var(--ash); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: color 120ms, background-color 120ms;
}
.tt-nav button:hover { color: var(--bone); background: var(--ink-3); }
.tt-nav button[aria-current="page"] { color: var(--bone); background: var(--ink-3); cursor: default; }
.tt-site__r { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.tt-only-phone { display: none; }

/* ---------- market bar ---------- */
.tt-top {
  flex: none; display: flex; align-items: center; gap: 4px; height: var(--top-h); padding: 0 12px 0 8px;
  border-bottom: 1px solid var(--line); min-width: 0;
}
.tt-mkb {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 8px; margin-left: 4px; border-radius: var(--r-l);
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; transition: background-color 120ms;
}
.tt-mkb:hover, .tt-mkb[aria-expanded="true"] { background: var(--ink-3); }
.tt-mkb .tt-ico { width: 24px; height: 24px; font-size: 12px; }
.tt-mkb__chev { color: var(--ash); transition: transform 160ms var(--ease); }
.tt-mkb[aria-expanded="true"] .tt-mkb__chev { transform: rotate(180deg); }
.tt-hpx { flex: none; padding: 0 18px 0 10px; }
.tt-digits { display: inline-flex; height: 24px; font-size: 20px; font-weight: 600; line-height: 24px; letter-spacing: -0.02em; color: var(--bone); transition: color 260ms; }
.tt-digits.is-tu { color: var(--up-tx); }
.tt-digits.is-td { color: var(--dn-tx); }
.dg { position: relative; display: inline-block; height: 24px; overflow: hidden; }
.dg-sz { visibility: hidden; }
.dg-col { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; transition: transform 380ms var(--ease); will-change: transform; }
.dg-col span { height: 24px; }
.dg-ch { display: inline-block; }
.tt-stats { display: flex; align-items: center; gap: 26px; margin: 0; min-width: 0; overflow: hidden; }
.tt-stats > div { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.tt-stats dt { color: var(--ash); font-size: 11px; line-height: 14px; }
.tt-stats dd { margin: 0; font-size: 12.5px; line-height: 16px; }
.tt-acct {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; margin-right: 4px; border-radius: var(--r-m);
  border: 1px solid var(--line); font-size: 12.5px; white-space: nowrap; transition: border-color 120ms, background-color 120ms;
}
.tt-acct:hover, .tt-acct[aria-expanded="true"] { border-color: var(--line-2); background: var(--ink-3); }
.tt-acct__n { font-weight: 500; }
.tt-acct__a { color: var(--ash); font-size: 11.5px; }
.tt-acct__eq { padding-left: 8px; border-left: 1px solid var(--line); }
.tt-acct__eq:empty { display: none; }
.tt-acct__chev { width: 12px; height: 12px; color: var(--ash); transition: transform 160ms var(--ease); }
.tt-acct[aria-expanded="true"] .tt-acct__chev { transform: rotate(180deg); }
.tt-open {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; margin-right: 4px; border-radius: var(--r-m);
  background: var(--uv); color: var(--on-uv); font-size: 12.5px; font-weight: 500; white-space: nowrap; transition: filter 120ms, transform 120ms;
}
.tt-open:hover { filter: brightness(1.1); }
.tt-open:active { transform: scale(.96); }

/* first paint: skeletons until the markets and the book arrive */
.term.is-boot .tt-stats dd, .term.is-boot .tt-digits, .term.is-nobook .tt-obr > span::before {
  border-radius: 4px; background: linear-gradient(90deg, var(--ink-3), var(--line-2), var(--ink-3)); background-size: 200% 100%; animation: tt-shim 1.2s linear infinite;
}
.term.is-boot .tt-stats dd { color: transparent; min-width: 64px; }
.term.is-boot .tt-stats dd * { visibility: hidden; }
.term.is-boot .tt-digits { display: inline-block; min-width: 112px; min-height: 18px; color: transparent; }
.term.is-boot .tt-digits * { visibility: hidden; }
.term.is-nobook .tt-obr > span::before { content: ""; display: inline-block; width: 70%; height: 8px; vertical-align: middle; }

/* ---------- main grid ---------- */
.tt-main {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: 0 0 minmax(0, 1fr) 1px var(--tk-w);
}
.tt-main.has-mkts { grid-template-columns: var(--mk-w) 1px minmax(0, 1fr) 1px var(--tk-w); }
.tt-main:not(.has-mkts) > .tt-mkts, .tt-main:not(.has-mkts) > [data-g="mk"] { display: none; }
/* explicit tracks: a hidden pane never shifts the others */
.tt-main > .tt-mkts { grid-column: 1; grid-row: 1; }
.tt-main > [data-g="mk"] { grid-column: 2; grid-row: 1; }
.tt-main > .tt-work { grid-column: 3; grid-row: 1; }
.tt-main > [data-g="tk"] { grid-column: 4; grid-row: 1; }
.tt-main > .tt-tk { grid-column: 5; grid-row: 1; }
.tt-up > .tt-chart { grid-column: 1; grid-row: 1; }
.tt-up > [data-g="ob"] { grid-column: 2; grid-row: 1; }
.tt-up > .tt-side { grid-column: 3; grid-row: 1; }
.tt-work { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) 1px var(--dock-h); }
.tt-up { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 1px var(--ob-w); }
.tt-up > .tt-views { display: none; }

/* gutters: a 1px hairline with a wider hit area */
.tt-g { position: relative; z-index: 6; background: var(--line); touch-action: none; transition: background-color 140ms; }
.tt-g::before { content: ""; position: absolute; inset: 0 -4px; }
.tt-g--r::before { inset: -4px 0; }
.tt-g--c { cursor: col-resize; }
.tt-g--r { cursor: row-resize; }
.tt-g:hover { background: rgb(143 200 255 / .55); transition-delay: 90ms; }
.tt-g:active, .tt-g:focus-visible { background: var(--uv); outline: none; transition-delay: 0ms; }
.is-resizing * { user-select: none; }
.is-resizing iframe, .is-resizing canvas { pointer-events: none; }
.is-resizing-c, .is-resizing-c * { cursor: col-resize !important; }
.is-resizing-r, .is-resizing-r * { cursor: row-resize !important; }
.is-resizing .tt-obr__bar { transition: none; }

/* tabs (text with an underline) */
.tt-tabs { display: flex; align-items: stretch; gap: 18px; height: var(--hd-h); }
.tt-tabs > button {
  position: relative; display: inline-flex; align-items: center; gap: 6px; color: var(--ash); font-size: 12.5px; font-weight: 500;
  white-space: nowrap; transition: color 120ms;
}
.tt-tabs > button:hover { color: var(--bone); }
.tt-tabs > button[aria-selected="true"], .tt-tabs > button[aria-checked="true"] { color: var(--bone); }
.tt-tabs > button::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px; background: var(--bone);
  transform: scaleX(0); transition: transform 200ms var(--ease);
}
.tt-tabs > button[aria-selected="true"]::after, .tt-tabs > button[aria-checked="true"]::after { transform: scaleX(1); }
.tt-n:not(:empty) {
  display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--ink-4); color: var(--bone); font-size: 10.5px; font-variant-numeric: tabular-nums;
}

/* chips + menus */
.tt-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 26px; min-width: 52px; padding: 0 7px 0 9px; border-radius: var(--r-s);
  background: var(--ink-3); color: var(--bone); font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; transition: background-color 120ms;
}
.tt-chip:hover, .tt-chip[aria-expanded="true"] { background: var(--ink-4); }
.tt-chip .ic { width: 12px; height: 12px; color: var(--ash); }
.tt-chip--t { padding: 0 10px; color: var(--ash); }
.tt-chip--t[aria-pressed="true"] { color: var(--bone); background: var(--ink-4); box-shadow: inset 0 0 0 1px var(--line-2); }
.tt-pop {
  position: fixed; z-index: 60; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r-xl);
  box-shadow: 0 16px 40px rgb(0 0 0 / .55), 0 2px 6px rgb(0 0 0 / .4);
  animation: tt-pop 150ms var(--ease);
}
@keyframes tt-pop { from { opacity: 0; transform: translateY(-4px); } }
.tt-menu { padding: 4px; min-width: 96px; }
.tt-menu__i { display: flex; width: 100%; height: 28px; align-items: center; justify-content: flex-end; padding: 0 10px; border-radius: var(--r-s); color: var(--ash); font-size: 12px; }
.tt-menu__i:hover, .tt-menu__i:focus-visible { background: var(--ink-3); color: var(--bone); outline: none; }
.tt-menu__i[aria-selected="true"] { color: var(--bone); background: var(--ink-4); }
.tt-menu__i--l { justify-content: space-between; gap: 16px; height: 32px; font-size: 12.5px; color: var(--bone); white-space: nowrap; }
.tt-menu__i--l .tt-dim { font-size: 11.5px; }
.tt-menu__i[aria-current="page"] { background: var(--ink-3); }
.tt-menu__sep { height: 1px; margin: 4px 6px; background: var(--line); }
.tt-menu--acct, .tt-menu--nav { min-width: 220px; }
.tt-menu--acct { min-width: 300px; }
.tt-menu__i--acct { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; height: 34px; color: var(--bone); font-size: 12.5px; text-align: left; }
.tt-menu__i--acct .mono { font-size: 11.5px; }
.tt-menu__eq { min-width: 64px; text-align: right; }
.tt-menu__eq.is-wait::before { content: ""; display: inline-block; width: 44px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--ink-3), var(--line-2), var(--ink-3)); background-size: 200% 100%; animation: tt-shim 1.2s linear infinite; }

/* search field */
.tt-search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: var(--r-m);
  background: var(--ink-3); color: var(--ash); border: 1px solid transparent; transition: border-color 120ms;
}
.tt-search:focus-within { border-color: rgb(143 200 255 / .6); background: var(--ink-2); }
.tt-search .ic { width: 14px; height: 14px; }
.tt-search input { flex: 1; height: 100%; color: var(--bone); font-size: 12.5px; }

/* ---------- markets list + picker rows ---------- */
.tt-mkts { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.tt-mkts__h { display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px; }
.tt-mkg { display: flex; gap: 4px; padding: 0 10px 6px; }
.tt-mkg .tt-chip { height: 24px; font-size: 11.5px; }
.tt-pick__g { padding: 8px 10px 0; }
/* builder group tag next to a market name: outlined, so it never reads as the leverage badge */
.tt-dex {
  display: inline-flex; align-items: center; height: 15px; padding: 0 4px; border-radius: 3px; flex: none;
  box-shadow: inset 0 0 0 1px var(--line-2); color: var(--mute); font-size: 9.5px; font-weight: 600; letter-spacing: .04em; line-height: 1;
}
.tt-mkb__c .tt-dex { margin-left: 6px; vertical-align: 2px; }
.tt-mkts__cols { display: flex; justify-content: space-between; padding: 4px 12px 6px 40px; }
.tt-mkts__cols button { color: var(--mute); font-size: 11px; transition: color 120ms; }
.tt-mkts__cols button:hover { color: var(--ash); }
.tt-mkts__cols button[aria-pressed="true"] { color: var(--bone); }
.tt-mkts__l { flex: 1; min-height: 0; overflow-y: auto; padding: 0 4px 8px; overscroll-behavior: contain; }
.tt-mr {
  display: grid; grid-template-columns: 20px 20px minmax(0, 1fr) auto; align-items: center; gap: 0 8px;
  height: 46px; padding: 0 8px 0 4px; border-radius: var(--r-m); cursor: pointer; transition: background-color 100ms;
}
.tt-mr:hover, .tt-mr.is-at { background: var(--ink-3); }
.tt-mr.is-sel { background: var(--ink-3); box-shadow: inset 2px 0 0 var(--uv); }
.tt-star { display: grid; place-items: center; width: 20px; height: 20px; color: var(--mute); border-radius: 3px; transition: color 120ms; }
.tt-star .ic { width: 13px; height: 13px; }
.tt-star:hover { color: var(--ash); }
.is-fav .tt-star { color: #E7C66A; }
.is-fav .tt-star .ic { fill: currentColor; }
.tt-mr__n, .tt-mr__p { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tt-mr__p { align-items: flex-end; }
.tt-mr__c { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.tt-mr__v, .tt-mr__ch { font-size: 11.5px; color: var(--ash); }
.tt-mr__ch.is-up { color: var(--up-tx); }
.tt-mr__ch.is-dn { color: var(--dn-tx); }
.tt-mr__px { font-size: 12.5px; }
.tt-mr__vol, .tt-mr__f { display: none; }

.tt-pick { width: min(620px, calc(100vw - 16px)); display: flex; flex-direction: column; max-height: min(560px, 72vh); }
.tt-pick__s { display: flex; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.tt-pick__s .tt-search { height: 34px; }
.tt-pick__h, .tt-pick .tt-mr { grid-template-columns: 20px 20px minmax(120px, 1.4fr) 1fr .8fr .9fr .9fr; }
.tt-pick__h { display: grid; gap: 0 8px; padding: 8px 18px 4px 48px; color: var(--mute); font-size: 11px; }
.tt-pick__h span:not(:first-child) { text-align: right; }
.tt-pick__h { grid-template-columns: minmax(120px, 1.4fr) 1fr .8fr .9fr .9fr; }
.tt-pick__l { overflow-y: auto; padding: 0 6px 6px; overscroll-behavior: contain; }
.tt-pick .tt-mr { height: 36px; }
.tt-pick .tt-mr__p { display: contents; }
.tt-pick .tt-mr__v { display: none; }
.tt-pick .tt-mr__px, .tt-pick .tt-mr__ch, .tt-pick .tt-mr__vol, .tt-pick .tt-mr__f { display: block; text-align: right; font-size: 12px; }
.tt-pick .tt-mr__vol { color: var(--ash); }

/* ---------- chart ---------- */
.tt-chart { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.tt-cv { position: relative; flex: 1; min-height: 0; }
.tt-cv > iframe, .tt-cv > div:not(.tt-cv__wait) { position: absolute; inset: 0; }
.tt-cv__wait { position: absolute; inset: 0; display: grid; place-items: center; }
.tt-shim { width: 120px; height: 2px; border-radius: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); background-size: 200% 100%; animation: tt-shim 1.2s linear infinite; }
@keyframes tt-shim { to { background-position: -200% 0; } }

/* ---------- order book + trades ---------- */
.tt-side { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.tt-side__h { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px 0 12px; border-bottom: 1px solid var(--line); }
.tt-ob, .tt-tr { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.tt-ob__h, .tt-obr, .tt-trr {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.1fr); align-items: center; column-gap: 10px; padding: 0 12px;
}
.tt-ob__h { flex: none; height: 28px; color: var(--mute); font-size: 11px; }
.tt-ob__h > :not(:first-child) { justify-self: end; text-align: right; }
.tt-unit { display: inline-flex; align-items: center; gap: 4px; color: var(--mute); font-size: 11px; transition: color 120ms; }
.tt-unit:hover { color: var(--bone); }
.tt-unit .ic { width: 12px; height: 12px; }
.tt-ob__asks, .tt-ob__bids { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.tt-ob__asks { flex-direction: column-reverse; }
.tt-ob__bids { flex-direction: column; }
.tt-obr { position: relative; flex: none; height: var(--rowh); font-size: 12px; cursor: pointer; isolation: isolate; }
.tt-obr > span { position: relative; text-align: right; white-space: nowrap; overflow: hidden; }
.tt-obr > .tt-obr__px { text-align: left; }
.tt-obr--a .tt-obr__px { color: var(--dn-tx); }
.tt-obr--b .tt-obr__px { color: var(--up-tx); }
.tt-obr__bar {
  position: absolute; inset: 1px 0; z-index: -1; transform-origin: right center; transform: scaleX(0);
  transition: transform 220ms var(--ease); will-change: transform;
}
.tt-obr--a .tt-obr__bar { background: var(--dn-bar); }
.tt-obr--b .tt-obr__bar { background: var(--up-bar); }
.tt-obr:hover { background: var(--ink-3); }
.tt-obr:hover::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--line-2); }
.tt-obr--a:hover::after { top: 0; }
.tt-obr--b:hover::after { bottom: 0; }
.tt-obr.fl-a { animation: tt-fl-a 420ms ease-out; }
.tt-obr.fl-b { animation: tt-fl-b 420ms ease-out; }
@keyframes tt-fl-a { from { background-color: rgb(237 234 227 / .08); } to { background-color: transparent; } }
@keyframes tt-fl-b { from { background-color: rgb(237 234 227 / .08); } to { background-color: transparent; } }
.tt-ob__mid {
  flex: none; display: flex; align-items: center; justify-content: space-between; height: 28px; padding: 0 12px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--ink-2); font-size: 12px;
}
.tt-ob__mid [data-k="obmid"] { font-size: 13px; font-weight: 600; }
.tt-tr__l { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.tt-trr { height: var(--rowh); font-size: 12px; cursor: pointer; }
.tt-trr:hover { background: var(--ink-3); }
.tt-trr > span { text-align: right; white-space: nowrap; }
.tt-trr > span:first-child { text-align: left; }
.tt-trr.is-b > span:first-child { color: var(--up-tx); }
.tt-trr.is-s > span:first-child { color: var(--dn-tx); }
.tt-trr.is-new { animation: tt-in 300ms var(--ease); }
.tt-trr.is-b.is-new { animation-name: tt-in, tt-hb; animation-duration: 300ms, 700ms; }
.tt-trr.is-s.is-new { animation-name: tt-in, tt-hs; animation-duration: 300ms, 700ms; }
@keyframes tt-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes tt-hb { from { background-color: var(--up-bg); } to { background-color: transparent; } }
@keyframes tt-hs { from { background-color: var(--dn-bg); } to { background-color: transparent; } }

/* ---------- dock ---------- */
.tt-dock { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.tt-dock__h { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--line); }
.tt-txtbtn { height: 26px; padding: 0 10px; border-radius: var(--r-s); color: var(--ash); font-size: 12px; transition: color 120ms, background-color 120ms; }
.tt-txtbtn:hover { color: var(--bone); background: var(--ink-3); }
.tt-dock__b { flex: 1; min-height: 0; overflow: auto; }
.tt-t { display: grid; align-items: center; column-gap: 12px; padding: 0 14px; }
/* fixed minimums, shared growth: the table fits 1440 and scrolls (market column pinned) below that */
.tt-dock__b[data-tab="pos"] .tt-t { column-gap: 8px; min-width: 1114px; grid-template-columns: minmax(104px, 1fr) minmax(92px, 1fr) minmax(70px, 1fr) repeat(2, minmax(64px, 1fr)) minmax(116px, 1fr) minmax(64px, 1fr) minmax(80px, 1fr) minmax(56px, 1fr) minmax(132px, 1fr) 164px; }
.tt-dock__b[data-tab="ord"] .tt-t { min-width: 1024px; grid-template-columns: minmax(92px, .9fr) minmax(96px, 1fr) minmax(96px, 1fr) minmax(48px, .5fr) repeat(2, minmax(84px, .9fr)) minmax(52px, .5fr) minmax(96px, 1fr) minmax(52px, .5fr) minmax(104px, 1fr) 72px; }
.tt-dock__b[data-tab="twap"] .tt-t { min-width: 884px; grid-template-columns: minmax(96px, 1fr) minmax(48px, .5fr) repeat(3, minmax(100px, 1fr)) minmax(120px, 1.1fr) minmax(52px, .5fr) minmax(72px, .7fr) 72px; }
.tt-dock__b[data-tab="fills"] .tt-t { min-width: 832px; grid-template-columns: minmax(92px, .9fr) minmax(96px, 1fr) minmax(100px, 1fr) repeat(4, minmax(84px, .9fr)) minmax(96px, 1fr); }
.tt-dock__b[data-tab="hist"] .tt-t { min-width: 896px; grid-template-columns: minmax(92px, .9fr) minmax(96px, 1fr) minmax(96px, 1fr) minmax(48px, .5fr) repeat(2, minmax(84px, .9fr)) minmax(52px, .5fr) minmax(84px, .9fr) minmax(52px, .5fr) minmax(72px, .7fr); }
.tt-dock__b[data-tab="fund"] .tt-t { min-width: 594px; grid-template-columns: minmax(92px, .7fr) minmax(96px, .8fr) repeat(3, minmax(110px, 1fr)); }
.tt-t--h { position: sticky; top: 0; z-index: 1; height: 30px; background: var(--ink); color: var(--mute); font-size: 11px; border-bottom: 1px solid var(--line); }
.tt-t--row { height: 38px; font-size: 12.5px; border-bottom: 1px solid var(--rule); transition: background-color 160ms var(--ease); }
.tt-t--row:hover { background: var(--ink-2); transition-duration: 0s; }
.tt-t--row[role="button"] { cursor: pointer; }
.tt-t--row.is-cur { box-shadow: inset 2px 0 0 var(--uv); }
.tt-c { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-c.num { text-align: right; }
.tt-c--mixed { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.tt-c--mk { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.tt-c--mk .tt-badge.is-up { background: var(--up-bg); color: var(--up-tx); }
.tt-c--mk .tt-badge.is-dn { background: var(--dn-bg); color: var(--dn-tx); }
.tt-c--act { display: flex; justify-content: flex-end; gap: 4px; }
.tt-xbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--r-s);
  border: 1px solid var(--line); color: var(--bone); font-size: 11.5px; transition: border-color 120ms, background-color 120ms;
}
.tt-xbtn:hover { border-color: var(--line-2); background: var(--ink-3); }
.tt-xbtn:active { transform: scale(.97); }
.tt-xbtn .spin { width: 11px; height: 11px; }
.tt-empty--dock { padding: 36px 16px; }
.tt-cl { width: 260px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.tt-cl__t { margin: 0 2px; color: var(--ash); font-size: 12px; }
.tt-cl__msg { margin: 0 2px; color: var(--dn-tx); font-size: 11.5px; min-height: 0; }
.tt-cl__msg:empty { display: none; }

/* ---------- ticket ---------- */
.tt-tk { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.tt-tk__in { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px 16px; }
.tt-lvrow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tt-pill {
  height: 30px; border-radius: var(--r-m); background: var(--ink-3); color: var(--bone); font-size: 12.5px; font-weight: 500;
  font-variant-numeric: tabular-nums; transition: background-color 120ms;
}
.tt-pill:hover { background: var(--ink-4); }
.tt-dir { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: var(--r-l); background: var(--ink-3); }
.tt-dir::before {
  content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: var(--r-m);
  background: var(--book-up); transition: transform 220ms var(--ease), background-color 220ms;
}
.tt-tk[data-side="short"] .tt-dir::before { transform: translateX(100%); background: var(--book-down); }
.tt-dir button { position: relative; height: 32px; color: var(--ash); font-weight: 600; font-size: 13px; transition: color 160ms; }
.tt-dir button[aria-checked="true"] { color: #fff; }
.tt-otype { height: 30px; border-bottom: 1px solid var(--line); }
.tt-otype__pro { margin-left: auto; }
.tt-otype__pro .ic { width: 12px; height: 12px; color: var(--ash); transition: transform 160ms var(--ease); }
.tt-otype__pro[aria-expanded="true"] .ic { transform: rotate(180deg); }
.tt-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.tt-grid2 > * { min-width: 0; }
.tt-sw--box { height: 36px; padding: 0 10px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--ink-2); }
.tt-tif { margin-left: auto; }
.tt-kv { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.tt-kv > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.tt-kv dt { color: var(--ash); }
.tt-kv dd { margin: 0; text-align: right; }
.tt-f {
  position: relative; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 12px; border-radius: var(--r-m);
  background: var(--ink-2); border: 1px solid var(--line); cursor: text; transition: border-color 120ms, background-color 120ms;
}
.tt-f:hover { border-color: var(--line-2); }
.tt-f:focus-within { border-color: rgb(143 200 255 / .6); background: var(--ink); }
.tt-f__l { flex: none; color: var(--ash); font-size: 12px; }
.tt-f__in { flex: 1; width: 0; height: 100%; text-align: right; font-size: 13.5px; color: var(--bone); }
.tt-f__in.is-set { animation: tt-set 520ms ease-out; }
@keyframes tt-set { from { color: var(--uv); } }
.tt-f__btn {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: var(--r-s);
  background: var(--ink-3); color: var(--ash); font-size: 11.5px; font-weight: 500; transition: color 120ms, background-color 120ms;
}
.tt-f__btn:hover { color: var(--bone); background: var(--ink-4); }
.tt-f__btn .ic { width: 12px; height: 12px; }
.tt-f__u { min-width: 58px; justify-content: center; color: var(--bone); }
.tt-f__u2 { color: var(--ash); padding-right: 6px; }
.tt-f--s { height: 36px; padding-right: 8px; }
.tt-f--s .tt-f__in { font-size: 12.5px; }

/* sliders: fully drawn, no native look */
.tt-sl { display: grid; grid-template-columns: minmax(0, 1fr) 64px; align-items: center; column-gap: 12px; row-gap: 8px; }
.tt-sl__t { position: relative; height: 22px; }
.tt-range {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer;
  --p: 0%; --fill: var(--bone); --glow: rgb(237 233 224 / .18);
}
.tt-sl .tt-range { position: relative; z-index: 2; }
.tt-range::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(var(--fill), var(--fill)) 0 0 / var(--p) 100% no-repeat, var(--ink-4); }
.tt-range::-moz-range-track { height: 4px; border-radius: 99px; background: var(--ink-4); }
.tt-range::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--fill); }
.tt-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: var(--bone); border: 0; box-shadow: 0 0 0 3px var(--ink), 0 1px 3px rgb(0 0 0 / .6);
  transition: transform 140ms var(--ease);
}
.tt-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--bone); border: 0; box-shadow: 0 0 0 3px var(--ink), 0 1px 3px rgb(0 0 0 / .6); }
.tt-range:hover::-webkit-slider-thumb { transform: scale(1.1); }
.tt-range:active::-webkit-slider-thumb { transform: scale(1.2); }
.tt-range:focus-visible { outline: none; }
.tt-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--uv); }
.tt-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--uv); }
.tt-tk[data-side="long"] .tt-sl .tt-range { --fill: var(--up-tx); --on: 1; }
.tt-tk[data-side="short"] .tt-sl .tt-range { --fill: var(--dn-tx); --on: 1; }
.tt-sl__ticks { display: none; position: absolute; left: 9px; right: 9px; top: 50%; z-index: 1; pointer-events: none; }
.tt-sl__ticks i { position: absolute; left: var(--at); top: 0; width: 2px; height: 10px; margin: -5px 0 0 -1px; border-radius: 1px; background: var(--line-2); transition: background-color 140ms, opacity 140ms; }
.tt-sl__ticks i:first-child, .tt-sl__ticks i:last-child { opacity: 0; }
.tt-sl__ticks i.is-on { background: rgb(0 0 0 / .35); }
.tt-sl__q { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tt-sl__q button {
  height: 24px; border-radius: var(--r-m); background: var(--ink-2); border: 1px solid var(--line); color: var(--ash);
  font-size: 11.5px; font-variant-numeric: tabular-nums; letter-spacing: .01em; cursor: pointer;
  transition: color 120ms, background-color 120ms, border-color 120ms, transform 120ms var(--ease);
}
.tt-sl__q button:hover { color: var(--bone); border-color: var(--line-2); background: var(--ink-3); }
.tt-sl__q button:active { transform: scale(.96); }
.tt-sl__q button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--uv); }
.tt-sl__q button.is-on { color: var(--bone); border-color: color-mix(in srgb, var(--side, var(--bone)) 55%, transparent); background: color-mix(in srgb, var(--side, var(--bone)) 12%, var(--ink-2)); }
.tt-tk[data-side="long"] .tt-sl__q { --side: var(--up-tx); }
.tt-tk[data-side="short"] .tt-sl__q { --side: var(--dn-tx); }
@media (prefers-reduced-motion: reduce) { .tt-range::-webkit-slider-thumb, .tt-sl__q button { transition: none; } }
.tt-pctbox { display: flex; align-items: center; height: 30px; padding: 0 8px; border-radius: var(--r-m); background: var(--ink-2); border: 1px solid var(--line); color: var(--ash); font-size: 12px; cursor: text; }
.tt-pctbox:focus-within { border-color: rgb(143 200 255 / .6); }
.tt-pctbox input { width: 100%; text-align: right; color: var(--bone); font-size: 12.5px; padding-right: 3px; }

/* switches */
.tt-sws { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.tt-sw { display: inline-flex; align-items: center; gap: 8px; min-height: 22px; color: var(--ash); font-size: 12px; transition: color 120ms; }
.tt-sw:hover, .tt-sw[aria-checked="true"] { color: var(--bone); }
.tt-sw__b { position: relative; flex: none; width: 26px; height: 14px; border-radius: 7px; background: var(--ink-4); box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color 160ms; }
.tt-sw__b::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--ash); transition: transform 180ms var(--ease), background-color 160ms; }
.tt-sw[aria-checked="true"] .tt-sw__b { background: rgb(143 200 255 / .28); box-shadow: inset 0 0 0 1px rgb(143 200 255 / .5); }
.tt-sw[aria-checked="true"] .tt-sw__b::after { transform: translateX(12px); background: var(--uv); }
.tt-tpsl { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 6px; }
.tt-tpsl > * { min-width: 0; }

/* main button */
.tt-cta {
  position: relative; height: 42px; border-radius: var(--r-l); background: var(--book-up); color: #fff; font-size: 13.5px; font-weight: 600;
  transition: background-color 160ms, filter 120ms, transform 100ms;
}
.tt-cta[data-side="short"] { background: var(--book-down); }
.tt-cta:not(:disabled):hover { filter: brightness(1.1); }
.tt-cta:not(:disabled):active { transform: scale(.985); }
.tt-cta:disabled { background: var(--ink-3); color: var(--ash); font-weight: 500; }
.tt-cta--uv, .tt-cta--uv:disabled { background: var(--uv); color: var(--on-uv); }
.tt-cta .btn__in { display: inline-flex; align-items: center; gap: 8px; }
.tt-sum { padding-top: 2px; }

/* account block */
.tt-acc { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); background: var(--ink); }
.tt-acc__t { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--bone); }

/* leverage popover */
.tt-lv { width: 300px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.tt-lv__h { display: flex; align-items: center; justify-content: space-between; color: var(--ash); font-size: 12px; }
.tt-seg { display: inline-grid; grid-auto-flow: column; padding: 2px; border-radius: var(--r-m); background: var(--ink-3); }
.tt-seg button { height: 26px; padding: 0 12px; border-radius: var(--r-s); color: var(--ash); font-size: 12px; transition: color 120ms, background-color 120ms; }
.tt-seg button[aria-checked="true"] { background: var(--ink-4); color: var(--bone); box-shadow: 0 1px 2px rgb(0 0 0 / .4); }
.tt-seg button:disabled { opacity: .4; }
.tt-lv__box { display: flex; align-items: center; height: 30px; width: 76px; padding: 0 10px; border-radius: var(--r-m); background: var(--ink); border: 1px solid var(--line); color: var(--ash); cursor: text; }
.tt-lv__box:focus-within { border-color: rgb(143 200 255 / .6); }
.tt-lv__box input { width: 100%; text-align: right; color: var(--bone); font-size: 13px; padding-right: 2px; }
.tt-lv .tt-range { --fill: var(--uv); }
.tt-lv__ticks { display: flex; justify-content: space-between; margin-top: -6px; }
.tt-lv__ticks button { height: 22px; padding: 0 6px; border-radius: var(--r-s); color: var(--mute); font-size: 11px; transition: color 120ms, background-color 120ms; }
.tt-lv__ticks button:hover { color: var(--bone); }
.tt-lv__ticks button[aria-pressed="true"] { color: var(--bone); background: var(--ink-3); }
.tt-lv__note { margin: 0; color: var(--ash); font-size: 11.5px; line-height: 1.45; }
.tt-lv .tt-cta { height: 36px; }

/* withdraw sheet */
.tm-wd .field__lab { width: auto; min-width: 40px; }
.tm-wd__av { font-size: 13px; color: var(--ash); margin-top: -6px; padding: 0 4px; }
.tm-wd__av .num { color: var(--bone); }

/* ---------- sizes ---------- */
@media (max-width: 1440px) { .tt-stats { gap: 20px; } }
@media (max-width: 1280px) {
  .tt-main.has-mkts { grid-template-columns: 0 0 minmax(0, 1fr) 1px var(--tk-w); }
  .tt-main > .tt-mkts, .tt-main > [data-g="mk"], .tt-only-wide { display: none !important; }
  .tt-stats > div:nth-child(2) { display: none; }
  .tt-acct__a { display: none; }
}
@media (max-width: 1180px) { .tt-stats > div:nth-child(5) { display: none; } }
/* tablet: chart, book and trades share the upper pane behind tabs */
@media (max-width: 1099px) {
  .term { --tk-w: 300px; }
  .tt-stats > div:nth-child(4) { display: none; }
  .tt-up { position: relative; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--hd-h) minmax(0, 1fr); }
  .tt-up > .tt-views { display: flex; padding: 0 14px; border-bottom: 1px solid var(--line); }
  .tt-up > [data-g="ob"], .tt-panes { display: none; }
  .tt-side__h { position: absolute; top: calc(-1 * var(--hd-h)); right: 0; height: var(--hd-h); border: 0; padding-right: 12px; z-index: 2; }
  .tt-up > .tt-chart, .tt-up > .tt-side { grid-row: 2; grid-column: 1; }
  .tt-up > .tt-views { grid-row: 1; grid-column: 1; }
  .term:not([data-view="chart"]) .tt-chart { visibility: hidden; pointer-events: none; }
  .term:not([data-view="chart"]) .tt-chart * { visibility: hidden !important; }
  .term[data-view="chart"] .tt-side { display: none; }
  .term:not([data-view="book"]) [data-act="grp"] { display: none; }
  .tt-side { position: relative; z-index: 1; background: var(--ink); }
}
@media (max-width: 900px) {
  .tt-stats > div:nth-child(1) { display: none; }
  .tt-site { gap: 16px; }
  .tt-nav button { padding: 0 9px; }
}
/* phone: one column, the page scrolls */
@media (max-width: 640px) {
  .term { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; --top-h: auto; }
  .tt-site { height: 48px; gap: 8px; padding: 0 6px 0 14px; }
  .tt-nav, .tt-site__r > .tt-ib:not(.tt-only-phone) { display: none; }
  .tt-only-phone { display: inline-grid; }
  .tt-acct { margin-right: 0; padding: 0 8px; }
  .tt-acct__a { display: none; }
  .tt-top { position: sticky; top: 0; z-index: 30; background: var(--ink); flex-wrap: wrap; height: auto; padding: 6px 8px 0 4px; row-gap: 0; }
  .tt-mkb { margin-left: 0; padding: 0 8px 0 6px; font-size: 14px; }
  .tt-hpx { padding: 0 0 0 4px; }
  .tt-digits { font-size: 17px; }
  .tt-top__r { padding-left: 0; }
  .tt-stats {
    order: 5; width: calc(100% + 12px); margin: 4px -4px 0 -8px; padding: 6px 16px 8px; gap: 18px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line);
    overscroll-behavior-x: contain; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent);
  }
  .tt-stats > div:last-child { padding-right: 20px; }
  .tt-stats::-webkit-scrollbar { display: none; }
  .tt-stats > div, .tt-stats > div:nth-child(n) { display: flex; }
  .tt-stats > div:nth-child(1), .tt-stats > div:nth-child(2) { display: none; }
  .tt-main, .tt-main.has-mkts { flex: none; display: flex; flex-direction: column; min-height: 0; }
  .tt-main > .tt-g { display: none; }
  .tt-work { display: flex; flex-direction: column; }
  .tt-work > .tt-g { display: none; }
  .tt-up { height: 58vh; min-height: 340px; max-height: 520px; border-bottom: 1px solid var(--line); }
  .tt-views { padding: 0 16px; }
  .tt-tk { overflow: visible; border-bottom: 1px solid var(--line); }
  .tt-tk__in { padding: 14px 16px 16px; }
  .tt-acc { padding: 14px 16px; }
  .tt-dock { min-height: 240px; padding-bottom: env(safe-area-inset-bottom); order: 3; }
  .tt-work { display: contents; }
  .tt-up { order: 1; }
  .tt-tk { order: 2; }
  .tt-dock__h { padding: 0 16px; }
  .tt-dock__b { overflow: visible; }
  .tt-t--h { display: none; }
  .tt-t, .tt-dock__b[data-tab] .tt-t { min-width: 0; grid-template-columns: 1fr 1fr 1fr; row-gap: 8px; height: auto; padding: 12px 16px; }
  .tt-t--row .tt-c { display: flex; flex-direction: column; gap: 2px; white-space: normal; text-align: left !important; }
  .tt-t--row .tt-c::before { content: attr(data-l); font-size: 11px; color: var(--ash); font-weight: 400; }
  .tt-t--row .tt-c[data-l=""]::before, .tt-t--row .tt-c--mk::before, .tt-t--row .tt-c--act::before { display: none; }
  .tt-t--row .tt-c--mk { grid-column: 1 / span 2; flex-direction: row; align-items: center; }
  .tt-t--row .tt-c--act { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: 6px; }
  .tt-t--row .tt-c--act:empty { display: none; }
  .tt-t--row .tt-c--mk { grid-column: 1 / -1; }
  .tt-t--row .tt-c--mixed { justify-content: flex-start; flex-direction: row; align-items: center; }
  .tt-pick { max-height: 70vh; }
  .tt-pick__h, .tt-pick .tt-mr { grid-template-columns: 20px 20px minmax(0, 1.3fr) 1fr .9fr; }
  .tt-pick__h { grid-template-columns: minmax(0, 1.3fr) 1fr .9fr; }
  .tt-pick__h span:nth-child(n+4), .tt-pick .tt-mr__vol, .tt-pick .tt-mr__f { display: none; }
  .tt-tip { display: none; }
}
/* ---------- polish: numbers, press, exit, refusals ---------- */
.tt-digits, .tt-stats dd, .tt-kv dd, .tt-obr, .tt-trr, .tt-mr__p, .tt-pctbox, .tt-lv__box, .tt-acct__eq, .tt-menu__eq, .tt-t--row, .tt-cta { font-variant-numeric: tabular-nums; }
.tt-pill, .tt-chip, .tt-f__btn, .tt-txtbtn, .tt-seg button, .tt-lv__ticks button, .tt-mkb, .tt-acct, .tt-nav button, .tt-dir button, .tt-unit, .tt-sw, .tt-star {
  transition-property: color, background-color, border-color, transform; transition-duration: 120ms; transition-timing-function: var(--ease);
}
.tt-pill:active, .tt-chip:active, .tt-f__btn:active, .tt-txtbtn:active, .tt-seg button:not(:disabled):active, .tt-lv__ticks button:active,
.tt-mkb:active, .tt-acct:active, .tt-nav button:active, .tt-dir button:active, .tt-unit:active, .tt-star:active, .tt-xbtn:not(:disabled):active { transform: scale(.96); }
.tt-xbtn { transition-property: border-color, background-color, transform; }
.tt-xbtn:disabled { opacity: .5; cursor: default; }
.tt-dir button:not([aria-checked="true"]):hover { color: var(--bone); }
.tt-cta:disabled { cursor: not-allowed; }
.tt-cta[aria-busy="true"], .tt-cta:has(.spin) { cursor: progress; }
.tt-cta.is-ok { animation: tt-ok 700ms var(--ease); }
@keyframes tt-ok { 0% { box-shadow: 0 0 0 0 rgb(237 234 227 / .35); } 100% { box-shadow: 0 0 0 8px rgb(237 234 227 / 0); } }
.tt-pop.is-out { pointer-events: none; animation: tt-pop-out 110ms var(--ease) forwards; }
@keyframes tt-pop-out { to { opacity: 0; transform: translateY(-2px); } }
.tt-tkerr {
  margin: -4px 0 0; padding: 8px 10px; border-radius: var(--r-m); background: var(--dn-bg); box-shadow: inset 0 0 0 1px rgb(169 72 63 / .35);
  color: var(--dn-tx); font-size: 12px; line-height: 1.45; text-wrap: pretty; animation: tt-pop 150ms var(--ease);
}
.tt-lv__note, .tt-empty { text-wrap: pretty; }
/* while trading, messages sit bottom right, clear of the header, the price and the order button */
body.has-term .toasts { top: auto; bottom: 16px; left: auto; right: 16px; translate: none; width: min(360px, calc(100vw - 32px)); }
/* on a phone the order button can sit low on screen: messages go under the sticky header instead */
@media (max-width: 640px) {
  body.has-term .toasts { right: 50%; translate: 50% 0; bottom: auto; top: calc(var(--term-top, 56px) + 8px); }
  body.has-term.term-toast-low .toasts { top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); }
}
.tt-tpsl__w { grid-column: 1 / -1; margin: 0; color: var(--dn-tx); font-size: 12px; line-height: 1.4; }

@media (prefers-reduced-motion: reduce) {
  .term, .tt-pop, .tt-pop.is-out, .tt-trr.is-new, .tt-obr.fl-a, .tt-obr.fl-b, .tt-tip, .tt-f__in.is-set, .tt-cta.is-ok, .tt-tkerr { animation: none; }
  .dg-col, .tt-obr__bar, .tt-dir::before, .tt-sw__b::after, .tt-tabs > button::after { transition: none; }
  .term :active { transform: none !important; }
}

/* dock: compact action group; the market column stays pinned when a wide table scrolls sideways */
.tt-acts { display: inline-flex; gap: 4px; }
.tt-acts .tt-xbtn { height: 22px; padding: 0 7px; font-size: 11px; }
.tt-t > .tt-c--mk { position: sticky; left: 0; z-index: 1; align-self: stretch; margin-left: -14px; padding-left: 14px; background: var(--ink); }
.tt-t--h > .tt-c:first-child { position: sticky; left: 0; z-index: 2; align-self: stretch; display: flex; align-items: center; margin-left: -14px; padding-left: 14px; background: var(--ink); }
.tt-t > .tt-c--mk { transition: background-color 160ms var(--ease); }
.tt-t--row:hover > .tt-c--mk { background: var(--ink-2); transition-duration: 0s; }
.tt-t--row.is-cur > .tt-c--mk { box-shadow: inset 2px 0 0 var(--uv); }
@media (max-width: 640px) {
  .tt-t > .tt-c--mk { position: static; margin: 0; padding: 0; background: none; box-shadow: none; }
  .tt-t--row:hover > .tt-c--mk { background: none; }
}
/* dock tabs: one line that scrolls sideways when the panel is narrow */
.tt-dock__h { gap: 8px; min-width: 0; }
.tt-dtabs { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
.tt-dtabs::-webkit-scrollbar { display: none; }
.tt-dtabs > button { flex: none; }
.tt-dtabs > button::after { bottom: 0; }
.tt-tab { font-variant-numeric: tabular-nums; }
.term [data-tip]::after { content: none !important; display: none !important; } /* the floating .tt-tip replaces the page tooltips here */
.tt-ico::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14); pointer-events: none; } /* outlines dark round logos on the dark ground */

/* share card of a position or a trade */
.sheet--pnl { width: 680px; }
.pnl-cv { position: relative; border-radius: var(--r-xl); overflow: hidden; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); aspect-ratio: 1200 / 675; }
.pnl-cv__c { display: block; width: 100%; height: auto; }
.pnl-cv__c:not([data-ready="1"]) { opacity: .6; }
.pnl-cv__c { transition: opacity 160ms var(--ease); }
.pnl-opts { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.pnl-bgs { display: flex; gap: 8px; }
.pnl-bg { position: relative; width: 56px; height: 34px; padding: 0; border-radius: var(--r-m); overflow: hidden; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); opacity: .7; transition: opacity 160ms var(--ease), box-shadow 160ms var(--ease), transform 160ms var(--ease); }
.pnl-bg img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pnl-bg:hover { opacity: 1; }
.pnl-bg:active { transform: scale(.96); }
.pnl-bg[aria-checked="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--ink), 0 0 0 3.5px var(--uv); }
.pnl-bg:focus-visible { outline: 2px solid var(--uv); outline-offset: 2px; }
@media (max-width: 640px) { .sheet--pnl { width: 100%; } .pnl-bg { width: 48px; height: 44px; } }
.pnl-opts .tt-sw { font-size: 13px; min-height: 32px; }
.pnl-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pnl-acts .btn--big { min-height: 48px; }
.tt-share { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 0; margin: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; border-radius: var(--r-s); }
.tt-share .tt-v { overflow: hidden; text-overflow: ellipsis; text-decoration: underline dotted rgb(237 234 227 / .28); text-underline-offset: 4px; transition: text-decoration-color 120ms; }
.tt-share:hover .tt-v { text-decoration-color: currentColor; }
.tt-share:focus-visible { outline: 2px solid var(--uv); outline-offset: 2px; }
.tt-share__i { display: none; color: var(--ash); }
.tt-share__i .ic { width: 14px; height: 14px; display: block; }
@media (hover: none), (max-width: 640px) { .tt-share { min-height: 32px; } .tt-share__i { display: inline-flex; } }
