/* ==========================================================================
   Detion app — premium glass terminal, same material as the home page.
   ========================================================================== */

:root {
  --void: #080a19;
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.74);
  --text-3: rgba(255, 255, 255, 0.5);
  --text-4: rgba(255, 255, 255, 0.3);
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.14);
  --raise: rgba(255, 255, 255, 0.04);
  --raise-2: rgba(255, 255, 255, 0.075);
  --panel: rgba(12, 12, 19, 0.66);
  --panel-solid: #0d0e17;
  --sticky: rgba(15, 15, 24, 0.97);

  --buy: #3ee6a0;
  --sell: #ff6a74;
  --accent: #ff6a55;
  --warn: #ffc15a;

  --solid: #e9e9e9;
  --ink: #0a0707;
  --nav-surface: rgba(10, 7, 7, 0.35);
  --actions-surface: rgba(0, 0, 0, 0.35);

  --font-display: "STIX Two Text", "Times New Roman", serif;
  --font-ui: "Switzer", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-label: "General Sans", "Switzer", "Inter", Arial, sans-serif;

  --fs: 13px;
  --row: 32px;
  --cw: 84px;
  --sw: 88px;
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 196px;
  --topbar-h: 56px;
  --status-h: 28px;
  --gap: 8px;
}

body.is-compact {
  --row: 26px;
  --fs: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--void);
  color: var(--text);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 450;
  font-size: var(--fs);
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: none;
}

button,
a,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  text-decoration: none;
}

h1,
h2,
h3,
p,
ul,
dl,
dd {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection {
  background: rgba(255, 80, 60, 0.45);
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transform: translateY(-160%);
}

.skip:focus {
  transform: none;
}

.is-up {
  color: var(--buy);
}

.is-down {
  color: var(--sell);
}

/* --------------------------------------------------------------- Icons */

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--inline {
  width: 14px;
  height: 14px;
  margin-left: 4px;
  vertical-align: -2px;
}

.icon--end {
  width: 14px;
  height: 14px;
  margin-left: auto;
  opacity: 0.55;
}

.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--text-2);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.icon-btn:hover,
.icon-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.icon-btn--sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.icon-btn--sm .icon {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------ Backdrop */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--void);
  pointer-events: none;
}

.backdrop__img {
  position: absolute;
  left: 50%;
  top: 0;
  width: max(108.699%, 172.95svh);
  height: auto;
  transform: translate(-50%, -36.716%);
  filter: blur(44px) saturate(1.15) brightness(0.62);
  opacity: 0.92;
}

.backdrop__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(75% 50% at 50% 108%, rgba(255, 80, 60, 0.26), transparent 70%),
    radial-gradient(50% 36% at 10% -4%, rgba(120, 110, 255, 0.16), transparent 70%);
}

.backdrop__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 10, 25, 0.5) 0%, rgba(8, 10, 25, 0.76) 38%, rgba(8, 10, 25, 0.9) 100%);
}

/* ---------------------------------------------------------------- Shell */

.shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100%;
  transition: grid-template-columns 0.28s cubic-bezier(0.3, 0.7, 0.2, 1);
}

body.is-sidebar-collapsed .shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(4, 5, 14, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s;
}

/* -------------------------------------------------------------- Sidebar */

.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 18px 12px 12px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: rgba(8, 10, 25, 0.55);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  transition: opacity 0.2s ease, visibility 0.28s;
}

body.is-sidebar-collapsed .sidebar {
  opacity: 0;
  visibility: hidden;
  border-right-color: transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  color: #fff;
}

.brand__mark {
  height: 30px;
  width: auto;
  aspect-ratio: 1856 / 2304;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 27px;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  margin-top: 22px;
  overflow: auto;
}

.side-nav__label {
  padding: 14px 10px 6px;
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
}

.side-nav__label:first-child {
  padding-top: 0;
}

.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  color: var(--text-2);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.side-link[aria-current="page"] {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.side-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 10px;
}

.side-card {
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(130% 150% at 50% 0%, rgba(247, 127, 113, 0) 52%, rgba(247, 127, 113, 0.3) 100%),
    rgba(255, 255, 255, 0.03);
}

.side-card__title {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.side-card__text {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-3);
}

/* --------------------------------------------------------------- Topbar */

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  height: var(--topbar-h);
  padding: 0 14px 0 10px;
}

.brand--bar {
  display: none;
}

.top-tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  margin-left: 6px;
  border-radius: 12px;
  background: var(--nav-surface);
}

.top-tab {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  color: var(--text-2);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.top-tab:hover {
  color: #fff;
}

.top-tab[aria-current="page"] {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 3px;
  border-radius: 13px;
  background: var(--actions-surface);
}

/* -------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
  height: 36px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.2s ease, opacity 0.18s ease;
}

.btn--solid {
  background: var(--solid);
  color: var(--ink);
}

.btn--solid:hover {
  background: #fff;
}

.btn--ghost {
  color: #fff;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn--sm {
  height: 28px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn--block {
  width: 100%;
}

.btn--primary {
  height: 44px;
  border-radius: 12px;
  background: var(--solid);
  color: var(--ink);
  font-size: 14px;
}

.btn--primary:hover:not(:disabled) {
  background: #fff;
  box-shadow: 0 10px 34px -10px rgba(255, 80, 60, 0.6);
}

.btn--primary:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-3);
}

.connect {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 500;
}

.connect__chev {
  width: 16px;
  height: 16px;
  margin-right: -4px;
  opacity: 0.6;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--text-4);
}

.status-dot--ok {
  background: #12b76a;
  box-shadow: 0 0 8px rgba(18, 183, 106, 0.8);
}

/* -------------------------------------------------------------- Notice */

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  margin: 0 12px 8px;
  padding: 7px 8px 7px 14px;
  border: 1px solid rgba(247, 127, 113, 0.26);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(247, 127, 113, 0.12), rgba(247, 127, 113, 0.03));
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-2);
}

.notice p {
  flex: 1;
}

.notice b {
  font-weight: 500;
  color: #fff;
}

@media (max-width: 480px) {
  .notice__more {
    display: none;
  }
}

/* ---------------------------------------------------------------- Views */

.views {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 12px 10px;
}

.view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.boot {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 16px;
  text-align: center;
  color: var(--text-2);
}

.boot__title {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: -0.05em;
  color: #fff;
}

.boot__text {
  max-width: 380px;
  line-height: 1.5;
  color: var(--text-3);
}

.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    rotate: 360deg;
  }
}

/* --------------------------------------------------------------- Status */

.status {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
  height: var(--status-h);
  padding: 0 16px;
  border-top: 1px solid var(--line);
  background: rgba(8, 10, 25, 0.5);
  font-size: 11.5px;
  color: var(--text-3);
}

.status__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.status__spacer {
  flex: 1;
}

.status__latency {
  color: var(--text-4);
}

.status__link {
  display: inline-flex;
  align-items: center;
  color: var(--text-3);
}

.status__link:hover {
  color: #fff;
}

#ws-dot[data-state="open"] {
  background: var(--buy);
  box-shadow: 0 0 8px rgba(62, 230, 160, 0.8);
}

#ws-dot[data-state="connecting"],
#ws-dot[data-state="reconnecting"] {
  background: var(--warn);
  animation: pulse 1.2s ease-in-out infinite;
}

#ws-dot[data-state="closed"] {
  background: var(--sell);
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

/* --------------------------------------------------------------- Panels */

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
  backdrop-filter: blur(30px) saturate(1.2);
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  min-height: 46px;
  padding: 0 10px 0 12px;
  border-bottom: 1px solid var(--line);
}

.panel__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.05em;
}

.panel__tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex: none;
}

.panel__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.tabs {
  display: flex;
  gap: 2px;
}

.tabs button {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-3);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.tabs button:hover {
  color: #fff;
}

.tabs button[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

/* -------------------------------------------------------- Trade layouts */

.trade {
  flex: 1;
  min-height: 560px;
  display: grid;
  gap: var(--gap);
}

.pane-switch {
  display: none;
}

.trade--options {
  grid-template-columns: minmax(0, 1fr) 372px;
  grid-template-rows: minmax(0, 1fr) 224px;
}

.trade--options .chain-panel {
  grid-column: 1;
  grid-row: 1;
}

.trade--options .acct-panel {
  grid-column: 1;
  grid-row: 2;
}

.trade--options .side {
  grid-column: 2;
  grid-row: 1 / 3;
}

.side {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-height: 0;
  overflow: auto;
  border-radius: var(--radius);
}

.side .ticket {
  flex: none;
}

.side .insight {
  flex: 1 0 300px;
}

.trade--perps {
  grid-template-columns: minmax(0, 1fr) 292px 330px;
  grid-template-rows: minmax(0, 1fr) 224px;
}

.trade--perps .chart-panel {
  grid-column: 1;
  grid-row: 1;
}

.trade--perps .acct-panel {
  grid-column: 1;
  grid-row: 2;
}

.trade--perps .mid {
  grid-column: 2;
  grid-row: 1 / 3;
}

.trade--perps .ticket {
  grid-column: 3;
  grid-row: 1 / 3;
  overflow: auto;
}

.mid {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-height: 0;
}

.book-panel {
  flex: 3 1 0;
}

.feed-panel {
  flex: 2 1 0;
}

.book-panel .depth,
.feed-panel .feed-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* ------------------------------------------------------------ Selects etc */

.select {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
}

.select select {
  appearance: none;
  -webkit-appearance: none;
  height: 34px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raise);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.select select:hover {
  background: var(--raise-2);
}

.select select:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 1px;
}

.select option {
  background: #12131c;
  color: #fff;
}

.select--sm select {
  height: 30px;
  font-size: 12.5px;
  border-radius: 9px;
}

.select__chev {
  position: absolute;
  right: 7px;
  width: 16px;
  height: 16px;
  color: var(--text-3);
  pointer-events: none;
}

.select--symbol select {
  font-weight: 500;
  min-width: 82px;
}

.seg {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--raise);
}

.seg__btn {
  flex: 1;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--text-3);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.seg__btn:hover:not(:disabled) {
  color: #fff;
}

.seg__btn.is-on {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.seg__btn:disabled {
  opacity: 0.35;
}

.seg--side .seg__btn {
  height: 32px;
  font-weight: 500;
}

.seg--side .seg__btn.is-buy.is-on {
  background: var(--buy);
  color: #04140c;
}

.seg--side .seg__btn.is-sell.is-on {
  background: var(--sell);
  color: #1c0509;
}

.seg--mini {
  padding: 2px;
  border-radius: 9px;
}

.seg--mini .seg__btn {
  flex: none;
  height: 24px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 7px;
}

.input {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.input:hover {
  background: rgba(255, 255, 255, 0.06);
}

.input:focus-within {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.07);
}

.input input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: 14px;
  text-align: right;
}

.input input::placeholder {
  color: var(--text-4);
}

.input input:disabled {
  color: var(--text-3);
}

.input__prefix,
.input__suffix {
  color: var(--text-3);
  font-size: 12.5px;
}

.input__unit {
  padding: 4px 7px;
  margin-right: -4px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}

button.input__unit:hover {
  background: var(--raise-2);
  color: #fff;
}

.field--stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field--stack .input {
  height: 42px;
}

.field--stack .input input {
  text-align: left;
  font-size: 13.5px;
}

.field--stack .field__label {
  font-size: 12.5px;
  color: var(--text-2);
}

.field__help {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-3);
}

.check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check__box {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  flex: none;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: var(--raise);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.check input:checked + .check__box {
  background: #fff;
  border-color: #fff;
}

.check input:checked + .check__box::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid var(--ink);
  border-width: 0 1.8px 1.8px 0;
  rotate: 45deg;
}

.check input:focus-visible + .check__box {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.check--row {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.check--row:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* --------------------------------------------------------- Options chain */

.chain-panel {
  position: relative;
}

.chain__head {
  gap: 8px;
}

.expiries {
  display: flex;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.expiries::-webkit-scrollbar {
  display: none;
}

.exp {
  flex: none;
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--text-3);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.exp:hover {
  color: #fff;
}

.exp[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.chain {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.chain:focus-visible {
  outline-offset: -3px;
}

.chain__state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  min-height: 200px;
  color: var(--text-3);
  font-size: 13px;
}

.chain__table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs);
}

.chain__table .col {
  width: var(--cw);
}

.chain__table .col--strike {
  width: var(--sw);
}

.chain__table th,
.chain__table td {
  padding: 0;
  height: var(--row);
  white-space: nowrap;
}

.chain__table thead th {
  position: sticky;
  z-index: 3;
  background: var(--sticky);
  font-weight: 450;
}

.chain__group th {
  top: 0;
  height: 30px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-align: right;
  color: var(--text-2);
}

.chain__group th.grp--mid + th {
  text-align: left;
}

.chain__group .grp__label {
  display: inline-block;
  padding: 0 38px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.chain__cols th {
  top: 30px;
  height: 28px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line-2);
  font-size: 11.5px;
  text-align: left;
  color: var(--text-3);
}

.chain__table thead .grp--mid {
  z-index: 4;
  overflow: visible;
}

.grp__date {
  margin-right: 4px;
  color: var(--text-2);
}

@media (max-width: 700px) {
  .grp__date {
    display: none;
  }
}

.grp__mid {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  padding: 3px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  font-family: var(--font-ui);
  font-size: 11.5px;
  color: #fff;
}

.chain__table .c {
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  transition: background-color 0.12s ease;
}

.chain__table td.c-bid,
.chain__table td.c-ask {
  padding: 0;
}

.chain__table .strike {
  padding: 0 4px;
  text-align: center;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 1px 0 0 var(--line), inset -1px 0 0 var(--line), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

.chain__table thead .strike {
  background: var(--sticky);
  font-weight: 450;
}

.chain__table .c-mark {
  color: var(--text-2);
}

.chain__table .c-bidSize,
.chain__table .c-askSize,
.chain__table .c-bidIv,
.chain__table .c-askIv,
.chain__table .c-markIv,
.chain__table .c-delta,
.chain__table .c-volume,
.chain__table .c-oi,
.chain__table .c-position {
  color: var(--text-3);
}

.itm-c .s-C,
.itm-p .s-P {
  background: rgba(255, 255, 255, 0.032);
}

.row:hover td.c {
  background-color: rgba(255, 255, 255, 0.045);
}

.row.is-sel td.c {
  background-color: rgba(255, 255, 255, 0.06);
}

.row.is-sel[data-sel="C"] .s-C,
.row.is-sel[data-sel="P"] .s-P {
  background-color: rgba(255, 255, 255, 0.085);
}

.row.is-sel .strike span {
  padding: 3px 8px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.px {
  display: block;
  width: 100%;
  height: var(--row);
  padding: 0 10px;
  text-align: left;
  font-weight: 500;
  transition: background-color 0.12s ease;
}

.px:empty::before {
  content: "\2014";
  color: var(--text-4);
  font-weight: 450;
}

.px--ask {
  color: var(--buy);
  background: color-mix(in srgb, var(--buy) calc(var(--i, 0) * 20%), transparent);
}

.px--bid {
  color: var(--sell);
  background: color-mix(in srgb, var(--sell) calc(var(--i, 0) * 20%), transparent);
}

.px--ask:hover {
  background: color-mix(in srgb, var(--buy) 28%, transparent);
}

.px--bid:hover {
  background: color-mix(in srgb, var(--sell) 28%, transparent);
}

.px.is-sel {
  box-shadow: inset 0 0 0 1px currentColor;
  border-radius: 4px;
}

.spotrow td {
  height: 26px;
  padding: 0;
  position: relative;
}

.spot-l,
.spot-r {
  background-image: linear-gradient(to right, rgba(255, 106, 85, 0.8) 50%, transparent 0);
  background-size: 6px 1px;
  background-repeat: repeat-x;
  background-position: 0 50%;
}

.spot-mid {
  overflow: visible;
}

.spotchip {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--accent);
  box-shadow: 0 6px 18px -6px rgba(255, 80, 60, 0.7);
  font-size: 11.5px;
  font-weight: 600;
  color: #1c0806;
}

@keyframes flash-up {
  from {
    background-color: rgba(62, 230, 160, 0.4);
  }
}

@keyframes flash-down {
  from {
    background-color: rgba(255, 106, 116, 0.4);
  }
}

.flash-up {
  animation: flash-up 0.8s ease-out;
}

.flash-down {
  animation: flash-down 0.8s ease-out;
}

/* ---------------------------------------------------------------- Ticket */

.ticket {
  min-height: 0;
}

.ticket__head {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  padding: 12px 14px 10px;
}

.ticket__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.ticket__sub {
  font-size: 12px;
  color: var(--text-3);
}

.ticket__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 14px;
}

.field--row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.field--row > label,
.field--row .field__label label {
  font-size: 12.5px;
  color: var(--text-2);
}

.field--row .select {
  width: 100%;
}

.field--row .select select {
  width: 100%;
}

.field--price .field__label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.quote {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  transition: background-color 0.15s ease;
}

.quote.is-buy {
  background: rgba(62, 230, 160, 0.12);
  color: var(--buy);
}

.quote.is-sell {
  background: rgba(255, 106, 116, 0.12);
  color: var(--sell);
}

.quote:hover {
  background: rgba(255, 255, 255, 0.16);
}

.ticket__opts {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ticket__opts .check {
  margin-right: auto;
}

.ticket__hint {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-3);
  text-align: center;
}

.sum {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.sum > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
}

.sum dt {
  color: var(--text-3);
}

.sum dd {
  color: var(--text-2);
}

.sum .is-strong dt,
.sum .is-strong dd {
  color: #fff;
  font-weight: 500;
}

.tip {
  border-bottom: 1px dotted var(--text-4);
  cursor: help;
}

/* --------------------------------------------------------------- Insight */

.insight__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.pstats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 14px 6px;
}

.pstats span {
  display: block;
  margin-bottom: 3px;
  font-size: 11.5px;
  color: var(--text-3);
}

.pstats b {
  font-size: 14px;
  font-weight: 500;
}

.pnote {
  min-height: 16px;
  padding: 0 14px;
  font-size: 11.5px;
  color: var(--text-3);
}

.payoff-host {
  position: relative;
  height: clamp(170px, 26vh, 280px);
  margin: 6px 6px 8px;
}

.payoff {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.payoff__grid line {
  stroke: rgba(255, 255, 255, 0.06);
}

.payoff__grid text {
  fill: var(--text-3);
  font-family: var(--font-ui);
  font-size: 10.5px;
}

.payoff__zero {
  stroke: rgba(255, 255, 255, 0.28);
}

.payoff__now {
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 1.3;
  stroke-dasharray: 4 4;
}

.payoff__strike {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-dasharray: 2 4;
}

.payoff__be {
  fill: #fff;
  stroke: var(--void);
  stroke-width: 2;
}

.payoff__spot {
  stroke: var(--accent);
  stroke-dasharray: 3 3;
}

.payoff__chip rect {
  fill: var(--accent);
}

.payoff__chip text {
  fill: #1c0806;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600;
}

.payoff__hover line {
  stroke: rgba(255, 255, 255, 0.4);
}

.payoff__tip {
  position: absolute;
  top: 28px;
  display: flex;
  gap: 8px;
  padding: 5px 9px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(10, 10, 16, 0.92);
  font-size: 11.5px;
  pointer-events: none;
}

.payoff__tip span {
  color: var(--text-3);
}

.gk {
  padding: 6px 14px 14px;
}

.gk__head,
.gk__row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  height: 34px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.gk__head {
  font-size: 11.5px;
  color: var(--text-3);
}

.gk__head span:not(:first-child),
.gk__row b {
  text-align: right;
}

.gk__row span {
  color: var(--text-3);
}

.gk__row b {
  font-weight: 450;
}

/* --------------------------------------------------- Order book + feed */

.depth {
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
  font-size: 12.5px;
}

.depth__head,
.depth__row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  height: 24px;
  padding: 0 14px;
  gap: 8px;
}

.depth__head {
  font-size: 11.5px;
  color: var(--text-3);
}

.depth__head span:not(:first-child),
.depth__row span:not(:first-child),
.feed__head span:not(:first-child),
.feed__row span:not(:first-child) {
  text-align: right;
}

.depth__row {
  position: relative;
  width: 100%;
  text-align: left;
  isolation: isolate;
}

.depth__row::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: 0;
  top: 1px;
  bottom: 1px;
  width: var(--w);
  background: var(--tint);
  transition: width 0.25s ease;
}

.depth__row--ask {
  --tint: rgba(255, 106, 116, 0.13);
}

.depth__row--bid {
  --tint: rgba(62, 230, 160, 0.13);
}

.depth__row--ask span:first-child {
  color: var(--sell);
}

.depth__row--bid span:first-child {
  color: var(--buy);
}

.depth__row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.depth__mid {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 4px 0;
  padding: 7px 14px;
  border-block: 1px solid var(--line);
}

.depth__mid b {
  font-size: 15px;
  font-weight: 500;
}

.depth__mid span {
  font-size: 11.5px;
  color: var(--text-3);
}

.depth__empty {
  padding: 18px 14px;
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
}

.feed {
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
  font-size: 12.5px;
}

.feed__head,
.feed__row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  height: 24px;
  padding: 0 14px;
  gap: 8px;
}

.feed__head {
  position: sticky;
  top: 0;
  background: var(--sticky);
  font-size: 11.5px;
  color: var(--text-3);
}

.feed__row span:first-child {
  color: var(--text-3);
}

/* ----------------------------------------------------------- Perps chart */

.chart-panel {
  min-height: 0;
}

.chart__head {
  gap: 12px;
}

.chart__head .seg {
  margin-left: auto;
}

.chart__name {
  min-width: 0;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.05em;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  flex: none;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.stats > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: none;
}

.stats span {
  font-size: 11.5px;
  color: var(--text-3);
}

.stats b {
  font-size: 13.5px;
  font-weight: 500;
}

.candles {
  position: relative;
  flex: 1;
  min-height: 220px;
}

.candles__canvas {
  position: absolute;
  inset: 0;
  display: block;
  cursor: crosshair;
}

.candles__readout {
  position: absolute;
  top: 8px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11.5px;
  color: var(--text-3);
  pointer-events: none;
}

.candles__readout b {
  font-weight: 450;
}

.chart__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: none;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
}

.chart__src {
  font-size: 11.5px;
  color: var(--text-4);
}

/* -------------------------------------------------------- Account tables */

.acct-panel .acct__body {
  display: flex;
  flex-direction: column;
}

.tbl-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.tbl th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--sticky);
  font-size: 11.5px;
  font-weight: 450;
  text-align: left;
  white-space: nowrap;
  color: var(--text-3);
}

.tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.tbl tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.tbl__empty {
  padding: 40px 14px;
  text-align: center;
  color: var(--text-3);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  padding: 12px;
}

.card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--raise);
}

.card span {
  display: block;
  margin-bottom: 4px;
  font-size: 11.5px;
  color: var(--text-3);
}

.card b {
  font-size: 18px;
  font-weight: 450;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  margin: auto;
  padding: 24px 16px;
  text-align: center;
}

.empty--inline {
  padding: 30px 16px;
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--raise-2);
  color: var(--text-2);
}

.empty__icon .icon {
  width: 20px;
  height: 20px;
}

.empty__title {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: -0.04em;
}

.empty__text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-3);
}

.empty__error {
  color: var(--sell);
}

.empty .btn {
  margin-top: 8px;
}

.acct-panel:not(.acct-panel--page) .empty {
  gap: 4px;
  padding: 10px 16px;
}

.acct-panel:not(.acct-panel--page) .empty__icon {
  display: none;
}

.acct-panel:not(.acct-panel--page) .empty__title {
  font-size: 19px;
}

.acct-panel:not(.acct-panel--page) .empty .btn {
  height: 30px;
  margin-top: 6px;
}

/* ----------------------------------------------------------------- Pages */

.page {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--gap);
  min-height: 0;
}

.page > .panel {
  flex: 1 0 auto;
}

.markets__head {
  gap: 12px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raise);
  color: var(--text-3);
}

.search .icon {
  width: 15px;
  height: 15px;
}

.search:focus-within {
  border-color: rgba(255, 255, 255, 0.4);
}

.search input {
  width: 180px;
  border: 0;
  outline: 0;
  background: none;
  font-size: 13px;
}

.tbl-wrap--page {
  flex: 1;
}

.tbl--markets td,
.tbl--markets th {
  padding-block: 12px;
}

.tbl--markets th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.tbl--markets th[data-sort]:hover {
  color: #fff;
}

.tbl--markets th[aria-sort="ascending"]::after {
  content: " \2191";
}

.tbl--markets th[aria-sort="descending"]::after {
  content: " \2193";
}

.tbl--markets .go,
.tbl--markets th:last-child {
  text-align: right;
}

.coin {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.coin i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(247, 127, 113, 0.95), rgba(125, 105, 255, 0.85));
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: #12060a;
}

.coin b {
  font-weight: 500;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  margin-left: 6px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.chip:hover {
  background: #fff;
  color: var(--ink);
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

.stat-card {
  gap: 6px;
  padding: 16px 18px;
}

.stat-card span {
  font-size: 12px;
  color: var(--text-3);
}

.stat-card b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.acct-panel--page {
  min-height: 360px;
}

/* ---------------------------------------------------- Popovers + dialogs */

.popover {
  position: fixed;
  z-index: 60;
  min-width: 230px;
  max-width: calc(100vw - 16px);
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(14, 14, 22, 0.96);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 24px 60px -14px rgba(0, 0, 0, 0.75);
  animation: pop 0.14s ease-out;
}

@keyframes pop {
  from {
    opacity: 0;
    translate: 0 -4px;
  }
}

.menu__title {
  padding: 8px 10px 4px;
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
}

.menu__who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 6px;
}

.menu__who b {
  font-weight: 500;
}

.menu__who span {
  font-size: 12px;
  color: var(--text-3);
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  text-align: left;
  color: var(--text-2);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.menu__item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.menu__item .icon {
  width: 16px;
  height: 16px;
}

.menu__item em {
  margin-left: auto;
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-4);
}

.menu__item--danger {
  color: var(--sell);
}

.menu__item--danger:hover {
  background: rgba(255, 106, 116, 0.12);
  color: var(--sell);
}

.menu__linked {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
}

.menu__linked small {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-3);
}

.menu hr {
  margin: 6px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.dialog {
  width: 100%;
  max-width: min(448px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
}

.dialog::backdrop {
  background: rgba(4, 5, 14, 0.64);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.dialog[open] .dialog__panel {
  animation: pop-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes pop-in {
  from {
    opacity: 0;
    scale: 0.97;
    translate: 0 8px;
  }
}

.dialog__panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(247, 127, 113, 0) 60%, rgba(247, 127, 113, 0.14) 100%),
    rgba(14, 14, 22, 0.94);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  box-shadow: 0 40px 100px -24px rgba(0, 0, 0, 0.8);
}

.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog__head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.dialog__text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}

.dialog__text b {
  font-weight: 500;
  color: #fff;
}

.dialog__none {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 12px;
  background: var(--raise);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}

.dialog__none a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dialog__error {
  font-size: 12.5px;
  color: var(--sell);
}

.dialog__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.wallet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--raise);
  font-size: 14px;
  text-align: left;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.wallet-opt:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--line-2);
}

.wallet-opt img {
  border-radius: 8px;
}

.wallet-opt.is-busy {
  opacity: 0.6;
}

.wallet-opt__fallback {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--raise-2);
}

.wallet-opt__go {
  margin-left: auto;
  rotate: -90deg;
  color: var(--text-3);
}

.toasts {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 44px;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(20, 20, 30, 0.96);
  font-size: 13px;
  opacity: 0;
  translate: 0 8px;
  transition: opacity 0.22s ease, translate 0.22s ease;
}

.toast.is-in {
  opacity: 1;
  translate: 0 0;
}

.toast--error {
  border-color: rgba(255, 106, 116, 0.5);
}

/* ------------------------------------------------ Trade dock + bottom sheet */

.tradebar {
  display: none;
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: calc(var(--status-h) + 8px);
  align-items: center;
  gap: 12px;
  width: min(560px, calc(100% - 16px));
  margin-inline: auto;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background:
    radial-gradient(90% 160% at 100% 120%, rgba(247, 127, 113, 0.2), rgba(247, 127, 113, 0) 60%),
    rgba(14, 14, 22, 0.8);
  -webkit-backdrop-filter: blur(26px) saturate(1.3);
  backdrop-filter: blur(26px) saturate(1.3);
  box-shadow: 0 22px 54px -18px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: dock-in 0.55s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

@keyframes dock-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

.tradebar__info {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.tradebar__title {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1;
  letter-spacing: -0.05em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tradebar__quote {
  font-size: 12px;
  color: var(--text-3);
}

.tradebar__quote.is-buy {
  color: var(--buy);
}

.tradebar__quote.is-sell {
  color: var(--sell);
}

.tradebar__btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px 0 22px;
  border-radius: 15px;
  background: var(--solid);
  color: var(--ink);
  font-size: 14.5px;
  letter-spacing: -0.01em;
  transition: background-color 0.18s ease, box-shadow 0.2s ease, scale 0.18s ease;
}

.tradebar__btn .icon {
  width: 16px;
  height: 16px;
  rotate: 180deg;
}

.tradebar__btn:hover {
  background: #fff;
  box-shadow: 0 10px 34px -10px rgba(255, 80, 60, 0.7);
}

.tradebar__btn:active {
  scale: 0.97;
}

.sheet {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: hidden;
}

.sheet[open] {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 8px calc(8px + env(safe-area-inset-bottom));
}

.sheet::backdrop {
  background: rgba(4, 5, 14, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.sheet[open]::backdrop {
  animation: sheet-fade 0.32s ease-out;
}

.sheet.is-closing::backdrop {
  animation: sheet-fade-out 0.26s ease-in forwards;
}

.sheet__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  max-height: min(94dvh, 800px);
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 28px;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(247, 127, 113, 0.17), rgba(247, 127, 113, 0) 64%),
    rgba(13, 13, 21, 0.9);
  -webkit-backdrop-filter: blur(36px) saturate(1.3);
  backdrop-filter: blur(36px) saturate(1.3);
  box-shadow:
    0 -14px 70px -24px rgba(255, 106, 85, 0.4),
    0 40px 100px -20px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  transition: translate 0.32s cubic-bezier(0.2, 0.9, 0.25, 1);
  animation: sheet-up 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

.sheet__panel.is-dragging {
  transition: none;
}

.sheet.is-closing .sheet__panel {
  animation: sheet-down 0.28s cubic-bezier(0.5, 0, 0.9, 0.5) forwards;
}

@keyframes sheet-up {
  from {
    opacity: 0.4;
    transform: translateY(calc(100% + 32px));
  }
}

@keyframes sheet-down {
  to {
    opacity: 0.4;
    transform: translateY(calc(100% + 32px));
  }
}

@keyframes sheet-fade {
  from {
    opacity: 0;
  }
}

@keyframes sheet-fade-out {
  to {
    opacity: 0;
  }
}

.sheet__grab {
  display: grid;
  flex: none;
  place-items: center;
  height: 24px;
  cursor: grab;
  touch-action: none;
}

.sheet__grab i {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.sheet__close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.sheet__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.sheet .ticket {
  flex: none;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.sheet .ticket__head {
  padding: 4px 58px 10px 22px;
  border-bottom: 0;
  cursor: grab;
  touch-action: none;
}

.sheet .ticket__title {
  font-size: 32px;
}

.sheet .ticket__body {
  gap: 10px;
  padding: 6px 22px 24px;
}

.sheet .btn--primary {
  height: 50px;
  border-radius: 14px;
  font-size: 15px;
}

/* ============================================================ Responsive */

@media (max-width: 1360px) {
  .trade--perps {
    grid-template-columns: minmax(0, 1fr) 260px 308px;
  }

  .trade--options {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

@media (max-width: 1100px) {
  :root {
    --sidebar-w: 0px;
  }

  .shell,
  body.is-sidebar-collapsed .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar,
  body.is-sidebar-collapsed .sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    padding-top: 20px;
    opacity: 1;
    visibility: hidden;
    border-right-color: var(--line);
    background: rgba(10, 11, 26, 0.96);
    transform: translateX(-102%);
    transition: transform 0.3s cubic-bezier(0.3, 0.7, 0.2, 1), visibility 0.3s;
  }

  body.is-drawer-open .sidebar {
    visibility: visible;
    transform: none;
  }

  body.is-drawer-open .scrim {
    opacity: 1;
    visibility: visible;
  }

  .brand--bar {
    display: flex;
    padding: 0 4px;
  }

  .brand--bar .brand__mark {
    height: 26px;
  }

  .brand--bar .brand__name {
    font-size: 24px;
  }

  .top-tabs {
    margin-left: 4px;
  }

  .trade {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .pane-switch {
    display: flex;
    gap: 2px;
    flex: none;
    padding: 3px;
    border-radius: 12px;
    background: var(--nav-surface);
  }

  .pane-switch button {
    flex: 1;
    height: 32px;
    border-radius: 9px;
    font-size: 13px;
    color: var(--text-3);
    transition: background-color 0.18s ease, color 0.18s ease;
  }

  .pane-switch button.is-on {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
  }

  .trade > :not(.pane-switch) {
    display: none;
    flex: 1;
    min-height: 0;
  }

  .trade[data-pane="chain"] > .chain-panel,
  .trade[data-pane="chart"] > .chart-panel,
  .trade[data-pane="book"] > .mid,
  .trade[data-pane="insight"] > .side,
  .trade[data-pane="account"] > .acct-panel {
    display: flex;
  }

  /* the docked Trade bar floats over the bottom of the page */
  body.has-tradebar .views {
    padding-bottom: 76px;
  }

  .tradebar {
    display: flex;
  }

  .trade[data-pane="chart"] > .chart-panel {
    min-height: 460px;
  }

  .side .insight {
    flex: none;
  }

  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .top-tabs {
    display: none;
  }

  .chart__name,
  .stats > div:nth-child(2),
  .stats > div:nth-child(4),
  .stats > div:nth-child(7) {
    display: none;
  }

  .stats {
    gap: 8px 22px;
  }

  .views {
    padding: 0 8px 8px;
  }

  .notice {
    margin: 0 8px 8px;
  }

  .topbar {
    padding: 0 8px;
  }

  .status__item--clock {
    display: none;
  }

  .search input {
    width: 110px;
  }

  .markets__head .seg {
    display: none;
  }

  .tbl--markets th:nth-child(4),
  .tbl--markets td:nth-child(4),
  .tbl--markets th:nth-child(5),
  .tbl--markets td:nth-child(5),
  .tbl--markets th:nth-child(6),
  .tbl--markets td:nth-child(6) {
    display: none;
  }
}

@media (max-width: 480px) {
  .brand--bar .brand__name {
    display: none;
  }

  .connect {
    padding: 0 12px;
  }

  .summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-card b {
    font-size: 26px;
  }

  .field--row {
    grid-template-columns: 84px minmax(0, 1fr);
  }
}

@media (max-height: 780px) {
  .side-card {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .spinner {
    animation: none;
    border-top-color: rgba(255, 255, 255, 0.18);
  }
}
