/* Billy product skin — opt-in via body.billy-product. The tenant runtime remains generic for every other brand. */
body.billy-product {
  --b-font-sans: "DM Sans", "Avenir Next", ui-sans-serif, sans-serif;
  --b-font-mono: "DM Mono", ui-monospace, monospace;
  --b-type-xs: .625rem; --b-type-sm: .75rem; --b-type-base: .875rem; --b-type-body: 1rem;
  --b-type-lead: 1.25rem; --b-type-number: 1.5rem; --b-type-display: clamp(2.5rem,4vw,3.5rem);
  --b-weight-regular: 400; --b-weight-medium: 600; --b-weight-semibold: 700; --b-weight-bold: 800;
  --b-leading-tight: 1.1; --b-leading-ui: 1.3; --b-leading-body: 1.6;
  --b-tracking-tight: -.04em; --b-tracking-caps: .08em;
  --b-space-1: 4px; --b-space-2: 8px; --b-space-3: 12px; --b-space-4: 16px;
  --b-space-5: 24px; --b-space-6: 32px; --b-space-8: 48px; --b-space-10: 64px;
  --b-radius-sm: 8px; --b-radius-md: 12px; --b-radius-lg: 16px; --b-radius-xl: 20px;
  --b-radius-pill: 999px; --b-radius-round: 50%;
  --b-bg: #07050d; --b-panel: #0d0917; --b-panel2: #120d22;
  --b-line: #2b2142; --b-line2: #443462;
  --b-primary: #8b5cf6; --b-primary-ink: #c084fc; --b-on-primary: #faf7ff;
  --b-text: #faf7ff; --b-muted: #b9adc9; --b-muted2: #837694;
  --b-nav: rgba(7,5,13,.86); --b-nav-border: rgba(255,255,255,.065); --b-band: rgba(4,3,8,.62);
  --b-subtle: rgba(255,255,255,.035); --b-selected: #171029; --b-selected-strong: #211638;
  --b-green: #4ade80; --b-red: #fb7185; --b-on-green: #07100c; --b-on-red: #18070c;
  --b-shadow-card: 0 16px 48px rgba(0,0,0,.24);
  --b-shadow-focus: 0 0 0 3px color-mix(in srgb,var(--b-primary) 12%,transparent);
  --b-duration-tick: 320ms; --b-ease-out: cubic-bezier(.16,1,.3,1);
  --b-gradient-bg: radial-gradient(ellipse 80% 50% at 50% -10%,rgba(139,92,246,.18),transparent),#07050d;
  --bg: var(--b-bg); --panel: var(--b-panel); --panel2: var(--b-panel2); --line: var(--b-line);
  --txt: var(--b-text); --dim: var(--b-muted2); --accent: var(--b-primary); --up: var(--b-green); --down: var(--b-red);
  color-scheme: dark;
  background: var(--b-gradient-bg);
  color: var(--b-text);
  font-family: var(--b-font-sans);
  font-size: var(--b-type-base);
  font-weight: var(--b-weight-regular);
  line-height: var(--b-leading-ui);
  font-kerning: normal;
  font-variant-numeric: tabular-nums;
}
body.billy-product[data-theme="billy-light"] {
  --b-bg: #f8f5ff; --b-panel: #fff; --b-panel2: #f2ecff;
  --b-line: #ded4f0; --b-line2: #c8b6e4;
  --b-primary: #7c3aed; --b-primary-ink: #6d28d9; --b-on-primary: #faf7ff;
  --b-text: #1a102a; --b-muted: #675a78; --b-muted2: #6f617f;
  --b-nav: rgba(255,255,255,.9); --b-nav-border: rgba(124,58,237,.14); --b-band: rgba(255,255,255,.66);
  --b-subtle: rgba(124,58,237,.07); --b-selected: #f2ecff; --b-selected-strong: #e9dfff;
  --b-green: #08784b; --b-red: #b92843; --b-on-green: #faf7ff; --b-on-red: #faf7ff;
  --b-shadow-card: 0 16px 48px rgba(41,24,72,.12);
  --b-gradient-bg: radial-gradient(ellipse 80% 50% at 50% -10%,rgba(124,58,237,.11),transparent),#f8f5ff;
  color-scheme: light;
}
body.billy-product[data-theme="billy-light"] .billy-order-submit { color: var(--b-on-primary); }

body.billy-product *, body.billy-product *::before, body.billy-product *::after { box-sizing: border-box; }
body.billy-product button, body.billy-product input, body.billy-product select { font: inherit; }
body.billy-product button:focus-visible, body.billy-product input:focus-visible, body.billy-product select:focus-visible,
body.billy-product a:focus-visible, body.billy-product [tabindex]:focus-visible {
  outline: 2px solid var(--b-primary-ink); outline-offset: 2px;
}
body.billy-product ::selection { background: color-mix(in srgb,var(--b-primary) 38%,transparent); color: var(--b-text); }

.billy-product .app { background: var(--b-gradient-bg); }
.billy-product .top {
  min-height: 66px; height: 66px; padding: 0 var(--b-space-6); gap: var(--b-space-4); background: var(--b-nav);
  -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
  border-bottom: 1px solid var(--b-nav-border); box-shadow: none; z-index: 30;
}
.billy-product .brand { height: 40px; min-width: 151px; max-width: 151px; flex: 0 0 151px; overflow: visible; color: var(--b-text); letter-spacing: -.03em; }
.billy-product .brand svg { height: 36px; max-width: 150px; }
.billy-brand-lockup { display: flex; align-items: center; gap: var(--b-space-2); white-space: nowrap; }
.billy-logo-mark {
  width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: var(--b-radius-md);
  background: var(--b-primary); color: var(--b-on-primary); font: var(--b-weight-bold) var(--b-type-base)/1 var(--b-font-sans);
}
.billy-logo-word { color: var(--b-text); font: var(--b-weight-bold) var(--b-type-body)/1 var(--b-font-sans); letter-spacing: var(--b-tracking-tight); }

.billy-product .sections { gap: var(--b-space-1); max-width: none; overflow: visible; padding: var(--b-space-1); }
.billy-product .top .sections button {
  min-height: 40px; padding: var(--b-space-2) var(--b-space-3); border: 0; border-radius: var(--b-radius-md); background: transparent;
  color: var(--b-muted); font-size: var(--b-type-base); font-weight: var(--b-weight-medium); letter-spacing: 0;
  transition: color .16s ease, background-color .16s ease;
}
.billy-product .top .sections button:hover { color: var(--b-text); background: var(--b-subtle); }
.billy-product .top .sections button.on {
  color: var(--b-text); border: 0; background: var(--b-subtle); box-shadow: none;
}
.billy-product .top > :is(.demo,.ghosttop,.presence,.me) { display: none !important; }
.billy-product .top .sp { min-width: 12px; }
.billy-product .top button#login {
  min-height: 40px; padding: var(--b-space-2) var(--b-space-5); border: 0; border-radius: var(--b-radius-pill);
  background: var(--b-primary); color: var(--b-on-primary); font-size: var(--b-type-base); font-weight: var(--b-weight-semibold);
}
.billy-product .top button#login:hover { filter: brightness(1.08); }
.billy-product .top .billy-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 40px; padding: var(--b-space-2) var(--b-space-3);
  border: 1px solid var(--b-line2); border-radius: var(--b-radius-pill); background: var(--b-subtle); color: var(--b-text);
  box-shadow: none; cursor: pointer;
}
.billy-product .top .billy-theme-toggle:hover { border-color: var(--b-primary); background: var(--b-subtle); }
.billy-theme-icon { display: grid; place-items: center; width: 16px; height: 16px; border-radius: var(--b-radius-round); background: color-mix(in srgb,var(--b-primary) 18%,transparent); color: var(--b-primary-ink); font-size: var(--b-type-sm); line-height: 1; }
.billy-product .top button.ghosttop {
  width: 38px; padding: 0; overflow: hidden; color: transparent; background: var(--b-panel); border-color: var(--b-line);
}
.billy-product .top button.ghosttop::first-letter { color: var(--b-muted); }
.billy-product .top button.ghosttop:hover { border-color: var(--b-line2); }
.billy-product .top .me { color: var(--b-muted); }
.billy-product .presence .av { border-color: var(--b-bg); }

.billy-product footer {
  padding: var(--b-space-2) var(--b-space-4); background: var(--b-bg); border-color: var(--b-line); color: var(--b-muted2);
  font-size: var(--b-type-xs);
}
.billy-product footer b { color: var(--b-muted); }
.billy-product .stage { background: var(--b-bg); }
.billy-product .stage[hidden], .billy-marketbar[hidden], .billy-product-main[hidden] { display: none !important; }

.billy-marketbar {
  flex: 0 0 64px; min-height: 64px; display: flex; align-items: stretch; gap: 0; padding: 0 var(--b-space-2);
  background: var(--b-band); border-bottom: 1px solid var(--b-line); color: var(--b-text);
}
.billy-pair-wrap { position: relative; align-self: stretch; display: flex; }
.billy-pair-pop { position: absolute; top: calc(100% + var(--b-space-2)); left: var(--b-space-2); z-index: 80; width: min(340px, calc(100vw - var(--b-space-5))); background: var(--b-panel); border: 1px solid var(--b-line); border-radius: var(--b-radius-lg); box-shadow: var(--b-shadow-card); overflow: hidden; }
.billy-pair-search { display: flex; align-items: center; gap: var(--b-space-2); padding: var(--b-space-3) var(--b-space-4); border-bottom: 1px solid var(--b-line); }
.billy-pair-search svg { width: 16px; fill: none; stroke: var(--b-muted2); stroke-width: 1.5; flex: 0 0 auto; }
.billy-pair-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--b-text); font: var(--b-weight-regular) var(--b-type-base)/1 var(--b-font-sans); outline: none; }
.billy-pair-search input::placeholder { color: var(--b-muted2); }
.billy-pair-list { max-height: 320px; overflow: auto; overscroll-behavior: contain; padding: var(--b-space-2); }
.billy-pair-option { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: var(--b-space-3); width: 100%; padding: var(--b-space-2) var(--b-space-3); border: 0; border-radius: var(--b-radius-sm); background: transparent; color: var(--b-text); cursor: pointer; text-align: left; }
.billy-pair-option:hover { background: var(--b-subtle); }
.billy-pair-option:focus-visible { outline: none; box-shadow: var(--b-shadow-focus); }
.billy-pair-option.on { background: var(--b-selected); }
.billy-pair-option .po-name { display: flex; flex-direction: column; gap: var(--b-space-1); min-width: 0; }
.billy-pair-option .po-name b { font: var(--b-weight-semibold) var(--b-type-sm)/1 var(--b-font-mono); }
.billy-pair-option .po-name small { color: var(--b-muted2); font-size: var(--b-type-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.billy-pair-option .po-quote { display: flex; flex-direction: column; align-items: end; gap: var(--b-space-1); }
.billy-pair-option .po-quote b { font: var(--b-weight-medium) var(--b-type-sm)/1 var(--b-font-mono); }
.billy-pair-option .po-quote small { font: var(--b-weight-medium) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-pair-none { padding: var(--b-space-5); color: var(--b-muted2); font-size: var(--b-type-sm); text-align: center; }
.billy-pair-all { display: flex; align-items: center; justify-content: center; gap: var(--b-space-2); width: 100%; padding: var(--b-space-3); border: 0; border-top: 1px solid var(--b-line); background: transparent; color: var(--b-primary-ink); cursor: pointer; font: var(--b-weight-medium) var(--b-type-sm)/1 var(--b-font-sans); }
.billy-pair-all:hover { background: var(--b-subtle); }
.billy-pair {
  width: 208px; display: flex; align-items: center; gap: var(--b-space-2); padding: 0 var(--b-space-2); border: 0; background: transparent;
  color: var(--b-text); text-align: left; cursor: pointer;
}
.billy-pair:hover { background: var(--b-panel2); }
.billy-pair > span { display: flex; flex-direction: column; gap: var(--b-space-1); }
.billy-pair b { font: var(--b-weight-semibold) var(--b-type-sm)/1 var(--b-font-mono); }
.billy-pair small { color: var(--b-muted2); font-size: var(--b-type-xs); }
.billy-pair svg { width: 18px; margin-left: auto; fill: none; stroke: var(--b-muted2); stroke-width: 1.5; }
.billy-quote-main { min-width: 144px; display: flex; flex-direction: column; justify-content: center; padding: 0 var(--b-space-4); border-left: 1px solid var(--b-line); }
.billy-quote-main strong { font: var(--b-weight-semibold) var(--b-type-body)/var(--b-leading-tight) var(--b-font-mono); }
.billy-quote-main span { margin-top: var(--b-space-1); font: var(--b-weight-medium) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-marketbar dl { display: flex; align-self: stretch; margin: 0; }
.billy-marketbar dl > div { min-width: 120px; display: flex; flex-direction: column; justify-content: center; padding: 0 var(--b-space-4); border-left: 1px solid var(--b-line); }
.billy-marketbar dt { margin-bottom: var(--b-space-1); color: var(--b-muted2); font-size: var(--b-type-xs); }
.billy-marketbar dd { margin: 0; color: var(--b-muted); font: var(--b-weight-regular) var(--b-type-sm)/1 var(--b-font-mono); }
.billy-live-dot { display: flex; align-items: center; gap: var(--b-space-2); margin-left: auto; padding: 0 var(--b-space-4); color: var(--b-muted2); font-size: var(--b-type-xs); }
.billy-live-dot i { width: 6px; height: 6px; border-radius: var(--b-radius-round); background: var(--b-green); outline: 4px solid color-mix(in srgb,var(--b-green) 9%,transparent); }
.billy-live-price { display: inline-block; transform-origin: left center; }
.billy-live-price.tick-up { color: var(--b-green); animation: billyPriceTick var(--b-duration-tick) var(--b-ease-out); }
.billy-live-price.tick-down { color: var(--b-red); animation: billyPriceTick var(--b-duration-tick) var(--b-ease-out); }
@keyframes billyPriceTick { from { opacity: .46; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }

.billy-product-main { flex: 1 1 0; min-height: 0; overflow: auto; background: var(--b-gradient-bg); color: var(--b-text); scrollbar-color: var(--b-line) transparent; }
.billy-product-main.exchange-view { overflow: hidden; background: var(--b-bg); }
.billy-page { width: min(1220px, calc(100% - 48px)); margin: 0 auto; padding: clamp(var(--b-space-6),5vw,var(--b-space-10)) 0 var(--b-space-10); }
.billy-eyebrow { display: block; margin-bottom: var(--b-space-3); color: var(--b-primary-ink); font: var(--b-weight-semibold) var(--b-type-xs)/1 var(--b-font-mono); letter-spacing: var(--b-tracking-caps); text-transform: uppercase; }
.billy-page h1 { margin: 0; color: var(--b-text); font-size: var(--b-type-display); line-height: var(--b-leading-tight); letter-spacing: var(--b-tracking-tight); font-weight: var(--b-weight-bold); }
.billy-page p { color: var(--b-muted); font-size: var(--b-type-body); line-height: var(--b-leading-body); }
.billy-page-head { display: flex; align-items: end; justify-content: space-between; gap: var(--b-space-6); }
.billy-page-head > div:first-child p { max-width: 570px; margin: var(--b-space-4) 0 0; }
.billy-page-tabs { display: flex; align-items: center; gap: var(--b-space-5); padding: 0; border: 0; background: transparent; }
.billy-page-tabs button, .billy-segmented button {
  position: relative; border: 0; background: transparent; color: var(--b-muted2); cursor: pointer; font-weight: var(--b-weight-semibold);
}
.billy-page-tabs button { min-height: 44px; padding: 0 var(--b-space-1); font-size: var(--b-type-sm); }
.billy-page-tabs button::after, .billy-segmented button::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--b-primary); opacity: 0; transform: scaleX(.4); transition: transform .18s ease-out,opacity .18s ease-out; }
.billy-page-tabs button.on, .billy-segmented button.on { color: var(--b-text); }
.billy-page-tabs button.on::after, .billy-segmented button.on::after { opacity: 1; transform: scaleX(1); }

.billy-buy-page { padding-top: clamp(var(--b-space-5),2.4vw,var(--b-space-6)); }
.billy-buy-page h1 { font-size: var(--b-type-display); }
.billy-buy-grid { display: grid; grid-template-columns: minmax(0,1fr) 430px; gap: clamp(var(--b-space-8),8vw,var(--b-space-10)); align-items: start; }
.billy-buy-left .billy-page-head { display: block; }
.billy-buy-context { margin-top: var(--b-space-8); padding-top: var(--b-space-2); }
.billy-buy-rail { min-width: 0; }
.billy-buy-rail > .billy-page-tabs { justify-content: flex-start; margin-bottom: var(--b-space-2); }
.billy-context-title { display: flex; align-items: center; justify-content: space-between; padding-bottom: var(--b-space-4); border-bottom: 1px solid var(--b-line); }
.billy-context-title > span { color: var(--b-muted); font-weight: var(--b-weight-semibold); }
.billy-context-title button { border: 0; background: transparent; color: var(--b-primary-ink); cursor: pointer; font-size: var(--b-type-sm); }
.billy-hot-list { display: flex; flex-direction: column; }
.billy-hot-list button {
  display: grid; grid-template-columns: minmax(120px,1fr) 140px 72px; align-items: center; min-height: 64px; padding: 0;
  border: 0; border-bottom: 1px solid var(--b-line); background: transparent; color: var(--b-text); cursor: pointer; text-align: left;
}
.billy-hot-list button:hover { background: linear-gradient(90deg,transparent,var(--b-panel)); }
.billy-hot-list button > span { display: flex; align-items: center; gap: var(--b-space-3); }
.billy-hot-list strong, .billy-hot-list small { text-align: right; font: var(--b-weight-medium) var(--b-type-sm)/1 var(--b-font-mono); }
.billy-trust-copy { display: grid; grid-template-columns: 1px 1fr; gap: var(--b-space-4); margin-top: var(--b-space-6); }
.billy-trust-rule { display: block; background: linear-gradient(var(--b-primary),transparent); }
.billy-trust-copy p { max-width: 460px; margin: 0; color: var(--b-muted2); font-size: var(--b-type-sm); }

.billy-buy-card {
  position: relative; isolation: isolate; margin-top: 0; padding: var(--b-space-5); border: 0; border-radius: var(--b-radius-xl);
  background: color-mix(in srgb,var(--b-panel) 94%,var(--b-primary) 6%); box-shadow: var(--b-shadow-card);
}
.billy-buy-modebar { display: flex; align-items: center; justify-content: space-between; gap: var(--b-space-4); margin-bottom: var(--b-space-4); }
.billy-buy-modebar > div { display: flex; flex-direction: column; gap: var(--b-space-1); }
.billy-buy-modebar strong { font-size: var(--b-type-base); }
.billy-buy-modebar small { color: var(--b-muted2); font-size: var(--b-type-xs); }
.billy-segmented { display: flex; align-items: center; gap: var(--b-space-5); padding: 0; margin: 0; background: transparent; }
.billy-segmented button { min-height: 40px; padding: 0 var(--b-space-1); font-size: var(--b-type-sm); }
.billy-quote-live { display: flex; align-items: center; gap: var(--b-space-2); color: var(--b-muted2); font: var(--b-weight-medium) var(--b-type-xs)/1 var(--b-font-sans); text-transform: uppercase; letter-spacing: var(--b-tracking-caps); white-space: nowrap; }
.billy-quote-live i { width: 6px; height: 6px; border-radius: var(--b-radius-round); background: var(--b-green); outline: 4px solid color-mix(in srgb,var(--b-green) 9%,transparent); }
.billy-quote-live.preview i { background: var(--b-primary-ink); outline-color: color-mix(in srgb,var(--b-primary) 12%,transparent); }
.billy-converter { overflow: hidden; border: 1px solid var(--b-line); border-radius: var(--b-radius-lg); background: var(--b-panel2); transition: border-color .16s ease,box-shadow .16s ease; }
.billy-converter:focus-within { border-color: color-mix(in srgb,var(--b-primary) 68%,var(--b-line)); box-shadow: var(--b-shadow-focus); }
.billy-amount-field { padding: var(--b-space-4); border: 1px solid var(--b-line); border-radius: var(--b-radius-md); background: var(--b-panel2); transition: border-color .16s ease; }
.billy-buy-card > .billy-amount-field:focus-within { border-color: var(--b-primary); }
.billy-converter .billy-amount-field { padding: var(--b-space-5); border: 0; border-radius: 0; background: transparent; }
.billy-converter .billy-amount-field.receive { border-top: 1px solid var(--b-line); }
.billy-amount-field label { display: block; margin-bottom: var(--b-space-2); color: var(--b-muted2); font-size: var(--b-type-sm); font-weight: var(--b-weight-medium); }
.billy-amount-field > div { display: flex; align-items: center; gap: var(--b-space-3); }
.billy-amount-field input, .billy-amount-field output { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--b-text); font: var(--b-weight-semibold) var(--b-type-number)/var(--b-leading-tight) var(--b-font-sans); letter-spacing: var(--b-tracking-tight); }
.billy-amount-field input { width: 100%; }
.billy-amount-field button { display: flex; align-items: center; gap: var(--b-space-2); min-height: 44px; padding: var(--b-space-2) var(--b-space-3); border: 0; border-radius: var(--b-radius-md); background: var(--b-selected); color: var(--b-text); cursor: pointer; font-size: var(--b-type-sm); font-weight: var(--b-weight-semibold); }
.billy-amount-field button:hover { background: var(--b-selected-strong); }
.billy-amount-field button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.billy-amount-field small { display: block; min-height: 16px; margin-top: var(--b-space-2); color: var(--b-muted2); font-size: var(--b-type-sm); }
.billy-amount-field small.error { color: var(--b-red); }
.billy-converter-flow { position: relative; z-index: 2; display: grid; place-items: center; width: 32px; height: 32px; margin: -16px auto; border: 4px solid var(--b-panel2); border-radius: var(--b-radius-round); background: var(--b-selected-strong); color: var(--b-primary-ink); font-size: var(--b-type-sm); }
.billy-select-control { position: relative; display: inline-flex; align-items: center; gap: var(--b-space-2); min-width: 72px; min-height: 44px; padding: 0 var(--b-space-6) 0 var(--b-space-3); border-radius: var(--b-radius-md); background: var(--b-selected); color: var(--b-text); }
.billy-select-control select { position: relative; z-index: 1; max-width: 164px; min-height: 44px; padding: 0; border: 0; outline: 0; appearance: none; background: transparent; color: inherit; cursor: pointer; font-size: var(--b-type-sm); font-weight: var(--b-weight-semibold); }
.billy-select-control option { background: var(--b-panel); color: var(--b-text); }
.billy-select-control > svg { position: absolute; z-index: 0; right: 9px; width: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; pointer-events: none; }
.billy-asset-select { min-width: 112px; padding-left: var(--b-space-2); }
.billy-asset-select select { width: 56px; text-overflow: ellipsis; }
.billy-methods { display: flex; flex-direction: column; gap: var(--b-space-2); margin: var(--b-space-5) 0 0; padding: 0; border: 0; }
.billy-methods legend { margin-bottom: var(--b-space-2); color: var(--b-muted2); font-size: var(--b-type-xs); font-weight: var(--b-weight-semibold); letter-spacing: var(--b-tracking-caps); text-transform: uppercase; }
.billy-methods > button { display: grid; grid-template-columns: 32px 1fr 16px; align-items: center; gap: var(--b-space-3); width: 100%; padding: var(--b-space-3); border: 1px solid transparent; border-radius: var(--b-radius-md); background: var(--b-subtle); color: var(--b-muted); cursor: pointer; text-align: left; }
.billy-methods > button:hover { background: var(--b-panel2); }
.billy-methods > button.on { border-color: transparent; background: var(--b-selected); color: var(--b-text); }
.billy-methods > button > span:nth-child(2) { display: flex; flex-direction: column; gap: var(--b-space-1); }
.billy-methods b { display: flex; align-items: center; gap: var(--b-space-2); font-size: var(--b-type-sm); }
.billy-methods b em { padding: var(--b-space-1) var(--b-space-2); border-radius: var(--b-radius-pill); background: color-mix(in srgb,var(--b-green) 12%,transparent); color: var(--b-green); font-size: var(--b-type-xs); font-style: normal; font-weight: var(--b-weight-medium); }
.billy-methods small { color: var(--b-muted2); font-size: var(--b-type-xs); }
.billy-methods i { width: 8px; height: 8px; justify-self: center; border: 1px solid var(--b-line2); border-radius: var(--b-radius-round); }
.billy-methods button.on i { border: 2px solid var(--b-panel); background: var(--b-primary); outline: 1px solid var(--b-primary); }
.billy-methods button.compact svg { width: 17px; fill: none; stroke: var(--b-muted2); stroke-width: 1.5; }
.billy-method-symbol { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--b-radius-sm); background: var(--b-selected-strong); color: var(--b-primary-ink); font-size: var(--b-type-sm); font-weight: var(--b-weight-bold); }
.billy-quote-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--b-space-3); margin: var(--b-space-4) 0 var(--b-space-3); padding-top: var(--b-space-4); border-top: 1px solid var(--b-line); }
.billy-quote-summary > div { display: flex; min-width: 0; flex-direction: column; gap: var(--b-space-1); color: var(--b-muted2); font-size: var(--b-type-xs); }
.billy-quote-summary b { color: var(--b-muted); font: var(--b-weight-medium) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-quote-summary .best b { color: var(--b-primary-ink); }
.billy-quote-summary .total { margin: 0; padding: 0; border: 0; color: var(--b-muted); }
.billy-quote-summary .total b { color: var(--b-text); }
.billy-primary-action, .billy-secondary-action {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; border-radius: var(--b-radius-md); cursor: pointer; font-weight: var(--b-weight-semibold);
}
.billy-primary-action { border: 1px solid var(--b-primary); background: var(--b-primary); color: var(--b-on-primary); box-shadow: none; }
.billy-primary-action:hover { background: color-mix(in srgb,var(--b-primary) 88%,var(--b-on-primary)); border-color: transparent; }
.billy-primary-action:disabled { cursor: not-allowed; opacity: .42; }
.billy-secondary-action { margin-top: var(--b-space-2); border: 1px solid var(--b-line2); background: transparent; color: var(--b-muted); }
.billy-form-note { min-height: 32px; margin: var(--b-space-3) var(--b-space-1) 0; color: var(--b-muted2); font-size: var(--b-type-xs); line-height: var(--b-leading-body); text-align: center; }
.billy-form-note.notice { color: var(--b-primary-ink); }

.billy-markets-page { padding-top: var(--b-space-8); }
.billy-markets-head { display: flex; align-items: end; justify-content: space-between; gap: var(--b-space-6); }
.billy-markets-head h1 { font-size: var(--b-type-display); }
.billy-markets-head p { max-width: 560px; margin: var(--b-space-4) 0 0; }
.billy-search { width: min(340px,32vw); display: flex; align-items: center; gap: var(--b-space-2); padding: 0 var(--b-space-3); border: 1px solid var(--b-line); border-radius: var(--b-radius-md); background: var(--b-panel); color: var(--b-muted2); }
.billy-search:focus-within { border-color: var(--b-primary); }
.billy-search svg { width: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; }
.billy-search input { min-width: 0; flex: 1; height: 48px; border: 0; outline: 0; background: transparent; color: var(--b-text); }
.billy-search input::placeholder { color: var(--b-muted2); }
.billy-search kbd { color: var(--b-muted2); font: var(--b-weight-regular) var(--b-type-xs)/1 var(--b-font-mono); }

.billy-overview { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; margin: var(--b-space-8) 0 var(--b-space-6); border-top: 1px solid var(--b-line); border-bottom: 1px solid var(--b-line); }
.billy-overview-card { min-width: 0; padding: var(--b-space-4); border: 0; border-left: 1px solid var(--b-line); border-radius: 0; background: transparent; }
.billy-overview-card:first-child { border-left: 0; }
.billy-overview-card > div { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--b-space-2); }
.billy-overview-card h2 { margin: 0; font-size: var(--b-type-sm); color: var(--b-muted); }
.billy-overview-card > div span { display: inline-flex; align-items: center; gap: var(--b-space-2); color: var(--b-green); font: var(--b-weight-medium) var(--b-type-xs)/1 var(--b-font-mono); text-transform: uppercase; }
.billy-overview-card > div span i, .billy-market-count > i { width: 6px; height: 6px; border-radius: var(--b-radius-round); background: var(--b-green); }
.billy-overview-card button { display: grid; grid-template-columns: 22px 38px 1fr auto; align-items: center; gap: var(--b-space-2); width: 100%; min-height: 40px; padding: 0; border: 0; background: transparent; color: var(--b-text); cursor: pointer; text-align: left; }
.billy-overview-card button:hover { color: var(--b-primary-ink); }
.billy-overview-card button span, .billy-overview-card button small { text-align: right; font: var(--b-weight-medium) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-overview-card button span { color: var(--b-muted); }
.billy-skeleton { height: 158px; border: 1px solid var(--b-line); border-radius: var(--b-radius-md); background: linear-gradient(100deg,var(--b-panel) 25%,var(--b-selected) 40%,var(--b-panel) 55%); background-size: 240% 100%; animation: billyShimmer 1.4s linear infinite; }
@keyframes billyShimmer { to { background-position-x: -240%; } }

.billy-market-tools { display: flex; align-items: center; gap: var(--b-space-5); padding-bottom: var(--b-space-3); border-bottom: 1px solid var(--b-line); }
.billy-category-rail { display: flex; gap: var(--b-space-1); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.billy-category-rail::-webkit-scrollbar { display: none; }
.billy-category-rail button { flex: 0 0 auto; min-height: 44px; padding: 0 var(--b-space-3); border: 0; border-radius: var(--b-radius-sm); background: transparent; color: var(--b-muted2); cursor: pointer; font-size: var(--b-type-sm); }
.billy-category-rail button:hover { color: var(--b-muted); }
.billy-category-rail button.on { background: var(--b-selected-strong); color: var(--b-text); }
.billy-market-count { display: inline-flex; align-items: center; gap: var(--b-space-2); margin-left: auto; color: var(--b-muted2); font: var(--b-weight-regular) var(--b-type-xs)/1 var(--b-font-mono); white-space: nowrap; }
.billy-market-table { width: 100%; }
.billy-market-row { display: grid; grid-template-columns: minmax(210px,1.4fr) 1fr .8fr 1fr 90px; align-items: center; min-height: 61px; border-bottom: 1px solid var(--b-line); color: var(--b-muted); cursor: pointer; text-decoration: none; }
.billy-market-row:hover:not(.header) { background: linear-gradient(90deg,color-mix(in srgb,var(--b-panel2) 72%,transparent),color-mix(in srgb,var(--b-panel2) 20%,transparent)); }
.billy-market-row.header { min-height: 43px; cursor: default; color: var(--b-muted2); }
.billy-market-row.header button, .billy-market-row.header > span { min-height: 44px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; font-size: var(--b-type-xs); text-transform: uppercase; letter-spacing: var(--b-tracking-caps); }
.billy-market-row.header button:not(:first-child), .billy-market-row.header span { text-align: right; }
.billy-market-row > div:first-child { display: flex; align-items: center; gap: var(--b-space-3); }
.billy-market-row > div:first-child > span { display: flex; flex-direction: column; gap: var(--b-space-1); }
.billy-market-row b { color: var(--b-text); font-size: var(--b-type-sm); }
.billy-market-row small { color: var(--b-muted2); font-size: var(--b-type-xs); }
.billy-market-row > strong, .billy-market-row > span { text-align: right; font: var(--b-weight-medium) var(--b-type-sm)/1 var(--b-font-mono); }
.billy-market-open { justify-self: end; padding: var(--b-space-2) var(--b-space-3); border: 1px solid var(--b-line2); border-radius: var(--b-radius-sm); color: var(--b-primary-ink); font-size: var(--b-type-xs); }
.billy-market-row:hover .billy-market-open { background: var(--b-selected-strong); }
.billy-load-more { display: flex; align-items: center; justify-content: center; gap: var(--b-space-3); width: 100%; min-height: 52px; margin-top: var(--b-space-4); border: 1px solid var(--b-line); border-radius: var(--b-radius-md); background: transparent; color: var(--b-text); cursor: pointer; font-weight: var(--b-weight-semibold); }
.billy-load-more:hover { background: var(--b-subtle); }
.billy-load-more span { color: var(--b-muted2); font-size: var(--b-type-xs); font-weight: var(--b-weight-medium); }
.billy-market-warning, .billy-empty { margin-top: var(--b-space-5); padding: var(--b-space-6); border: 1px solid var(--b-line); border-radius: var(--b-radius-md); background: var(--b-panel); color: var(--b-muted); text-align: center; }
.billy-empty span { display: block; color: var(--b-primary); font-size: var(--b-type-number); }.billy-empty b { display: block; margin-top: var(--b-space-2); }.billy-empty p { margin: var(--b-space-1) 0 0; }

.billy-coin { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: var(--b-radius-round); background: var(--coin,var(--b-primary)); color: var(--b-bg); object-fit: cover; font-weight: var(--b-weight-bold); }
.billy-coin.sm { width: 24px; height: 24px; font-size: var(--b-type-xs); }.billy-coin.xs { width: 20px; height: 20px; font-size: var(--b-type-xs); }.billy-coin.lg { width: 56px; height: 56px; font-size: var(--b-type-lead); }
.up { color: var(--b-green) !important; }.down { color: var(--b-red) !important; }

.billy-detail-page { padding-top: var(--b-space-6); }
.billy-back { margin-bottom: var(--b-space-5); padding: 0; border: 0; background: transparent; color: var(--b-muted); cursor: pointer; }
.billy-back:hover { color: var(--b-text); }
.billy-detail-head { display: flex; align-items: center; justify-content: space-between; gap: var(--b-space-6); padding-bottom: var(--b-space-5); border-bottom: 1px solid var(--b-line); }
.billy-detail-head > div { display: flex; align-items: center; gap: var(--b-space-4); }
.billy-detail-head h1 { font-size: var(--b-type-number); }.billy-detail-head h1 small { color: var(--b-muted2); font-size: var(--b-type-sm); letter-spacing: 0; }
.billy-detail-head p { margin: var(--b-space-2) 0 0; color: var(--b-muted2); font-size: var(--b-type-sm); }
.billy-detail-head > div:last-child { flex-direction: column; align-items: end; gap: var(--b-space-2); }
.billy-detail-head > div:last-child strong { font: var(--b-weight-semibold) var(--b-type-number)/1 var(--b-font-mono); }
.billy-detail-head > div:last-child span { font: var(--b-weight-medium) var(--b-type-sm)/1 var(--b-font-mono); }
.billy-detail-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: var(--b-space-4); margin-top: var(--b-space-4); }
.billy-detail-primary, .billy-detail-ticket { border: 1px solid var(--b-line); border-radius: var(--b-radius-lg); background: var(--b-panel); }
.billy-detail-primary { padding: var(--b-space-5); }
.billy-spark-head { display: flex; align-items: center; justify-content: space-between; gap: var(--b-space-4); }
.billy-spark-meta { display: flex; align-items: baseline; gap: var(--b-space-3); color: var(--b-muted2); font: var(--b-weight-regular) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-spark { margin-top: var(--b-space-4); }
.billy-spark-svg { display: block; width: 100%; height: 240px; }
.billy-spark-svg .bs-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.billy-spark-svg.up .bs-line { stroke: var(--b-green); }.billy-spark-svg.down .bs-line { stroke: var(--b-red); }
.billy-spark-svg.up .bs-area { fill: color-mix(in srgb,var(--b-green) 12%,transparent); }
.billy-spark-svg.down .bs-area { fill: color-mix(in srgb,var(--b-red) 12%,transparent); }
.billy-spark-scale { display: flex; align-items: center; justify-content: space-between; margin-top: var(--b-space-2); color: var(--b-muted2); font: var(--b-weight-regular) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-spark-loading { display: grid; place-items: center; height: 240px; color: var(--b-muted2); font-size: var(--b-type-sm); text-align: center; padding: 0 var(--b-space-5); }
.billy-stat-cap { display: block; margin: var(--b-space-6) 0 var(--b-space-2); }
.billy-stat-rows { display: flex; flex-direction: column; }
.billy-stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--b-space-4); padding: var(--b-space-3) 0; border-bottom: 1px solid color-mix(in srgb,var(--b-line) 60%,transparent); }
.billy-stat-row:last-child { border-bottom: 0; }
.billy-stat-row > span { color: var(--b-muted2); font-size: var(--b-type-sm); }
.billy-stat-row b { font: var(--b-weight-medium) var(--b-type-base)/1 var(--b-font-mono); text-align: right; }
.billy-stat-row b small { margin-left: var(--b-space-2); color: var(--b-muted2); font: var(--b-weight-regular) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-stat-row i { font-style: normal; }
.billy-about { margin: var(--b-space-5) 0 0; color: var(--b-muted); font-size: var(--b-type-sm); line-height: var(--b-leading-body); }
.billy-detail-ticket { align-self: start; padding: var(--b-space-5); }.billy-detail-ticket h2 { margin: 0 0 var(--b-space-2); font: var(--b-weight-semibold) var(--b-type-number)/1 var(--b-font-mono); }.billy-detail-ticket p { margin: 0 0 var(--b-space-5); font-size: var(--b-type-sm); }

/* Billy-native exchange. Product behavior follows a familiar market workflow, but no Deck/Dock UI is mounted. */
.billy-exchange {
  width: 100%; height: 100%; min-height: 0; display: grid;
  grid-template-columns: minmax(420px,1fr) 278px 326px; grid-template-rows: minmax(330px,1fr) 190px;
  gap: var(--b-space-2); padding: var(--b-space-2); background: var(--b-bg);
}
.billy-exchange-mobile-tabs { display: none; }
.billy-chart-panel, .billy-book-panel, .billy-ticket-panel, .billy-orders-panel {
  min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--b-line); border-radius: var(--b-radius-md); background: var(--b-panel);
}
.billy-chart-panel { display: grid; grid-template-rows: 58px minmax(0,1fr); }
/* pair, price and mode live in the marketbar directly above — the chart header carries only its own controls */
.billy-exchange-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: var(--b-space-4); padding: 0 var(--b-space-4); border-bottom: 1px solid var(--b-line); background: var(--b-panel); }
.billy-timeframes { display: flex; align-items: center; gap: var(--b-space-1); }
.billy-timeframes button { min-width: 44px; height: 40px; padding: 0 var(--b-space-2); border: 0; border-radius: var(--b-radius-sm); background: transparent; color: var(--b-muted2); cursor: pointer; font: var(--b-weight-medium) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-timeframes button:hover { color: var(--b-text); background: var(--b-subtle); }
.billy-timeframes button.on { color: var(--b-primary-ink); background: var(--b-selected-strong); }
.billy-chart-slot { min-height: 0; background: var(--b-panel); }
.billy-chart-keeper { position: fixed; z-index: 20; overflow: hidden; background: var(--b-panel); border-radius: var(--b-radius-lg); }
.billy-exchange-chart { display: block; width: 100%; height: 100%; min-height: 0; border: 0; background: var(--b-panel); }

.billy-panel-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: var(--b-space-3); padding: 0 var(--b-space-4); border-bottom: 1px solid var(--b-line); }
.billy-panel-head > div { display: flex; flex-direction: column; gap: var(--b-space-1); }
.billy-panel-head span { color: var(--b-muted2); font: var(--b-weight-medium) var(--b-type-xs)/1 var(--b-font-mono); letter-spacing: var(--b-tracking-caps); text-transform: uppercase; }
.billy-panel-head h2 { margin: 0; font-size: var(--b-type-base); line-height: 1; letter-spacing: 0; }
.billy-data-source { display: inline-flex; align-items: center; gap: var(--b-space-2); }
.billy-data-source::before { content: ''; width: 6px; height: 6px; border-radius: var(--b-radius-round); background: var(--b-muted2); }
.billy-data-source.live::before { background: var(--b-green); outline: 4px solid color-mix(in srgb,var(--b-green) 10%,transparent); }

.billy-book-panel { display: flex; flex-direction: column; }
.billy-book-controls { min-height: 44px; display: grid; grid-template-columns: 1fr 1fr 64px; align-items: center; gap: var(--b-space-1); padding: 0 var(--b-space-3); border-bottom: 1px solid var(--b-line); color: var(--b-muted2); font-size: var(--b-type-xs); }
.billy-book-controls span:nth-child(2) { text-align: right; }
.billy-book-controls select { width: 64px; height: 36px; padding: 0 var(--b-space-2); border: 1px solid var(--b-line); border-radius: var(--b-radius-sm); outline: 0; background: var(--b-panel2); color: var(--b-muted); font: var(--b-weight-medium) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-book-rows { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: var(--b-space-1) 0 var(--b-space-2); }
.billy-book-side { flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(9,minmax(16px,1fr)); overflow: hidden; }
.billy-book-row { position: relative; min-height: 16px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 0 var(--b-space-3); font: var(--b-weight-regular) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-book-row i { position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; width: var(--depth); opacity: .11; }
.billy-book-row.ask i { background: var(--b-red); }.billy-book-row.bid i { background: var(--b-green); }
.billy-book-row span { position: relative; z-index: 1; }
.billy-book-row span:last-child { text-align: right; color: var(--b-muted); }
.billy-book-row.ask span:first-of-type { color: var(--b-red); }.billy-book-row.bid span:first-of-type { color: var(--b-green); }
.billy-book-mid { min-height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--b-space-3); border-top: 1px solid var(--b-line); border-bottom: 1px solid var(--b-line); background: var(--b-panel2); }
.billy-book-mid strong { color: var(--b-text); font: var(--b-weight-medium) var(--b-type-sm)/1 var(--b-font-mono); }
.billy-book-mid span, .billy-panel-loading { color: var(--b-muted2); font-size: var(--b-type-xs); }
.billy-panel-loading { margin: auto; }

.billy-ticket-panel { grid-column: 3; grid-row: 1 / 3; overflow: auto; padding-bottom: var(--b-space-3); scrollbar-width: thin; scrollbar-color: var(--b-line) transparent; }
.billy-ticket-head { position: sticky; z-index: 2; top: 0; background: var(--b-panel); }
.billy-ticket-badge { padding: var(--b-space-1) var(--b-space-2); border: 1px solid var(--b-line2); border-radius: var(--b-radius-sm); color: var(--b-primary-ink) !important; background: var(--b-selected); }
.billy-order-side { display: grid; grid-template-columns: 1fr 1fr; gap: var(--b-space-1); margin: var(--b-space-3) var(--b-space-3) 0; padding: var(--b-space-1); border-radius: var(--b-radius-md); background: var(--b-bg); }
.billy-order-side button { min-height: 44px; border: 0; border-radius: var(--b-radius-sm); background: transparent; color: var(--b-muted2); cursor: pointer; font-weight: var(--b-weight-semibold); }
.billy-order-side button.on.buy { color: var(--b-green); background: color-mix(in srgb,var(--b-green) 11%,transparent); }
.billy-order-side button.on.sell { color: var(--b-red); background: color-mix(in srgb,var(--b-red) 11%,transparent); }
.billy-available { display: flex; align-items: center; justify-content: space-between; padding: var(--b-space-4) var(--b-space-3) var(--b-space-2); color: var(--b-muted2); font-size: var(--b-type-xs); }
.billy-available b { color: var(--b-muted); font: var(--b-weight-medium) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-order-field { display: block; margin: 0 var(--b-space-3); padding: var(--b-space-3); border: 1px solid var(--b-line); border-radius: var(--b-radius-md); background: var(--b-panel2); }
.billy-order-field:focus-within { border-color: var(--b-primary); }
.billy-order-field > span { display: block; margin-bottom: var(--b-space-2); color: var(--b-muted2); font-size: var(--b-type-xs); }
.billy-order-field > div { display: flex; align-items: center; gap: var(--b-space-2); }
.billy-order-field input { min-width: 0; width: 100%; min-height: 36px; border: 0; outline: 0; background: transparent; color: var(--b-text); font: var(--b-weight-medium) var(--b-type-lead)/var(--b-leading-ui) var(--b-font-mono); }
.billy-order-field b { color: var(--b-muted); font: var(--b-weight-medium) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-order-presets { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--b-space-1); padding: var(--b-space-2) var(--b-space-3) 0; }
.billy-order-presets button { min-height: 44px; border: 1px solid var(--b-line); border-radius: var(--b-radius-sm); background: transparent; color: var(--b-muted2); cursor: pointer; font: var(--b-weight-medium) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-order-presets button:hover, .billy-order-presets button.on { border-color: var(--b-line2); background: var(--b-selected); color: var(--b-text); }
.billy-order-summary { margin: var(--b-space-3); padding: var(--b-space-3) 0; border-top: 1px solid var(--b-line); border-bottom: 1px solid var(--b-line); }
.billy-order-summary div { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.billy-order-summary dt { color: var(--b-muted2); font-size: var(--b-type-xs); }.billy-order-summary dd { margin: 0; color: var(--b-muted); font: var(--b-weight-regular) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-order-submit { display: block; width: calc(100% - 24px); min-height: 44px; margin: 0 var(--b-space-3); border: 0; border-radius: var(--b-radius-md); color: var(--b-on-green); cursor: pointer; font-weight: var(--b-weight-bold); }
.billy-order-submit.buy { background: var(--b-green); }.billy-order-submit.sell { background: var(--b-red); color: var(--b-on-red); }
.billy-order-submit:hover { filter: brightness(1.06); }.billy-order-submit:disabled { cursor: wait; opacity: .6; }
.billy-order-status { min-height: 32px; margin: var(--b-space-2) var(--b-space-4) 0; color: var(--b-muted2); font-size: var(--b-type-xs); line-height: var(--b-leading-body); text-align: center; }

.billy-orders-panel { grid-column: 1 / 3; display: grid; grid-template-rows: 44px minmax(0,1fr); }
.billy-orders-tabs { display: flex; align-items: stretch; gap: var(--b-space-5); padding: 0 var(--b-space-4); border-bottom: 1px solid var(--b-line); }
.billy-orders-tabs button { position: relative; min-height: 44px; border: 0; background: transparent; color: var(--b-muted2); cursor: pointer; font-size: var(--b-type-xs); font-weight: var(--b-weight-medium); }
.billy-orders-tabs button.on { color: var(--b-text); }.billy-orders-tabs button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--b-primary); }
.billy-orders-body { min-height: 0; overflow: auto; }
.billy-orders-empty { height: 100%; min-height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--b-space-1); color: var(--b-muted2); text-align: center; }
.billy-orders-empty b { color: var(--b-muted); font-size: var(--b-type-sm); }.billy-orders-empty span { font-size: var(--b-type-xs); }
.billy-position-table { min-width: 670px; }
.billy-position-row { min-height: 40px; display: grid; grid-template-columns: 1.1fr .7fr .9fr .9fr .8fr 62px; align-items: center; gap: var(--b-space-2); padding: 0 var(--b-space-4); border-bottom: 1px solid var(--b-line); color: var(--b-muted); font: var(--b-weight-regular) var(--b-type-xs)/1 var(--b-font-mono); }
.billy-position-row.head { min-height: 32px; color: var(--b-muted2); font: var(--b-weight-medium) var(--b-type-xs)/1 var(--b-font-sans); text-transform: uppercase; letter-spacing: var(--b-tracking-caps); }
.billy-position-row b { color: var(--b-text); }.billy-position-row button { justify-self: end; padding: var(--b-space-1) var(--b-space-2); border: 1px solid var(--b-line2); border-radius: var(--b-radius-sm); background: transparent; color: var(--b-muted); cursor: pointer; font-size: var(--b-type-xs); }
.billy-position-row button:hover { color: var(--b-text); background: var(--b-selected); }

.billy-mobile-nav { display: none; }

@media (max-width: 1100px) {
  .billy-exchange { grid-template-columns: minmax(430px,1fr) 300px; grid-template-rows: minmax(360px,1fr) 280px 190px; overflow: auto; }
  .billy-chart-panel { grid-column: 1; grid-row: 1; }
  .billy-book-panel { grid-column: 1; grid-row: 2; }
  .billy-ticket-panel { grid-column: 2; grid-row: 1 / 3; }
  .billy-orders-panel { grid-column: 1 / 3; grid-row: 3; }
}

@media (max-width: 980px) {
  .billy-buy-grid { grid-template-columns: minmax(0,1fr) 390px; gap: var(--b-space-6); }
  .billy-overview { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .billy-marketbar dl > div:nth-child(3), .billy-marketbar dl > div:nth-child(4) { display: none; }
  .billy-product .top .ghosttop, .billy-product .presence { display: none !important; }
}

@media (max-width: 760px) {
  .billy-product .app { height: 100dvh; padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .billy-product .top { min-height: 60px; height: 60px; padding: 0 var(--b-space-4); gap: var(--b-space-2); overflow: visible; }
  .billy-product .brand { height: 39px; min-width: 149px; max-width: 149px; flex-basis: 149px; }.billy-product .brand svg { height: 31px; }
  .billy-brand-lockup { gap: var(--b-space-2); }
  .billy-logo-mark { width: 32px; height: 32px; border-radius: var(--b-radius-md); font-size: var(--b-type-base); }
  .billy-logo-word { font-size: var(--b-type-body); }
  .billy-product .sections { display: none; }.billy-product .top .demo { display: none !important; }
  .billy-product .top .sp { flex: 1; }.billy-product .top .me { display: none !important; }
  .billy-product .top button#login { min-height: 44px; padding: var(--b-space-2) var(--b-space-3); font-size: var(--b-type-sm); }
  .billy-product .top .billy-theme-toggle { min-width: 44px; min-height: 44px; padding: var(--b-space-2) var(--b-space-3); }
  .billy-product footer { display: none; }
  .billy-mobile-nav {
    position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3,1fr);
    min-height: calc(66px + env(safe-area-inset-bottom)); padding: var(--b-space-2) var(--b-space-2) env(safe-area-inset-bottom);
    border-top: 1px solid var(--b-line); background: var(--b-nav);
  }
  .billy-mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--b-space-1); border: 0; border-radius: var(--b-radius-md); background: transparent; color: var(--b-muted2); font-size: var(--b-type-xs); font-weight: var(--b-weight-semibold); }
  .billy-mobile-nav button.on { color: var(--b-primary-ink); background: var(--b-selected); }.billy-mobile-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.55; }
  .billy-page { width: calc(100% - 32px); padding: var(--b-space-5) 0 var(--b-space-8); }
  .billy-page-head, .billy-markets-head { align-items: start; flex-direction: column; gap: var(--b-space-5); }
  .billy-page h1 { font-size: var(--b-type-display); line-height: var(--b-leading-tight); }.billy-page p { font-size: var(--b-type-body); }
  .billy-page-head > div:first-child > .billy-eyebrow, .billy-buy-context { display: none; }
  .billy-page-head > div:first-child p { margin-top: var(--b-space-3); }
  .billy-buy-page { padding-top: var(--b-space-4); }
  .billy-buy-left { display: none; }
  .billy-buy-rail > .billy-page-tabs { margin-bottom: var(--b-space-5); }
  .billy-buy-page .billy-page-head { gap: 0; }
  .billy-buy-page .billy-page-head > div:first-child { display: none; }
  .billy-page-tabs { width: 100%; gap: 0; border-bottom: 1px solid var(--b-line); }
  .billy-page-tabs button { flex: 1; min-width: 0; min-height: 44px; padding: 0 var(--b-space-2); }
  .billy-page-tabs button::after { height: 2px; }
  .billy-buy-grid { display: block; margin-top: var(--b-space-5); }
  .billy-buy-card { width: 100%; margin-top: 0; padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .billy-buy-modebar { margin-bottom: var(--b-space-4); }
  .billy-segmented { gap: var(--b-space-5); }
  .billy-segmented button { min-height: 44px; }
  .billy-quote-live { font-size: var(--b-type-xs); }
  .billy-converter { border-radius: var(--b-radius-lg); }
  .billy-converter .billy-amount-field { padding: var(--b-space-4); }
  .billy-amount-field input, .billy-amount-field output { font-size: var(--b-type-number); }
  .billy-select-control, .billy-select-control select { min-height: 44px; }
  .billy-methods { margin-top: var(--b-space-5); }
  .billy-quote-summary { margin-top: var(--b-space-5); padding-top: var(--b-space-5); }
  .billy-primary-action { min-height: 52px; }
  .billy-markets-page { padding-top: var(--b-space-6); }.billy-markets-head h1 { font-size: var(--b-type-display); }.billy-markets-head p { margin-top: var(--b-space-3); }
  .billy-search { width: 100%; }
  .billy-overview { display: none; }.billy-market-tools { margin-top: var(--b-space-6); padding-bottom: var(--b-space-2); }.billy-market-count { display: none; }
  .billy-market-row { grid-template-columns: minmax(110px,1.25fr) minmax(105px,1fr) .9fr; min-height: 59px; }
  .billy-market-row.header { min-height: 44px; }.billy-market-row.header > :nth-child(3), .billy-market-row.header > :nth-child(5) { display: none; }
  .billy-market-row.header > :nth-child(4) { display: block; }
  .billy-market-row > :nth-child(3), .billy-market-row > :nth-child(5) { display: none; }
  .billy-market-row > :nth-child(2)::after { content: attr(data-change); display: block; margin-top: var(--b-space-1); }
  .billy-market-row > .up-after::after { color: var(--b-green); }.billy-market-row > .down-after::after { color: var(--b-red); }
  .billy-market-row > strong { font-size: var(--b-type-xs); }.billy-market-row > span:nth-child(4) { display: block; font-size: var(--b-type-xs); }
  .billy-market-row small { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .billy-detail-head { align-items: start; flex-direction: column; }.billy-detail-head > div:last-child { align-items: start; }
  .billy-detail-grid { display: block; }.billy-detail-ticket { margin-top: var(--b-space-3); }
  .billy-spark-svg, .billy-spark-loading { height: 190px; }
  .billy-spark-head { flex-direction: column; align-items: start; gap: var(--b-space-2); }
  .billy-marketbar { flex: 0 0 72px; min-height: 72px; padding: 0 var(--b-space-2); }
  .billy-pair { width: 136px; padding: 0 var(--b-space-2); }.billy-pair small, .billy-pair svg { display: none; }
  .billy-quote-main { min-width: 122px; padding: 0 var(--b-space-3); }.billy-quote-main strong { font-size: var(--b-type-sm); }
  .billy-marketbar dl { margin-left: auto; }.billy-marketbar dl > div { min-width: 92px; padding: 0 var(--b-space-2); }.billy-marketbar dl > div:nth-child(n+2) { display: none; }
  .billy-live-dot { display: none; }
  .billy-product .tradepanel, .billy-product #followbar { top: 134px; }
  .billy-product-main.exchange-view { overflow: auto; }
  .billy-exchange { height: auto; min-height: 100%; display: block; overflow: visible; padding: var(--b-space-2); }
  .billy-exchange-mobile-tabs {
    position: sticky; z-index: 12; top: 0; display: grid; grid-template-columns: repeat(4,1fr); gap: var(--b-space-1);
    margin-bottom: var(--b-space-2); padding: var(--b-space-1); border: 1px solid var(--b-line); border-radius: var(--b-radius-md); background: var(--b-nav);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  }
  .billy-exchange-mobile-tabs button { min-width: 0; min-height: 44px; border: 0; border-radius: var(--b-radius-sm); background: transparent; color: var(--b-muted2); font-size: var(--b-type-xs); font-weight: var(--b-weight-semibold); }
  .billy-exchange-mobile-tabs button.on { background: var(--b-selected-strong); color: var(--b-text); }
  .billy-exchange[data-mobile-panel="chart"] > :is(.billy-ticket-panel,.billy-book-panel,.billy-orders-panel),
  .billy-exchange[data-mobile-panel="trade"] > :is(.billy-chart-panel,.billy-book-panel,.billy-orders-panel),
  .billy-exchange[data-mobile-panel="book"] > :is(.billy-chart-panel,.billy-ticket-panel,.billy-orders-panel),
  .billy-exchange[data-mobile-panel="activity"] > :is(.billy-chart-panel,.billy-ticket-panel,.billy-book-panel) { display: none; }
  .billy-chart-panel { min-height: 520px; }.billy-exchange-toolbar { padding: 0 var(--b-space-3); }
  .billy-timeframes { max-width: 100%; overflow-x: auto; scrollbar-width: none; }.billy-timeframes button { min-width: 44px; height: 44px; }
  .billy-ticket-panel { width: 100%; min-height: 510px; overflow: visible; }
  .billy-ticket-head { position: static; }.billy-book-panel { width: 100%; min-height: 500px; }
  .billy-orders-panel { width: 100%; min-height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  .billy-product *, .billy-product *::before, .billy-product *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
