/* Panel-specific additions layered on top of the LinearKit UI kit. */

.lk-icon {
  display: block;
  flex-shrink: 0;
}

.lk-btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lk-btn-with-icon .lk-icon {
  width: 16px;
  height: 16px;
}

.lk-btn-sm.lk-btn-with-icon .lk-icon {
  width: 14px;
  height: 14px;
}

.lk-topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lk-ink-subtle);
}

.lk-topbar-user .lk-icon {
  width: 16px;
  height: 16px;
  opacity: 0.75;
}

.lk-label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lk-label-with-icon .lk-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.lk-card-stat--with-icon {
  position: relative;
}

.lk-card-stat--with-icon .lk-stat-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--lk-primary);
  opacity: 0.35;
  pointer-events: none;
}

.lk-card-stat--with-icon .lk-stat-icon .lk-icon {
  width: 18px;
  height: 18px;
}

.lk-auth-header .brand-mark .lk-icon {
  color: var(--lk-on-primary);
  width: 22px;
  height: 22px;
}

/* The kit only styles `.lk-btn:disabled`, so variant classes need their own rule. */
.lk-btn-primary:disabled,
.lk-btn-secondary:disabled,
.lk-btn-tertiary:disabled,
.lk-btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background-color: transparent;
  border-color: var(--lk-hairline);
  color: var(--lk-ink-subtle);
}

/* Colors only: sizing comes from `.lk-btn` / `.lk-btn-sm` so modifiers keep working. */
.lk-btn-danger {
  background-color: rgba(229, 72, 77, 0.12);
  border-color: rgba(229, 72, 77, 0.35);
  color: var(--lk-danger);
}

.lk-btn-danger:hover:not(:disabled) {
  background-color: rgba(229, 72, 77, 0.2);
  border-color: rgba(229, 72, 77, 0.55);
}

/* Square icon button matching the height of `.lk-btn-sm`. */
.lk-btn-icon-sm {
  padding: 6px;
  min-width: 0;
}

.lk-btn-icon-sm svg {
  display: block;
}

/* `stretch` keeps the icon button exactly as tall as the text button next to it. */
.lk-table-actions {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: var(--lk-space-xs);
  white-space: nowrap;
}

.lk-table-actions form {
  display: flex;
  margin: 0;
}

.lk-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lk-space-sm);
  margin-bottom: var(--lk-space-md);
}

.lk-card-header .lk-card-title {
  margin: 0;
}

.lk-truncate {
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lk-filter-actions {
  display: flex;
  align-items: flex-end;
  gap: var(--lk-space-xs);
}

.lk-server-card {
  padding: 0;
  overflow: hidden;
}

.lk-server-header {
  padding: var(--lk-space-lg);
  border-bottom: 1px solid var(--lk-hairline);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

.lk-server-title-row {
  display: flex;
  align-items: center;
  gap: var(--lk-space-xs);
  flex-wrap: wrap;
  margin-bottom: var(--lk-space-sm);
}

.lk-server-title-row .lk-card-title {
  margin: 0;
}

.lk-server-ip {
  color: var(--lk-ink-tertiary);
  margin-left: 2px;
}

.lk-server-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lk-meta-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  line-height: 1.4;
  color: var(--lk-ink-subtle);
  padding: 2px 8px;
  border: 1px solid var(--lk-hairline);
  border-radius: var(--lk-radius-pill);
  background: rgba(255, 255, 255, 0.02);
}

.lk-server-table {
  border: none;
  background: transparent;
  border-radius: 0;
}

.lk-server-table .lk-table {
  margin: 0;
}

.lk-account-name {
  font-weight: 500;
  color: var(--lk-ink);
}

.lk-proxy-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lk-proxy-cell .lk-truncate {
  max-width: 180px;
}

.lk-empty--compact {
  padding: var(--lk-space-xl) var(--lk-space-lg);
}

/* ---------- Strategies page ---------- */

.lk-picker-card {
  padding: var(--lk-space-lg);
}

.lk-picker {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--lk-space-md);
  flex-wrap: wrap;
}

.lk-picker-field {
  flex: 1 1 320px;
  min-width: 240px;
}

.lk-picker-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
}

.lk-pipeline {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--lk-hairline);
  border-radius: var(--lk-radius-md);
  background: rgba(255, 255, 255, 0.015);
}

.lk-pipe-step {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
  padding: 10px 12px;
  border: 1px solid var(--lk-hairline);
  border-radius: var(--lk-radius-sm);
  background: var(--lk-surface-2);
}

.lk-pipe-step.is-off {
  opacity: 0.45;
}

.lk-pipe-step--event {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
}

.lk-pipe-step--action {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.lk-pipe-kind {
  font-size: 11px;
  color: var(--lk-ink-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lk-pipe-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--lk-ink);
}

.lk-pipe-arrow {
  display: flex;
  align-items: center;
  color: var(--lk-ink-tertiary);
  font-size: 16px;
  padding: 0 2px;
}

.lk-strategy-row {
  display: flex;
  align-items: flex-start;
  gap: var(--lk-space-md);
  padding: var(--lk-space-md) 0;
  border-top: 1px solid var(--lk-hairline);
}

.lk-strategy-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.lk-strategy-row.is-off {
  opacity: 0.55;
}

.lk-strategy-rank {
  flex: 0 0 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--lk-radius-pill);
  border: 1px solid var(--lk-hairline);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  font-size: 13px;
}

.lk-strategy-main {
  flex: 1 1 auto;
  min-width: 0;
}

.lk-strategy-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.lk-kv {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lk-kv-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--lk-radius-pill);
  border: 1px solid var(--lk-hairline);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
  color: var(--lk-ink-subtle);
}

.lk-kv-item b {
  color: var(--lk-ink);
  font-weight: 500;
}

.lk-fieldset {
  margin-bottom: var(--lk-space-lg);
  padding: var(--lk-space-md);
  border: 1px solid var(--lk-hairline);
  border-radius: var(--lk-radius-md);
  background: rgba(255, 255, 255, 0.015);
}

.lk-fieldset-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lk-ink-subtle);
  margin-bottom: var(--lk-space-sm);
}

.lk-catalog-item {
  padding: 12px 0;
  border-top: 1px solid var(--lk-hairline);
}

.lk-catalog-item:first-of-type {
  border-top: none;
  padding-top: 0;
}

.lk-catalog-item.is-off {
  opacity: 0.55;
}

.lk-catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.lk-hint-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 10px;
  color: var(--lk-ink-muted);
  font-size: 13px;
  line-height: 1.45;
}

.lk-hint-list a {
  color: var(--lk-primary);
}

.lk-empty-state {
  text-align: center;
  padding: var(--lk-space-xxl) var(--lk-space-lg);
}

.lk-empty-state h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.lk-empty-state p {
  max-width: 480px;
  margin: 0 auto 16px;
}

.lk-advanced {
  margin-top: var(--lk-space-md);
  border-top: 1px solid var(--lk-hairline);
  padding-top: var(--lk-space-sm);
}

.lk-advanced summary {
  cursor: pointer;
  color: var(--lk-ink-subtle);
  font-size: 13px;
  user-select: none;
}

.lk-advanced summary:hover {
  color: var(--lk-ink);
}

.lk-howto {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--lk-space-md);
}

@media (max-width: 1100px) {
  .lk-howto {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .lk-howto {
    grid-template-columns: 1fr;
  }
}

.lk-howto-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--lk-hairline);
  border-radius: var(--lk-radius-md);
  background: var(--lk-surface-1);
}

.lk-howto-item strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.lk-howto-num {
  flex: 0 0 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--lk-radius-pill);
  background: rgba(var(--lk-primary-rgb), 0.15);
  color: var(--lk-primary);
  font-weight: 600;
  font-size: 13px;
}

/* ---------- Strategy builder ---------- */

/* The builder needs more horizontal room than the standard content width. */
.lk-page-content--wide {
  max-width: 1720px;
}

.sb-workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  gap: var(--lk-space-md);
  align-items: start;
}

@media (max-width: 1400px) {
  .sb-workspace {
    grid-template-columns: 220px minmax(0, 1fr) 250px;
  }
}

@media (max-width: 1200px) {
  .sb-workspace {
    grid-template-columns: 1fr;
  }
}

.sb-panel {
  padding: var(--lk-space-md);
  border: 1px solid var(--lk-hairline);
  border-radius: var(--lk-radius-lg);
  background: var(--lk-surface-1);
}

.sb-panel-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lk-ink-subtle);
  margin-bottom: var(--lk-space-sm);
}

.sb-palette-group {
  margin-bottom: 12px;
}

.sb-palette-label {
  font-size: 11px;
  color: var(--lk-ink-tertiary);
  margin-bottom: 6px;
}

.sb-palette-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 7px 8px 7px 10px;
  margin-bottom: 4px;
  border: 1px solid var(--lk-hairline);
  border-radius: var(--lk-radius-sm);
  background: rgba(255, 255, 255, 0.02);
  color: var(--lk-ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sb-palette-btn:hover {
  border-color: rgba(var(--lk-primary-rgb), 0.45);
  background: rgba(var(--lk-primary-rgb), 0.06);
}

.sb-palette-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sb-palette-btn strong {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-info {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  font-family: inherit;
  line-height: 1;
  cursor: help;
  z-index: 2;
}

.sb-info:hover,
.sb-info:focus {
  border-color: rgba(147, 197, 253, 0.7);
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  outline: none;
}

.sb-info::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  width: min(260px, 42vw);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  z-index: 40;
}

.sb-info:hover::after,
.sb-info:focus::after,
.sb-info:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

/* On canvas nodes the tip opens upward / to the left to stay visible */
.sb-node .sb-info::after {
  left: auto;
  right: 0;
  top: auto;
  bottom: calc(100% + 8px);
  transform: none;
  width: 220px;
}

.sb-panel-actions {
  display: grid;
  gap: 8px;
  margin-top: var(--lk-space-sm);
}

/* Kit buttons are `nowrap`; inside the narrow panel the labels must wrap instead. */
.sb-panel-actions > button {
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  padding: 9px 10px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.sb-divider {
  border: none;
  border-top: 1px solid var(--lk-hairline);
  margin: var(--lk-space-md) 0;
}

.sb-canvas-card {
  border: 1px solid var(--lk-hairline);
  border-radius: var(--lk-radius-lg);
  background: var(--lk-surface-1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Fill the viewport below the topbar so the graph gets as much room as possible. */
  height: calc(100vh - var(--lk-topbar-height) - 120px);
  min-height: 620px;
}

.sb-canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lk-space-sm);
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--lk-hairline);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

.sb-canvas-scroll {
  flex: 1;
  overflow: auto;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.06) 1px, transparent 0) 0 0 / 24px 24px,
    #0d1017;
  min-height: 520px;
}

/* Stretches to the scroll container and grows only when nodes need more space. */
.sb-canvas-surface {
  position: relative;
  width: 100%;
  height: 100%;
}

.sb-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  color: #64748b;
}

.sb-edge {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  pointer-events: none;
}

.sb-edge--temp {
  stroke-dasharray: 6 4;
  opacity: 0.7;
}

.sb-edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 12;
  pointer-events: stroke;
  cursor: pointer;
}

.sb-node {
  position: absolute;
  width: 168px;
  padding: 8px 12px 10px;
  border-radius: 10px;
  border: 1px solid var(--lk-hairline);
  background: #161b24;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  cursor: grab;
  user-select: none;
  z-index: 1;
}

.sb-node.is-dragging {
  cursor: grabbing;
  opacity: 0.92;
  z-index: 3;
}

.sb-node.is-selected {
  border-color: rgba(var(--lk-primary-rgb), 0.7);
  box-shadow: 0 0 0 2px rgba(var(--lk-primary-rgb), 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.sb-node--event { border-top: 3px solid #3b82f6; }
.sb-node--condition { border-top: 3px solid #a855f7; }
.sb-node--logic { border-top: 3px solid #64748b; }
.sb-node--guard { border-top: 3px solid #f59e0b; }
.sb-node--action { border-top: 3px solid #22c55e; }

.sb-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.sb-node-kind {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--lk-ink-tertiary);
}

.sb-node-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--lk-ink);
  line-height: 1.25;
}

.sb-node-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--lk-ink-subtle);
  line-height: 1.3;
}

.sb-port {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #0d1017;
  background: #94a3b8;
  top: 50%;
  transform: translateY(-50%);
}

.sb-port--in {
  left: -7px;
}

.sb-port--out {
  right: -7px;
  cursor: crosshair;
  background: var(--lk-primary);
}

.sb-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  margin: 0;
}

.sb-chip--event { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.sb-chip--condition { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; }
.sb-chip--logic { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; }
.sb-chip--guard { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.sb-chip--action { background: rgba(34, 197, 94, 0.15); color: #86efac; }

.sb-inspector {
  min-height: 120px;
}

.sb-inspector-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.sb-json-preview {
  margin: 8px 0 0;
  max-height: 180px;
  overflow: auto;
  padding: 10px;
  border-radius: var(--lk-radius-sm);
  border: 1px solid var(--lk-hairline);
  background: #0d1017;
  font-family: var(--lk-font-mono);
  font-size: 11px;
  color: var(--lk-ink-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Backtests */
.bt-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 0 4px;
}

.bt-hero h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.bt-hero p {
  margin: 0;
  color: var(--lk-ink-muted);
  max-width: 42ch;
}

.bt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.bt-slot-bar {
  position: relative;
  z-index: 5;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: visible;
}

.bt-slot-bar .lk-select {
  position: relative;
  z-index: 6;
}

@media (max-width: 1100px) {
  .bt-layout {
    grid-template-columns: 1fr;
  }
}

.bt-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.bt-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: calc(var(--lk-topbar-height, 56px) + 16px);
}

.bt-panel {
  border: 1px solid var(--lk-hairline);
  border-radius: var(--lk-radius-lg);
  background: var(--lk-surface-1);
  overflow: hidden;
}

.bt-panel--result {
  border-color: rgba(var(--lk-primary-rgb), 0.35);
  box-shadow: 0 0 0 1px rgba(var(--lk-primary-rgb), 0.08);
}

.bt-panel-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-bottom: 1px solid var(--lk-hairline);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

.bt-panel-head h2 {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 600;
}

.bt-panel-head p {
  margin: 0;
  font-size: 12px;
  color: var(--lk-ink-subtle);
}

.bt-step {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #c7d2fe;
  background: rgba(var(--lk-primary-rgb), 0.16);
  border: 1px solid rgba(var(--lk-primary-rgb), 0.28);
}

.bt-panel-body {
  padding: 16px 18px 18px;
}

.bt-params {
  margin-top: 14px;
}

.bt-params-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bt-params-grid--wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .bt-params-grid,
  .bt-params-grid--wide {
    grid-template-columns: 1fr;
  }
}

.bt-graph-card {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--lk-radius-md);
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.08);
}

.bt-graph-card-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.bt-accounts-block {
  border-top: 1px solid var(--lk-hairline);
  padding-top: 14px;
}

.bt-accounts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.bt-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bt-account-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.bt-account-num {
  font-family: var(--lk-font-mono);
  font-size: 12px;
  color: var(--lk-ink-muted);
  min-width: 28px;
}

.bt-account-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bt-account-tab {
  border: 1px solid var(--lk-hairline);
  background: var(--lk-surface-2);
  color: var(--lk-ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.bt-account-tab.is-active {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
}

.bt-account-summary-row.is-active {
  background: rgba(34, 197, 94, 0.06);
}

.lk-nav-group {
  margin-bottom: 4px;
}

.lk-nav-group-label {
  padding: 8px 12px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--lk-ink-muted);
}

.lk-nav-sublink {
  padding-left: 24px;
  font-size: 13px;
}

.lk-nav-group.is-open .lk-nav-group-label {
  color: var(--lk-ink);
}

.bt-settings-form {
  max-width: 560px;
}

.bt-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--lk-hairline);
  border-radius: var(--lk-radius-md);
  background: var(--lk-surface-2);
  cursor: pointer;
}

.bt-toggle-wrap {
  position: relative;
  flex-shrink: 0;
}

.bt-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bt-toggle-ui {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #3a3f4b;
  position: relative;
  transition: background 0.15s ease;
}

.bt-toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.bt-toggle-input:checked + .bt-toggle-ui {
  background: rgba(34, 197, 94, 0.85);
}

.bt-toggle-input:checked + .bt-toggle-ui::after {
  transform: translateX(20px);
}

.bt-tables-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.bt-tables-actions {
  display: flex;
  gap: 8px;
}

.bt-table-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(52vh, 480px);
  overflow: auto;
  padding-right: 2px;
}

.bt-table-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--lk-hairline);
  border-radius: var(--lk-radius-md);
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.bt-table-item:hover {
  border-color: rgba(var(--lk-primary-rgb), 0.4);
}

.bt-table-item:has(input:checked) {
  border-color: rgba(var(--lk-primary-rgb), 0.55);
  background: rgba(var(--lk-primary-rgb), 0.08);
}

.bt-table-item input {
  margin-top: 3px;
}

.bt-table-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bt-table-item-name {
  font-weight: 500;
  color: var(--lk-ink);
}

.bt-table-item-meta {
  font-size: 11px;
  color: var(--lk-ink-subtle);
  font-family: var(--lk-font-mono);
  word-break: break-all;
}

.bt-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 720px) {
  .bt-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.bt-metric {
  padding: 12px 14px;
  border-radius: var(--lk-radius-md);
  border: 1px solid var(--lk-hairline);
  background: rgba(255, 255, 255, 0.02);
}

.bt-metric.is-up .bt-metric-value { color: #86efac; }
.bt-metric.is-down .bt-metric-value { color: #fca5a5; }

.bt-metric-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lk-ink-subtle);
  margin-bottom: 6px;
}

.bt-metric-value {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bt-chart-wrap,
.bt-tables-stats {
  margin: 18px 0 8px;
  padding: 14px;
  border-radius: var(--lk-radius-md);
  border: 1px solid var(--lk-hairline);
  background: rgba(255, 255, 255, 0.02);
}

.bt-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.bt-chart-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.bt-table-callouts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .bt-table-callouts {
    grid-template-columns: 1fr;
  }
}

.bt-callout {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--lk-radius-md);
  border: 1px solid var(--lk-hairline);
  background: rgba(255, 255, 255, 0.03);
}

.bt-callout.is-up {
  border-color: rgba(134, 239, 172, 0.35);
  background: rgba(134, 239, 172, 0.06);
}

.bt-callout.is-down {
  border-color: rgba(252, 165, 165, 0.35);
  background: rgba(252, 165, 165, 0.06);
}

.bt-callout-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lk-ink-subtle);
}

.bt-callout strong {
  font-size: 14px;
}

.bt-bars {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.bt-bar-meta {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.bt-bar-rank {
  font-size: 12px;
  color: var(--lk-ink-subtle);
  font-variant-numeric: tabular-nums;
}

.bt-bar-label {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.bt-bar-label strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-bar-label span {
  font-size: 11px;
  color: var(--lk-ink-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-bar-value {
  font-size: 13px;
  font-weight: 600;
}

.bt-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.bt-bar {
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
  transition: width 0.35s ease;
}

.bt-bar--pos {
  background: linear-gradient(90deg, #4ade80, #86efac);
}

.bt-bar--neg {
  background: linear-gradient(90deg, #f87171, #fca5a5);
}

.bt-pnl-up { color: #86efac; }
.bt-pnl-down { color: #fca5a5; }

.bt-quality {
  width: 72px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bt-quality-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f87171, #fbbf24, #4ade80);
}

.bt-tables-detail {
  max-height: 320px;
  overflow: auto;
}

.bt-tables-detail tr.is-best td {
  background: rgba(134, 239, 172, 0.06);
}

.bt-tables-detail tr.is-worst td {
  background: rgba(252, 165, 165, 0.06);
}

.bt-equity-chart {
  display: block;
  width: 100%;
  height: 200px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.bt-equity-chart .eq-grid {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

.bt-equity-chart .eq-area {
  fill: rgba(96, 165, 250, 0.18);
}

.bt-equity-chart .eq-line {
  fill: none;
  stroke: #93c5fd;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.bt-equity-chart .eq-base {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.bt-equity-chart .eq-cursor {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1;
}

.bt-equity-chart .eq-dot {
  fill: #93c5fd;
  stroke: #0f172a;
  stroke-width: 1.5;
}

.bt-trades {
  max-height: 520px;
  overflow: auto;
}

.bt-inspect-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .bt-inspect-layout {
    grid-template-columns: 1fr;
  }
}

.bt-trade-row {
  cursor: pointer;
}

.bt-trade-row:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.bt-trade-row.is-active td {
  background: rgba(var(--lk-primary-rgb), 0.12);
}

.bt-inspect {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  position: sticky;
  top: calc(var(--lk-topbar-height, 56px) + 16px);
  min-height: 280px;
}

.bt-inspect-empty {
  opacity: 0.65;
  font-size: 0.9rem;
}

.bt-inspect-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.bt-inspect-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.bt-inspect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
}

.bt-inspect-reason {
  opacity: 0.7;
  margin-bottom: 0.85rem;
  word-break: break-word;
}

.bt-road-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.75rem;
}

.bt-road-label {
  font-size: 0.75rem;
  opacity: 0.65;
  margin-bottom: 0.5rem;
}

.bt-road {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.bt-bead {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #0b1220;
  background: #94a3b8;
}

.bt-bead.is-b { background: #f87171; }
.bt-bead.is-p { background: #60a5fa; }
.bt-bead.is-t { background: #86efac; }
.bt-bead.is-signal {
  box-shadow: 0 0 0 2px #fbbf24, 0 0 0 4px rgba(251, 191, 36, 0.25);
  transform: scale(1.12);
}

.bt-road-bet {
  margin-left: 0.35rem;
  font-size: 0.8rem;
  opacity: 0.85;
  font-family: var(--lk-font-mono, ui-monospace, monospace);
}

.bt-road-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.65rem;
  font-size: 0.75rem;
  opacity: 0.75;
}

.bt-road-legend .bt-bead {
  width: 14px;
  height: 14px;
  font-size: 0;
  margin-right: 0.25rem;
  vertical-align: -2px;
}

.bt-equity-chart .eq-mark {
  stroke: #0f172a;
  stroke-width: 1;
}

.bt-equity-chart .eq-mark--win { fill: #86efac; }
.bt-equity-chart .eq-mark--loss { fill: #fca5a5; }
.bt-equity-chart .eq-mark--push { fill: #cbd5e1; }

.bt-table-road-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.bt-table-road-toolbar .lk-select {
  min-width: 280px;
  max-width: 420px;
}

.bt-table-road-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 960px) {
  .bt-table-road-layout {
    grid-template-columns: 1fr;
  }
}

.bt-road-minimap-wrap {
  margin-bottom: 0.65rem;
}

.bt-road-minimap-label {
  margin-bottom: 0.25rem;
  opacity: 0.75;
}

.bt-road-minimap {
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  cursor: ew-resize;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.bt-road-minimap.is-scrubbing {
  cursor: grabbing;
}

.bt-minimap-track {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: inherit;
}

.bt-minimap-mark {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border: 0;
  border-radius: 3px;
  padding: 0;
  background: rgba(251, 191, 36, 0.45);
  pointer-events: none;
}

.bt-minimap-mark.is-active {
  background: #fbbf24;
}

.bt-minimap-lens {
  position: absolute;
  top: 0;
  bottom: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 1;
}

.bt-focus-meta {
  margin-bottom: 0.55rem;
}

.bt-bead-road-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.bt-bead-road.bt-focus-road {
  display: block;
  padding: 12px 10px 8px;
  min-height: 140px;
  width: max-content;
}

.bt-focus-strip {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2px;
}

.bt-focus-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  min-height: 110px;
  padding: 4px 2px 6px;
  border-radius: 8px;
  opacity: 0.55;
}

.bt-focus-slot.in-session {
  opacity: 1;
  background: rgba(251, 191, 36, 0.1);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.4);
}

.bt-focus-slot.is-pre,
.bt-focus-slot.is-post,
.bt-focus-slot.is-browse {
  opacity: 0.45;
}

.bt-focus-slot.in-series {
  opacity: 1;
  background: rgba(96, 165, 250, 0.14);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.55);
}

.bt-focus-slot.is-tie-ignored {
  opacity: 0.35;
}

.bt-focus-slot.is-tie-ignored .bt-bead-cell {
  filter: grayscale(0.35);
}

.bt-focus-anno.is-tie-skip {
  background: rgba(148, 163, 184, 0.35);
  color: rgba(248, 250, 252, 0.85);
  font-weight: 550;
}

.bt-shoe-break {
  display: flex;
  align-items: stretch;
  width: 18px;
  margin: 0 4px;
  flex-shrink: 0;
  position: relative;
}

.bt-shoe-break::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 4px;
  bottom: 28px;
  width: 2px;
  background: rgba(248, 250, 252, 0.45);
  transform: translateX(-50%);
}

.bt-shoe-break span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(248, 250, 252, 0.75);
  white-space: nowrap;
}

.bt-focus-slot.is-trade-active {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 1px;
  z-index: 2;
}

.bt-focus-annos {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  min-height: 2.4em;
}

.bt-focus-anno.is-entry,
.bt-anno-sample.is-entry { background: #fbbf24; }

.bt-focus-anno.is-reentry,
.bt-anno-sample.is-reentry { background: #fdba74; }

.bt-focus-anno.is-win,
.bt-anno-sample.is-win { background: #86efac; }

.bt-focus-anno.is-loss,
.bt-anno-sample.is-loss { background: #fda4af; }

.bt-focus-anno.is-push,
.bt-focus-anno.is-other { background: #cbd5e1; }

.bt-anno-sample {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: #0f172a;
}

.bt-focus-details {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bt-focus-detail-row {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.12);
}

.bt-focus-detail-row:hover {
  border-color: rgba(251, 191, 36, 0.45);
}

.bt-pos-game {
  font-size: 0.72rem;
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.bt-bead-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-right: 1px solid rgba(15, 23, 42, 0.1);
}

.bt-bead-col:last-child {
  border-right: 0;
}

.bt-bead-cell {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.35);
  padding: 0;
  margin: 2px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #fff;
  background: #94a3b8;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  line-height: 1;
  gap: 0;
}

.bt-bead-letter {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.bt-bead-score {
  font-size: 9px;
  font-weight: 600;
  opacity: 0.92;
  margin-top: -1px;
}

.bt-focus-anno {
  font-size: 10px;
  line-height: 1.25;
  font-weight: 650;
  text-align: center;
  border-radius: 4px;
  padding: 3px 4px;
  color: #0f172a;
  word-break: break-word;
}

.bt-bead-cell.is-b { background: #e11d48; }
.bt-bead-cell.is-p { background: #2563eb; }
.bt-bead-cell.is-t { background: #16a34a; }

.bt-bead-cell.has-signal {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 2px #f59e0b, 0 0 0 4px rgba(245, 158, 11, 0.25);
}

.bt-bead-cell.has-settle {
  cursor: pointer;
}

.bt-bead-step {
  position: absolute;
  top: -5px;
  left: -5px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 9px;
  line-height: 14px;
  font-weight: 700;
}

.bt-bead-cell.has-settle-win::after,
.bt-bead-cell.has-settle-loss::after,
.bt-bead-cell.has-settle-push::after,
.bt-bead-cell.has-settle-skipped::after,
.bt-bead-cell.has-settle-cancelled::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid #0f172a;
}

.bt-bead-cell.has-settle-win::after { background: #22c55e; }
.bt-bead-cell.has-settle-loss::after { background: #ef4444; }
.bt-bead-cell.has-settle-push::after { background: #94a3b8; }
.bt-bead-cell.has-settle-skipped::after,
.bt-bead-cell.has-settle-cancelled::after { background: #f59e0b; }

.bt-bead-cell.is-trade-active {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
  z-index: 2;
}

.bt-bead-cell.is-session-active:not(.is-trade-active) {
  outline: 2px solid rgba(245, 158, 11, 0.85);
  outline-offset: 1px;
  z-index: 1;
}

.bt-hand-card {
  margin-top: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bt-road-side {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
  padding: 0.75rem;
  max-height: 560px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 200px;
}

.bt-road-side-title {
  font-weight: 650;
  font-size: 0.92rem;
}

.bt-road-positions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: auto;
  flex: 1;
}

.bt-pos-item {
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.bt-pos-item:hover {
  border-color: rgba(251, 191, 36, 0.45);
}

.bt-pos-item.is-active {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}

.bt-pos-head {
  font-size: 0.85rem;
}

.bt-pos-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
}

.bt-road-timeline {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.55rem;
  overflow: auto;
  flex: 1;
  min-height: 140px;
}

.bt-tl-title {
  font-weight: 650;
  margin-bottom: 0.45rem;
}

.bt-tl-step {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
}

.bt-tl-step.is-focus {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.07);
}

.bt-tl-step-head {
  margin-bottom: 0.25rem;
  font-size: 0.86rem;
}

.bt-tl-row,
.bt-tl-pre,
.bt-tl-footer {
  font-size: 0.78rem;
  opacity: 0.9;
  margin-top: 0.15rem;
}

.bt-tl-footer {
  margin-top: 0.5rem;
  font-weight: 650;
}

.bt-table-road-legend {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.bt-table-road-legend .bt-bead.has-signal {
  box-shadow: 0 0 0 2px #fbbf24;
}

.bt-table-road-legend .bt-bead.has-settle-win,
.bt-table-road-legend .bt-bead.has-settle-loss {
  position: relative;
}

.bt-res-win { color: #86efac; }
.bt-res-loss { color: #fca5a5; }
.bt-res-push { color: #cbd5e1; }
.bt-res-skipped { color: #fcd34d; }
.bt-res-cancelled { color: #94a3b8; }

.bt-run-side {
  position: sticky;
  bottom: 12px;
}

.lk-table tr.is-highlight td {
  background: rgba(var(--lk-primary-rgb), 0.08);
}

.cas-slot-bar {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 360px;
  overflow: visible;
}
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .cas-layout {
    grid-template-columns: 1fr;
  }
}

.cas-panel {
  background: var(--lk-surface, rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  min-height: 320px;
}

.cas-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cas-panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.cas-list {
  max-height: min(70vh, 720px);
  overflow: auto;
}

.cas-item {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cas-item.is-active {
  background: rgba(var(--lk-primary-rgb), 0.1);
}

.cas-item.is-off .cas-item-name,
.cas-item.is-off .cas-item-meta {
  opacity: 0.55;
}

.cas-item-main {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.5rem 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cas-item-main:hover {
  color: inherit;
}

.cas-item-name {
  font-weight: 550;
  line-height: 1.25;
}

.cas-item-meta {
  font-size: 0.75rem;
  opacity: 0.65;
}

.cas-toggle-form {
  display: flex;
  align-items: center;
  padding-right: 0.75rem;
}

.cas-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.15s ease;
}

.cas-toggle.is-on {
  background: rgba(74, 222, 128, 0.55);
}

.cas-toggle.is-off {
  background: rgba(248, 113, 113, 0.35);
}

.cas-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.cas-toggle.is-on .cas-toggle-knob {
  transform: translateX(18px);
}

.cas-empty {
  padding: 1.5rem 1rem;
  opacity: 0.65;
  font-size: 0.9rem;
}

.cas-rooms {
  overflow: auto;
  max-height: min(70vh, 720px);
}

.cas-rooms-table tr.is-off td {
  opacity: 0.55;
}

.cas-rooms-action {
  width: 1%;
  white-space: nowrap;
}

