/* ==========================================================================
   Component: Sidebar
   .sidebar, .sidebar--open, mobile overlay behavior.
   Panel switcher (Snipe / Sweep tabs), auto-snipe levels, floor sniper,
   sweep controls — all sidebar panel content.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Sidebar Base
   --------------------------------------------------------------------------- */
.sidebar,
.auto-snipe-sidebar {
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100%;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-muted);
  overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Sidebar Header
   --------------------------------------------------------------------------- */
.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-muted);
  min-height: 48px;
  flex-shrink: 0;
}

.sidebar__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.sidebar__close {
  display: none; /* only on mobile */
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast);
}

.sidebar__close:hover {
  color: var(--text-primary);
  background-color: var(--bg-elevated);
}

/* ---------------------------------------------------------------------------
   Sidebar Body — scrollable content area
   --------------------------------------------------------------------------- */
.sidebar__body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ---------------------------------------------------------------------------
   Sidebar Section (grouped settings)
   --------------------------------------------------------------------------- */
.sidebar__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sidebar__section-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: var(--space-1);
}

/* ---------------------------------------------------------------------------
   Sidebar Footer (sticky at bottom)
   --------------------------------------------------------------------------- */
.sidebar__footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-muted);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Sidebar Row — key/value or toggle row
   --------------------------------------------------------------------------- */
.sidebar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 32px;
}

.sidebar__row-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  white-space: nowrap;
}

.sidebar__row-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-primary);
  text-align: right;
}

/* ---------------------------------------------------------------------------
   Sidebar Divider
   --------------------------------------------------------------------------- */
.sidebar__divider {
  border: none;
  border-top: 1px solid var(--border-muted);
  margin: var(--space-1) 0;
}

/* ==========================================================================
   Panel Switcher — tab-like buttons at the top of sidebar
   ========================================================================== */
.panel-switcher {
  display: flex;
  width: 100%;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-muted);
  background-color: var(--bg-base);
}

.panel-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-3) var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 40px;
}

.panel-btn:hover {
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.03);
}

.panel-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.panel-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ==========================================================================
   Panel Content Wrapper — animated container for tab panels
   ========================================================================== */
.panel-content-wrapper {
  position: relative;
  flex: 1;
  overflow: hidden;
}

/* ==========================================================================
   Panel Content — tab panel body
   ========================================================================== */
.panel-content {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.panel-content.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ==========================================================================
   List Panel
   ========================================================================== */

/* ---------------------------------------------------------------------------
   List Controls — sticky top section
   --------------------------------------------------------------------------- */
.list-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-muted);
  flex-shrink: 0;
}

.list-price-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.list-price-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.list-price-input {
  display: block;
  width: 100%;
  padding: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-md, var(--text-sm));
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  background-color: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  min-height: 36px;
  text-align: right;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.list-price-input:hover:not(:disabled):not(:focus) {
  border-color: var(--text-muted);
}

.list-price-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
  background-color: var(--bg-surface);
  outline: none;
}

.list-price-input::-webkit-inner-spin-button,
.list-price-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.list-price-input[type="number"] {
  -moz-appearance: textfield;
}

/* ---------------------------------------------------------------------------
   Quick Price Buttons
   --------------------------------------------------------------------------- */
.list-quick-prices {
  display: flex;
  gap: var(--space-1);
}

.list-quick-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  min-height: 26px;
  padding: 2px var(--space-1);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast);
  user-select: none;
}

.list-quick-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-overlay);
  border-color: var(--border-default);
}

.list-quick-btn:active {
  background-color: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------------------------------------------------------------------------
   Price Warning
   --------------------------------------------------------------------------- */
.list-price-warning {
  color: var(--color-warning, #f0ad4e);
  background: rgba(240, 173, 78, 0.1);
  border: 1px solid var(--color-warning, #f0ad4e);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  text-align: center;
}

/* ---------------------------------------------------------------------------
   Marketplace Toggle — royalty-style compact toggle
   --------------------------------------------------------------------------- */
.marketplace-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  cursor: pointer;
  user-select: none;
  margin: var(--space-2) 0;
}

.marketplace-toggle .toggle__track {
  width: 24px;
  height: 14px;
  overflow: hidden;
}

.marketplace-toggle .toggle__track::after {
  top: 1px;
  left: 1px;
  width: 10px;
  height: 10px;
}

.marketplace-toggle .toggle__input:checked + .toggle__track::after {
  transform: translateX(10px);
}

.mkt-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

/* Default (unchecked) = Tensor active */
.mkt-label--left {
  color: var(--accent);
}

/* Checked = ME active */
.marketplace-toggle .toggle__input:checked ~ .mkt-label--right {
  color: var(--accent);
}
.marketplace-toggle:has(.toggle__input:checked) .mkt-label--left {
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   Action Buttons (List / Reprice / Delist)
   --------------------------------------------------------------------------- */
.list-actions {
  display: flex;
  gap: var(--space-2);
}

.list-action-btn {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-height: 34px;
  padding: var(--space-1) var(--space-2);
}

.list-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------------------
   Select All Row
   --------------------------------------------------------------------------- */
.list-select-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.list-select-all {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.list-select-all input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.list-checkmark {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border-default);
  border-radius: 3px;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.list-select-all input:checked + .list-checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.list-select-all input:checked + .list-checkmark::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: white;
}

.list-select-all input:focus-visible + .list-checkmark {
  box-shadow: 0 0 0 2px rgba(0, 200, 180, 0.3);
}

.list-nft-count,
.list-selected-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.list-refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: transparent;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.list-refresh-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.list-refresh-btn.is-spinning svg {
  animation: list-spin 0.8s linear infinite;
}

.list-selected-count {
  margin-left: auto;
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
   NFT Grid
   --------------------------------------------------------------------------- */
.list-nft-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: max-content;
  align-content: start;
  gap: var(--space-1);
  overflow-y: auto;
  flex: 1;
}

.list-empty,
.list-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.list-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-muted);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: list-spin 0.8s linear infinite;
}

@keyframes list-spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------------------
   NFT Card
   --------------------------------------------------------------------------- */
.list-nft-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.list-nft-card:hover {
  border-color: var(--border-default);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.list-nft-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 8px rgba(var(--accent-rgb, 20, 241, 149), 0.15);
}

.list-nft-card.is-listed {
  border-color: rgba(20, 241, 149, 0.2);
}

.list-nft-card.is-loading {
  pointer-events: none;
}

.list-nft-card.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    90deg,
    transparent 25%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 75%
  );
  background-size: 200% 100%;
  animation: nft-card-shimmer 1.5s ease-in-out infinite;
}

/* Thumbnail */
.list-nft-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background-color: var(--bg-base);
}

.list-nft-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.list-nft-card:hover .list-nft-thumb img {
  transform: scale(1.06);
}

/* Checkbox */
.list-nft-check {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.list-nft-card:hover .list-nft-check,
.list-nft-check.checked {
  opacity: 1;
}

.list-nft-check.checked {
  background: var(--accent);
  border-color: var(--accent);
  animation: nft-check-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.list-nft-check.checked::after {
  content: '';
  width: 8px;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5l2.5 2.5L8 3' stroke='%23111' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Info below image */
.list-nft-info {
  display: flex;
  flex-direction: column;
  padding: 3px 4px;
  gap: 1px;
  flex-shrink: 0;
}

.list-nft-name {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.list-nft-card:hover .list-nft-name {
  color: var(--text-primary);
}

/* Price + badge row */
.list-nft-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.list-nft-price {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-success);
  letter-spacing: 0.2px;
}

.list-nft-mp-icon {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-muted);
  flex-shrink: 0;
}

.list-nft-mp-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-full);
}

/* Animations */
@keyframes nft-card-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes nft-check-pop {
  0%   { transform: scale(0.6); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .list-nft-card,
  .list-nft-thumb img,
  .list-nft-check,
  .list-nft-name {
    transition: none;
  }
  .list-nft-card:hover {
    transform: none;
  }
  .list-nft-card:hover .list-nft-thumb img {
    transform: none;
  }
  .list-nft-card.is-loading::after {
    animation: none;
  }
  .list-nft-check.checked {
    animation: none;
  }
}

/* Thin custom scrollbar for panel content */
.panel-content::-webkit-scrollbar {
  width: 4px;
}

.panel-content::-webkit-scrollbar-track {
  background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
  background-color: var(--border-default);
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Auto-Snipe Section
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Section Title (shared pattern for snipe panel headings)
   --------------------------------------------------------------------------- */
.auto-snipe-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: var(--space-1);
}

/* ---------------------------------------------------------------------------
   Levels Container
   --------------------------------------------------------------------------- */
.auto-snipe-levels {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ---------------------------------------------------------------------------
   Level Item — individual snipe level card
   --------------------------------------------------------------------------- */
.level-item {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color var(--transition-fast);
}

.level-item:hover {
  border-color: var(--border-default);
}

/* ---------------------------------------------------------------------------
   Level Header — flex row with level name and toggle
   --------------------------------------------------------------------------- */
.level-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 24px;
}

.level-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------------------
   Level Toggle — switch wrapper + slider
   Same 36x20 pattern as the design-system .toggle component
   --------------------------------------------------------------------------- */
.level-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Visually hidden native checkbox */
.level-toggle input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.level-toggle-slider {
  position: relative;
  display: block;
  width: 36px;
  height: 20px;
  background-color: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  transition:
    background-color var(--duration-normal) var(--ease-default),
    border-color var(--duration-normal) var(--ease-default);
  flex-shrink: 0;
}

.level-toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background-color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition:
    transform var(--duration-normal) var(--ease-default),
    background-color var(--duration-normal) var(--ease-default);
  will-change: transform;
}

/* Checked state */
.level-toggle input[type="checkbox"]:checked + .level-toggle-slider {
  background-color: var(--accent-muted);
  border-color: var(--accent);
}

.level-toggle input[type="checkbox"]:checked + .level-toggle-slider::after {
  transform: translateX(16px);
  background-color: var(--accent);
}

/* Hover */
.level-toggle:hover .level-toggle-slider {
  border-color: var(--text-muted);
}

.level-toggle:hover input[type="checkbox"]:checked + .level-toggle-slider {
  border-color: var(--accent-hover);
}

/* Focus */
.level-toggle input[type="checkbox"]:focus-visible + .level-toggle-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Level Controls — grid of inputs below level header
   --------------------------------------------------------------------------- */
.level-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.level-control {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.level-control-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.level-control-input {
  display: block;
  width: 100%;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-normal);
  color: var(--text-primary);
  background-color: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  min-height: 28px;
  text-align: right;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.level-control-input:hover:not(:disabled):not(:focus) {
  border-color: var(--text-muted);
}

.level-control-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
  background-color: var(--bg-surface);
  outline: none;
}

/* Hide native number spinners */
.level-control-input::-webkit-inner-spin-button,
.level-control-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.level-control-input[type="number"] {
  -moz-appearance: textfield;
}

/* ---------------------------------------------------------------------------
   Level Status — status display text
   --------------------------------------------------------------------------- */
.level-status {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: var(--space-1);
  line-height: var(--leading-normal);
}

/* Active status highlight */
.level-status.active,
.level-status.enabled {
  color: var(--color-success);
}

.level-status.error {
  color: var(--color-error);
}

/* ==========================================================================
   Floor Sniper Section
   ========================================================================== */
.floor-sniper-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-muted);
}

.floor-sniper-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: var(--space-1);
}

/* ---------------------------------------------------------------------------
   Floor Sniper Controls
   --------------------------------------------------------------------------- */
.floor-sniper-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.floor-control {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.floor-control-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.floor-control-input {
  display: block;
  width: 100%;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-normal);
  color: var(--text-primary);
  background-color: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  min-height: 28px;
  text-align: right;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.floor-control-input:hover:not(:disabled):not(:focus) {
  border-color: var(--text-muted);
}

.floor-control-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
  background-color: var(--bg-surface);
  outline: none;
}

.floor-control-input::-webkit-inner-spin-button,
.floor-control-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.floor-control-input[type="number"] {
  -moz-appearance: textfield;
}

/* ---------------------------------------------------------------------------
   Floor Status — row with price display and toggle
   --------------------------------------------------------------------------- */
.floor-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  margin-top: var(--space-1);
  border-top: 1px solid var(--border-muted);
  min-height: 32px;
}

.floor-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.floor-price,
.floor-snipe-price {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  line-height: var(--leading-normal);
}

.floor-price {
  color: var(--text-secondary);
}

.floor-snipe-price {
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
   Floor Toggle — same 36x20 switch pattern
   --------------------------------------------------------------------------- */
.floor-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.floor-toggle input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.floor-toggle-slider {
  position: relative;
  display: block;
  width: 36px;
  height: 20px;
  background-color: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  transition:
    background-color var(--duration-normal) var(--ease-default),
    border-color var(--duration-normal) var(--ease-default);
  flex-shrink: 0;
}

.floor-toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background-color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition:
    transform var(--duration-normal) var(--ease-default),
    background-color var(--duration-normal) var(--ease-default);
  will-change: transform;
}

.floor-toggle input[type="checkbox"]:checked + .floor-toggle-slider {
  background-color: var(--accent-muted);
  border-color: var(--accent);
}

.floor-toggle input[type="checkbox"]:checked + .floor-toggle-slider::after {
  transform: translateX(16px);
  background-color: var(--accent);
}

.floor-toggle:hover .floor-toggle-slider {
  border-color: var(--text-muted);
}

.floor-toggle:hover input[type="checkbox"]:checked + .floor-toggle-slider {
  border-color: var(--accent-hover);
}

.floor-toggle input[type="checkbox"]:focus-visible + .floor-toggle-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Sweep Panel
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Sweep Title
   --------------------------------------------------------------------------- */
.sweep-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: var(--space-1);
}

/* ---------------------------------------------------------------------------
   Sweep Controls Container
   --------------------------------------------------------------------------- */
.sweep-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ---------------------------------------------------------------------------
   Sweep Slider Section & Container
   --------------------------------------------------------------------------- */
.sweep-slider-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sweep-slider-container {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---------------------------------------------------------------------------
   Sweep Slider — range input
   --------------------------------------------------------------------------- */
.sweep-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  background: var(--bg-overlay);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  margin: 0;
}

.sweep-slider::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--bg-overlay);
  border-radius: var(--radius-full);
}

.sweep-slider::-moz-range-track {
  height: 4px;
  background: var(--bg-overlay);
  border-radius: var(--radius-full);
  border: none;
}

.sweep-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: 2px solid var(--bg-base);
  border-radius: var(--radius-full);
  cursor: pointer;
  margin-top: -6px;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.sweep-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.2);
}

.sweep-slider::-webkit-slider-thumb:active {
  transform: scale(1.05);
  box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.15);
}

.sweep-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: 2px solid var(--bg-base);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.sweep-slider::-moz-range-progress {
  height: 4px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.sweep-slider:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sweep-slider:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Sweep Input Group — number input with stepper buttons
   --------------------------------------------------------------------------- */
.sweep-input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 32px;
  background-color: var(--bg-base);
  transition: border-color var(--transition-fast);
}

.sweep-input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
}

.sweep-number-input {
  width: 52px;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  background-color: transparent;
  border: none;
  text-align: center;
  outline: none;
}

.sweep-number-input::-webkit-inner-spin-button,
.sweep-number-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sweep-number-input[type="number"] {
  -moz-appearance: textfield;
}

/* ---------------------------------------------------------------------------
   Sweep Stepper — up/down buttons
   --------------------------------------------------------------------------- */
.sweep-stepper {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-default);
}

.sweep-stepper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  flex: 1;
  padding: 0;
  font-size: 8px;
  line-height: 1;
  color: var(--text-muted);
  background-color: var(--bg-elevated);
  border: none;
  cursor: pointer;
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast);
  user-select: none;
}

.sweep-stepper-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-overlay);
}

.sweep-stepper-btn:active {
  background-color: var(--accent-subtle);
  color: var(--accent);
}

.sweep-stepper-btn + .sweep-stepper-btn {
  border-top: 1px solid var(--border-default);
}

/* ---------------------------------------------------------------------------
   Sweep Unit Selector — radio button group (Count / SOL)
   --------------------------------------------------------------------------- */
.sweep-unit-selector {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.sweep-unit-option {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Hide native radio */
.sweep-unit-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sweep-unit-radio {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background-color: var(--bg-base);
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast);
  flex-shrink: 0;
}

.sweep-unit-radio::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: transparent;
  transition: background-color var(--transition-fast);
}

/* Checked state */
.sweep-unit-option input[type="radio"]:checked + .sweep-unit-radio {
  border-color: var(--accent);
  background-color: var(--accent-subtle);
}

.sweep-unit-option input[type="radio"]:checked + .sweep-unit-radio::after {
  background-color: var(--accent);
}

/* Hover */
.sweep-unit-option:hover .sweep-unit-radio {
  border-color: var(--text-muted);
}

/* Focus */
.sweep-unit-option input[type="radio"]:focus-visible + .sweep-unit-radio {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sweep-unit-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  line-height: 1;
  transition: color var(--transition-fast);
}

.sweep-unit-option input[type="radio"]:checked ~ .sweep-unit-label {
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------------
   Sweep God Mode Row
   --------------------------------------------------------------------------- */
.sweep-god-mode {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border-muted);
  border-bottom: 1px solid var(--border-muted);
}

/* ---------------------------------------------------------------------------
   Sweep Toggle — same 36x20 switch pattern
   --------------------------------------------------------------------------- */
.sweep-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sweep-toggle input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sweep-toggle-slider {
  position: relative;
  display: block;
  width: 36px;
  height: 20px;
  background-color: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  transition:
    background-color var(--duration-normal) var(--ease-default),
    border-color var(--duration-normal) var(--ease-default);
  flex-shrink: 0;
}

.sweep-toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background-color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition:
    transform var(--duration-normal) var(--ease-default),
    background-color var(--duration-normal) var(--ease-default);
  will-change: transform;
}

.sweep-toggle input[type="checkbox"]:checked + .sweep-toggle-slider {
  background-color: var(--accent-muted);
  border-color: var(--accent);
}

.sweep-toggle input[type="checkbox"]:checked + .sweep-toggle-slider::after {
  transform: translateX(16px);
  background-color: var(--accent);
}

.sweep-toggle:hover .sweep-toggle-slider {
  border-color: var(--text-muted);
}

.sweep-toggle:hover input[type="checkbox"]:checked + .sweep-toggle-slider {
  border-color: var(--accent-hover);
}

.sweep-toggle input[type="checkbox"]:focus-visible + .sweep-toggle-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Sweep Toggle Label + Info Icon
   --------------------------------------------------------------------------- */
.sweep-toggle-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.sweep-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: var(--weight-bold);
  font-style: normal;
  color: var(--text-muted);
  background-color: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  cursor: help;
  margin-left: auto;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast);
  user-select: none;
}

.sweep-info-icon:hover {
  color: var(--text-secondary);
  border-color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   Sweep Action Section
   --------------------------------------------------------------------------- */
.sweep-action-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ---------------------------------------------------------------------------
   Sweep Info Display — selected / total / price
   --------------------------------------------------------------------------- */
.sweep-info-display {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
}

.sweep-selected,
.sweep-total,
.sweep-price {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.sweep-selected {
  color: var(--text-primary);
}

.sweep-price {
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
   Sweep Action Button
   --------------------------------------------------------------------------- */
.sweep-action-btn {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-height: 36px;
}

.sweep-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   Mobile: drawer behavior
   ========================================================================== */
@media (max-width: 767px) {
  .sidebar,
  .auto-snipe-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    z-index: var(--z-sidebar);
    transform: translateX(-100%);
    transition: transform var(--duration-slow) var(--ease-out);
    box-shadow: none;
  }

  .sidebar--open,
  .auto-snipe-sidebar.sidebar--open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .sidebar__close {
    display: flex;
  }

  /* Overlay scrim behind sidebar */
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    top: var(--header-height);
    z-index: calc(var(--z-sidebar) - 1);
    background-color: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background-color var(--duration-slow) var(--ease-default);
  }

  .sidebar--open ~ .sidebar-backdrop,
  .sidebar-backdrop.is-visible {
    background-color: rgba(0, 0, 0, 0.6);
    pointer-events: auto;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .auto-snipe-sidebar {
    transition: none;
  }

  .sidebar-backdrop {
    transition: none;
  }

  .level-toggle-slider,
  .level-toggle-slider::after,
  .floor-toggle-slider,
  .floor-toggle-slider::after,
  .sweep-toggle-slider,
  .sweep-toggle-slider::after {
    transition: none;
  }

  .sweep-slider::-webkit-slider-thumb {
    transition: none;
  }

  .sweep-slider::-moz-range-thumb {
    transition: none;
  }

  .panel-btn {
    transition: none;
  }

  .panel-content {
    transition: none;
  }

  .level-control-input,
  .floor-control-input {
    transition: none;
  }
}
