.investi-orderbook-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
  gap: 20px;
  align-items: stretch;
}

.investi-orderbook-shell {
  padding: 24px;
}

.investi-orderbook-shell--depth {
  border-radius: 18px;
}

.investi-orderbook-head {
  margin-bottom: 20px;
}

.investi-orderbook-head h3 {
  margin: 0;
  color: var(--text-color);
  font-size: 1.5rem;
  font-weight: 800;
}

.investi-orderbook-head p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
}

.investi-orderbook-depth-panel {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card-bg-secondary) 54%, transparent);
}

.investi-orderbook-axis {
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  justify-items: center;
}

.investi-orderbook-axis span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.investi-orderbook-axis__bid {
  color: #dbeafe;
}

.investi-orderbook-axis__offer {
  color: #facc15;
}

.investi-orderbook-depth {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.investi-orderbook-level {
  min-width: 0;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 8px;
}

.investi-orderbook-level__price {
  font-weight: 900;
  font-size: 0.82rem;
  text-align: right;
}

.investi-orderbook-level--bid .investi-orderbook-level__price {
  color: #f8fafc;
}

.investi-orderbook-level--offer .investi-orderbook-level__price {
  color: #facc15;
}

.investi-orderbook-level__bar {
  position: relative;
  height: 28px;
  overflow: hidden;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text-color) 9%, transparent);
}

.investi-orderbook-level__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
}

.investi-orderbook-level--bid .investi-orderbook-level__fill {
  background: color-mix(in srgb, #64748b 36%, transparent);
}

.investi-orderbook-level--offer .investi-orderbook-level__fill {
  background: #c9a227;
}

.investi-orderbook-level__volume {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding-left: 10px;
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 800;
}

.investi-orderbook-level__badge {
  min-width: 0;
}

.investi-orderbook-level--empty .investi-orderbook-level__price,
.investi-orderbook-level--empty .investi-orderbook-level__bar,
.investi-orderbook-level--empty .investi-orderbook-level__badge {
  visibility: hidden;
}

.investi-orderbook-level__badge span,
.investi-orderbook-spread-row em {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.56rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.investi-orderbook-level--bid .investi-orderbook-level__badge span {
  color: #0f172a;
  background: #e2e8f0;
}

.investi-orderbook-level--offer .investi-orderbook-level__badge span {
  color: #020617;
  background: #facc15;
}

.investi-orderbook-spread-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 8px 0 0;
  border: 1px solid color-mix(in srgb, var(--border-color) 86%, #60a5fa);
  border-left: 3px solid #60a5fa;
  border-radius: 4px;
  background: color-mix(in srgb, #334155 36%, transparent);
}

.investi-orderbook-spread-row span {
  padding-left: 12px;
  color: #f8fafc;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.investi-orderbook-spread-row strong {
  color: #f8fafc;
  font-size: 0.78rem;
}

.investi-orderbook-spread-row em {
  justify-self: end;
  color: #fff;
  background: #60a5fa;
}

.investi-orderbook-metrics {
  min-width: 0;
  display: grid;
  gap: 11px;
  align-content: start;
}

.investi-orderbook-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: color-mix(in srgb, var(--card-bg-secondary) 45%, transparent);
}

.investi-orderbook-metric span {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
}

.investi-orderbook-metric strong {
  color: var(--text-color);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: right;
}

.investi-orderbook-metric__offer {
  color: #facc15 !important;
}

.investi-orderbook-metric small {
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 800;
}

.investi-orderbook-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
}

.investi-orderbook-table th,
.investi-orderbook-table td {
  padding: 12px 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.94rem;
}

.investi-orderbook-table thead th {
  background: var(--card-bg-secondary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.investi-orderbook-table tbody th {
  font-weight: 700;
  text-align: left;
}

.investi-orderbook-table__row--bid th,
.investi-orderbook-table__row--bid td:nth-child(2) {
  color: var(--purple-color);
}

.investi-orderbook-table__row--ask th,
.investi-orderbook-table__row--ask td:nth-child(2) {
  color: var(--warning-color);
}

.investi-orderbook-table__row--spread {
  background: var(--hover-bg);
}

.investi-orderbook-summary {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

.investi-orderbook-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.investi-orderbook-summary__row span {
  color: var(--text-secondary);
}

.investi-orderbook-summary__row strong {
  color: var(--text-color);
  font-weight: 700;
}

@media (max-width: 767px) {
  .investi-orderbook-shell {
    padding: 18px;
  }

  .investi-orderbook-depth-panel {
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 14px;
  }

  .investi-orderbook-level,
  .investi-orderbook-spread-row {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .investi-orderbook-level__badge,
  .investi-orderbook-spread-row em {
    display: none;
  }
}

@media (max-width: 900px) {
  .investi-orderbook-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .investi-split-layout {
    flex-direction: column;
  }
  .investi-split-main,
  .investi-split-sidebar {
    width: 100%;
  }
}
