@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #080b0d;
  --surface: #0d1114;
  --surface-2: #12171b;
  --line: #20272c;
  --line-soft: #171d21;
  --text: #edf3f0;
  --muted: #7f8b87;
  --muted-2: #4f5b57;
  --accent: #b7f34a;
  --accent-soft: rgba(183, 243, 74, .11);
  --cyan: #58c7c2;
  --amber: #edb45c;
  --danger: #f27676;
  --success: #62d49b;
  --sidebar: 236px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 0 0 auto;
  width: var(--sidebar);
  padding: 28px 22px 24px;
  background: #0a0e10;
  border-left: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand {
  direction: ltr;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 7px 32px;
}
.brand-mark {
  width: 39px;
  height: 39px;
  border: 1px solid #344036;
  border-radius: 11px;
  display: grid;
  place-content: center;
  grid-template-columns: repeat(3, 4px);
  gap: 3px;
  transform: skew(-7deg);
  background: linear-gradient(145deg, rgba(183,243,74,.09), transparent);
}
.brand-mark i { width: 4px; border-radius: 4px; background: var(--accent); }
.brand-mark i:nth-child(1) { height: 10px; margin-top: 8px; opacity: .5; }
.brand-mark i:nth-child(2) { height: 18px; }
.brand-mark i:nth-child(3) { height: 13px; margin-top: 5px; opacity: .75; }
.brand b {
  display: block;
  letter-spacing: 3px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.1;
}
.brand small {
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 8px;
  letter-spacing: 2px;
}
.nav-list { display: grid; gap: 6px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  padding: 11px 12px;
  border-radius: 8px;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.nav-item:hover { color: var(--text); transform: translateX(-2px); }
.nav-item.active { color: var(--text); background: var(--accent-soft); }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon { width: 22px; text-align: center; font: 18px/1 Consolas, monospace; }
.sidebar-foot { margin-top: auto; }
.guardrail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.guardrail-icon { color: var(--accent); }
.guardrail b, .guardrail small { display: block; }
.guardrail b { font-size: 11px; }
.guardrail small, .version { color: var(--muted); font-size: 9px; }
.version { display: block; direction: ltr; text-align: center; padding-top: 20px; }

.workspace { margin-right: var(--sidebar); min-height: 100vh; }
.topbar {
  height: 92px;
  padding: 0 38px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 11, 13, .92);
  backdrop-filter: blur(16px);
}
.eyebrow { color: var(--muted); font-size: 10px; margin: 0 0 6px; }
h1 { margin: 0; font-size: 22px; font-weight: 720; letter-spacing: -.35px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.connection-state { display: flex; align-items: center; gap: 9px; min-width: 155px; }
.connection-state b, .connection-state small { display: block; }
.connection-state b { font-size: 11px; }
.connection-state small {
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
  direction: ltr;
  text-align: right;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(237,180,92,.09);
}
.connection-state.live .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.connection-state.error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(242,118,118,.09);
}
.refresh-button {
  height: 38px;
  color: #0b0e0d;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease;
}
.refresh-button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.refresh-button.loading span { animation: spin .8s linear infinite; }
.menu-button { display: none; }

.dashboard { padding: 22px 38px 56px; max-width: 1640px; margin: 0 auto; }
.freshness-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 18px;
}
.freshness-row p { margin: 0; }
.freshness-row > div { direction: ltr; display: flex; align-items: center; gap: 9px; }
.separator { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--surface);
  animation: rise .45s ease both;
}
.metric { min-width: 0; padding: 19px 21px 17px; border-left: 1px solid var(--line); }
.metric:last-child { border-left: 0; }
.metric-primary { background: linear-gradient(145deg, rgba(183,243,74,.06), transparent 65%); }
.metric-label {
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}
.metric-label i { font-style: normal; color: var(--muted-2); font-size: 15px; }
.metric-label .up { color: var(--accent); }
.metric strong {
  display: block;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 29px;
  font-weight: 650;
  line-height: 1.2;
  direction: ltr;
  text-align: right;
  margin: 12px 0 7px;
  letter-spacing: -.6px;
}
.metric strong small { font-size: 12px; color: var(--muted); margin-right: 3px; }
.metric p { margin: 0 0 14px; color: var(--muted); font-size: 9px; }
.metric p b { color: #b9c2be; font-weight: 500; }
.metric-bar { height: 2px; background: #1b2220; overflow: hidden; }
.metric-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .7s cubic-bezier(.2,.8,.2,1);
}
.metric-bar.neutral i { background: var(--cyan); }
.metric-bar.warning i { background: var(--amber); }
.metric-bar.success i { background: var(--success); }

.primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, .8fr);
  gap: 14px;
  margin-top: 14px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  animation: rise .5s .08s ease both;
}
.panel-header {
  min-height: 70px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.panel-header h2 { font-size: 13px; font-weight: 680; margin: 0 0 5px; }
.panel-header p { color: var(--muted); font-size: 9px; margin: 0; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 9px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 2px; display: inline-block; }
.legend-in { background: var(--accent); }
.legend-out { background: var(--cyan); }

.chart-wrap { position: relative; height: 285px; padding: 10px 16px 8px; direction: ltr; }
#flowChart { width: 100%; height: 100%; overflow: visible; }
#flowChart .grid-line { stroke: #1d2428; stroke-width: 1; }
#flowChart .grid-text, #flowChart .x-text {
  fill: #59645f;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
#flowChart .area-in { fill: url(#flowGradient); }
#flowChart .line-in {
  stroke: var(--accent);
  stroke-width: 2.2;
  fill: none;
  vector-effect: non-scaling-stroke;
}
#flowChart .line-out {
  stroke: var(--cyan);
  stroke-width: 1.7;
  fill: none;
  vector-effect: non-scaling-stroke;
  opacity: .82;
}
#flowChart .point { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart-empty {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.donut-layout {
  min-height: 285px;
  padding: 24px 20px;
  display: grid;
  grid-template-columns: 128px 1fr;
  align-items: center;
  gap: 22px;
}
.donut {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--line) 0 100%);
  position: relative;
  transition: background .4s ease;
}
.donut::before {
  content: "";
  position: absolute;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--surface);
}
.donut > div { position: relative; text-align: center; }
.donut strong, .donut span { display: block; }
.donut strong {
  direction: ltr;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 21px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.donut span { color: var(--muted); font-size: 9px; margin-top: 3px; }
.state-list { display: grid; gap: 12px; }
.state-item {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  color: var(--muted);
}
.state-item i { width: 6px; height: 6px; border-radius: 50%; }
.state-item b {
  color: #c8d0cd;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 10px;
  font-weight: 500;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

.orders-panel { margin-top: 14px; }
.order-header { align-items: flex-end; }
.filters { display: flex; gap: 8px; }
.filters label { position: relative; }
.filters label > span {
  position: absolute;
  top: -15px;
  right: 3px;
  color: var(--muted);
  font-size: 8px;
}
.filters select {
  color: #bac4c0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 31px;
  padding: 0 9px 0 25px;
  outline: none;
  font-size: 9px;
}
.filters select:focus { border-color: #465346; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th {
  color: var(--muted);
  text-align: right;
  font-size: 8px;
  font-weight: 500;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: #0b0f11;
}
td {
  height: 58px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line-soft);
  color: #b9c2be;
  font-size: 10px;
  white-space: nowrap;
}
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(255,255,255,.018); }
tbody tr:last-child td { border-bottom: 0; }
.id-cell time, .id-cell small, .market-cell b, .market-cell small { display: block; }
.id-cell { direction: ltr; text-align: right; }
.id-cell time {
  color: #dce3e0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.id-cell small, .market-cell small {
  color: var(--muted-2);
  font-size: 8px;
  margin-top: 4px;
}
.market-cell { direction: ltr; text-align: right; }
.market-cell b {
  color: #e6ece9;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
}
.num {
  direction: ltr;
  text-align: right;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-variant-numeric: tabular-nums;
}
.side, .state-badge { display: inline-flex; align-items: center; gap: 6px; }
.side::before { content: ""; width: 5px; height: 5px; border-radius: 50%; }
.side.buy { color: var(--success); }
.side.buy::before { background: var(--success); }
.side.sell { color: var(--danger); }
.side.sell::before { background: var(--danger); }
.fill-cell { min-width: 105px; }
.fill-line { width: 70px; height: 2px; background: #22292c; margin-top: 6px; }
.fill-line i { display: block; height: 100%; background: var(--accent); }
.state-badge {
  border: 1px solid #28302d;
  border-radius: 20px;
  padding: 4px 8px;
  color: #aab3af;
  font-size: 8px;
}
.state-badge.failed { color: var(--danger); border-color: rgba(242,118,118,.25); }
.state-badge.traded { color: var(--success); border-color: rgba(98,212,155,.25); }
.state-badge.active { color: var(--amber); border-color: rgba(237,180,92,.25); }
.empty-row td, div.empty-row { min-height: 110px; text-align: center; color: var(--muted); padding: 45px; }
.skeleton-row span {
  display: block;
  height: 9px;
  border-radius: 10px;
  background: linear-gradient(90deg, #151b1e, #20272a, #151b1e);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.table-footer {
  min-height: 42px;
  border-top: 1px solid var(--line-soft);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8px;
}
.table-footer b { color: var(--accent); font-weight: 500; }

.market-panel { margin-top: 14px; }
.market-list { padding: 6px 20px 12px; }
.market-row {
  display: grid;
  grid-template-columns: 120px 1fr 95px 95px 85px;
  align-items: center;
  gap: 18px;
  min-height: 54px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 9px;
  color: var(--muted);
}
.market-row:last-child { border-bottom: 0; }
.market-row strong {
  direction: ltr;
  text-align: right;
  color: #dbe3df;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
}
.market-track { height: 3px; background: #1c2325; }
.market-track i { display: block; height: 100%; background: var(--accent); }
.market-stat { direction: ltr; text-align: right; }
.market-stat b { color: #c5ceca; font-weight: 500; }
.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  max-width: 340px;
  background: #17201c;
  color: #dce8e1;
  border: 1px solid #2e3b34;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 10px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .2s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateY(0); }

@keyframes rise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(-360deg); } }

@media (max-width: 1100px) {
  :root { --sidebar: 210px; }
  .dashboard, .topbar { padding-left: 24px; padding-right: 24px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-left: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .primary-grid { grid-template-columns: 1fr; }
  .donut-layout { grid-template-columns: 150px 1fr; }
  .state-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-header { align-items: flex-start; flex-direction: column; }
  .market-row { grid-template-columns: 100px 1fr 70px 70px; }
  .market-row > :last-child { display: none; }
}

@media (max-width: 760px) {
  .sidebar {
    transform: translateX(100%);
    transition: transform .25s ease;
    box-shadow: -20px 0 50px rgba(0,0,0,.35);
  }
  body.menu-open .sidebar { transform: translateX(0); }
  .workspace { margin-right: 0; }
  .topbar { height: 76px; padding: 0 16px; }
  .menu-button {
    display: block;
    color: var(--muted);
    background: transparent;
    border: 0;
    font-size: 20px;
    padding: 8px;
  }
  .eyebrow { display: none; }
  h1 { font-size: 17px; }
  .connection-state { min-width: auto; }
  .connection-state > div { display: none; }
  .refresh-button b { display: none; }
  .refresh-button { width: 38px; justify-content: center; padding: 0; }
  .dashboard { padding: 16px 12px 40px; }
  .freshness-row { align-items: flex-start; gap: 10px; flex-direction: column; }
  .freshness-row > div { max-width: 100%; overflow: hidden; }
  #sourceTable { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric { padding: 16px 14px; }
  .metric strong { font-size: 23px; }
  .panel-header { padding: 16px; }
  .legend { display: none; }
  .chart-wrap { height: 245px; padding-right: 3px; padding-left: 3px; }
  .donut-layout { grid-template-columns: 110px 1fr; gap: 18px; padding: 20px 16px; }
  .donut { width: 110px; height: 110px; }
  .donut::before { width: 74px; height: 74px; }
  .state-list { grid-template-columns: 1fr; gap: 9px; }
  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 23px 8px;
    padding-top: 11px;
  }
  .filters select { width: 100%; }
  .market-row { grid-template-columns: 88px 1fr 65px; gap: 10px; }
  .market-row > :nth-last-child(-n+2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* Live market */
.live-dashboard {
  max-width: 1540px;
  margin: 0 auto;
  padding: 24px 38px 48px;
}
.market-selector {
  min-height: 88px;
  display: grid;
  grid-template-columns: minmax(260px, 390px) auto 1fr;
  align-items: end;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 6;
}
.coin-select-wrap { position: relative; }
.coin-select-wrap > label,
.unit-switch legend {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin: 0 3px 8px;
}
.coin-select-button {
  width: 100%;
  height: 52px;
  padding: 0 13px;
  display: grid;
  grid-template-columns: 36px 1fr 22px;
  gap: 11px;
  align-items: center;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: right;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.coin-select-button:hover,
.coin-select-button[aria-expanded="true"] {
  border-color: #3b463d;
  background: #101619;
}
.coin-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(183, 243, 74, .2);
  direction: ltr;
  font: 650 10px "Segoe UI", Arial, sans-serif;
}
.coin-selected b,
.coin-selected small { display: block; }
.coin-selected b {
  direction: ltr;
  text-align: right;
  font: 650 13px "Segoe UI", Arial, sans-serif;
  letter-spacing: .4px;
}
.coin-selected small { color: var(--muted); font-size: 9px; margin-top: 4px; }
.select-chevron { color: var(--muted); font-size: 18px; transition: transform .18s ease; }
.coin-select-button[aria-expanded="true"] .select-chevron { transform: rotate(180deg); }
.coin-dropdown {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  padding: 9px;
  background: #101518;
  border: 1px solid #293136;
  border-radius: 10px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, .45);
  animation: dropdownIn .16s ease both;
}
.coin-search-wrap {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.coin-search-wrap input {
  width: 100%;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font: 400 10px "Vazirmatn", Tahoma, sans-serif;
}
.coin-search-wrap input::placeholder { color: var(--muted-2); }
.coin-options { max-height: 300px; overflow-y: auto; padding-top: 6px; }
.coin-option {
  width: 100%;
  min-height: 43px;
  padding: 6px 9px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 7px;
  color: #cbd3d0;
  background: transparent;
  text-align: right;
  cursor: pointer;
}
.coin-option:hover,
.coin-option.selected { background: var(--accent-soft); }
.coin-option .coin-avatar { width: 28px; height: 28px; font-size: 8px; }
.coin-option b,
.coin-option small { display: block; }
.coin-option b { font-size: 10px; font-weight: 550; }
.coin-option small { color: var(--muted); font-size: 8px; margin-top: 2px; }
.coin-option > em {
  direction: ltr;
  color: #dfe7e3;
  font: 600 9px "Segoe UI", Arial, sans-serif;
  font-style: normal;
}
.unit-switch {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  position: relative;
}
.unit-switch legend { position: absolute; right: 3px; bottom: 52px; }
.unit-switch label { cursor: pointer; }
.unit-switch input { position: absolute; opacity: 0; pointer-events: none; }
.unit-switch span {
  width: 76px;
  height: 52px;
  display: grid;
  place-items: center;
  direction: ltr;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  font: 600 11px "Segoe UI", Arial, sans-serif;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.unit-switch label:first-of-type span { border-radius: 0 9px 9px 0; }
.unit-switch label:last-of-type span { border-radius: 9px 0 0 9px; border-right: 0; }
.unit-switch input:checked + span {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(183, 243, 74, .35);
}
.stream-clock {
  justify-self: end;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.stream-clock b,
.stream-clock small { display: block; }
.stream-clock b { font-size: 10px; font-weight: 550; }
.stream-clock small { color: var(--muted); font-size: 8px; margin-top: 4px; }
.stream-clock strong { color: var(--accent); font-weight: 600; }
.stream-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(183, 243, 74, .35);
  animation: livePulse 1.8s infinite;
}
.ticker-strip {
  min-height: 76px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.ticker-strip > div {
  padding: 16px 18px;
  border-left: 1px solid var(--line-soft);
}
.ticker-strip > div:last-child { border-left: 0; }
.ticker-strip span,
.ticker-strip strong { display: block; }
.ticker-strip span { color: var(--muted); font-size: 8px; margin-bottom: 6px; }
.ticker-strip strong {
  direction: ltr;
  text-align: right;
  color: #dbe3df;
  font-size: 12px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}
.bid-color { color: var(--success) !important; }
.ask-color { color: var(--danger) !important; }
.order-book {
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px minmax(0, 1fr);
  direction: rtl;
  border-bottom: 1px solid var(--line);
}
.book-side { min-width: 0; direction: rtl; }
.book-side > header {
  height: 65px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}
.book-side > header > div { display: flex; align-items: center; gap: 9px; }
.book-side h2 { margin: 0; font-size: 12px; font-weight: 650; }
.book-side > header > span { color: var(--muted); font-size: 8px; }
.side-signal { width: 6px; height: 6px; border-radius: 50%; }
.bid-signal { background: var(--success); box-shadow: 0 0 0 4px rgba(98,212,155,.08); }
.ask-signal { background: var(--danger); box-shadow: 0 0 0 4px rgba(242,118,118,.08); }
.book-head,
.book-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1.15fr 52px;
  align-items: center;
  direction: ltr;
}
.book-head {
  height: 36px;
  padding: 0 17px;
  color: var(--muted-2);
  background: #0b0f11;
  border-bottom: 1px solid var(--line-soft);
  font-size: 8px;
  text-align: right;
}
.book-row {
  position: relative;
  height: 37px;
  padding: 0 17px;
  color: #aeb8b4;
  border-bottom: 1px solid rgba(32, 39, 44, .55);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  animation: levelIn .24s ease both;
}
.book-row::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: calc(var(--depth) * 1%);
  opacity: .075;
  pointer-events: none;
}
.bid-row::before { background: var(--success); }
.ask-row::before { background: var(--danger); }
.book-row > span { position: relative; text-align: right; white-space: nowrap; }
.book-row .price { font-weight: 600; }
.bid-row .price { color: var(--success); }
.ask-row .price { color: var(--danger); }
.book-row .orders { color: var(--muted); }
.book-empty {
  min-height: 430px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
}
.book-loading { padding: 15px 17px; display: grid; gap: 19px; }
.book-loading i {
  height: 7px;
  border-radius: 8px;
  background: linear-gradient(90deg, #13191c, #20272a, #13191c);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.mid-price {
  direction: ltr;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 122px;
  background: #0a0e10;
}
.mid-price span { color: var(--muted-2); font: 600 7px "Segoe UI", Arial, sans-serif; letter-spacing: 1.5px; }
.mid-price strong { color: var(--accent); font-size: 13px; font-weight: 650; margin: 9px 0 4px; writing-mode: vertical-rl; transform: rotate(180deg); max-height: 190px; overflow: hidden; }
.mid-price small { color: var(--muted); font: 600 8px "Segoe UI", Arial, sans-serif; writing-mode: vertical-rl; transform: rotate(180deg); }
.live-footnote {
  min-height: 52px;
  padding: 0 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 8px;
}
.live-footnote p { margin: 0; }
.live-footnote > div { direction: ltr; display: flex; align-items: center; gap: 9px; }

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes livePulse {
  70% { box-shadow: 0 0 0 7px rgba(183, 243, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(183, 243, 74, 0); }
}
@keyframes levelIn {
  from { opacity: .35; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .live-dashboard { padding-left: 24px; padding-right: 24px; }
  .market-selector { grid-template-columns: minmax(250px, 1fr) auto; }
  .stream-clock { display: none; }
  .ticker-strip { grid-template-columns: repeat(3, 1fr); }
  .ticker-strip > div:nth-child(-n+3) { border-bottom: 1px solid var(--line-soft); }
  .order-book { grid-template-columns: minmax(0, 1fr) 78px minmax(0, 1fr); }
  .book-head, .book-row { grid-template-columns: 1.15fr 1fr 1fr; }
  .book-head > :last-child, .book-row > :last-child { display: none; }
}

@media (max-width: 760px) {
  .live-dashboard { padding: 16px 12px 36px; }
  .market-selector { grid-template-columns: 1fr; align-items: stretch; gap: 25px; }
  .unit-switch { width: 100%; }
  .unit-switch label { flex: 1; }
  .unit-switch span { width: 100%; height: 44px; }
  .unit-switch legend { bottom: 44px; }
  .ticker-strip { grid-template-columns: repeat(2, 1fr); margin-top: 14px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
  .ticker-strip > div { padding: 13px; border-bottom: 1px solid var(--line-soft); }
  .ticker-strip > div:nth-last-child(-n+2) { border-bottom: 0; }
  .order-book { grid-template-columns: 1fr 1fr; min-height: 560px; margin-top: 14px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
  .mid-price { display: none; }
  .book-side > header { height: 57px; padding: 0 10px; }
  .book-side h2 { font-size: 10px; }
  .book-head, .book-row { grid-template-columns: 1.15fr 1fr; padding-left: 9px; padding-right: 9px; }
  .book-head > :nth-child(n+3), .book-row > :nth-child(n+3) { display: none; }
  .book-row { height: 35px; font-size: 8px; }
  .asks-side { border-left: 1px solid var(--line); }
  .live-footnote { align-items: flex-start; flex-direction: column; gap: 8px; padding: 14px 2px; }
  .coin-dropdown { position: fixed; top: 116px; right: 12px; left: 12px; }
}
