/* ============================================================
   Live Auction — application styles
   ------------------------------------------------------------
   Loaded after Bootstrap 5 + Font Awesome 6 (via CDN in the
   HTML pages). This file holds:

   1. Design tokens (mirrors specs/ui-reference/styles/_variables.scss)
   2. Bootstrap 5 overrides (navbar, buttons, forms, toasts, modals)
   3. Utility classes (fs-xxs, fs-xs, fs-sm-custom, extra-large-text-mode)
   4. App header (sticky navbar + mobile glassmorphic collapse)
   5. Component styles (current status, vehicle gallery, activity
      chips, planned lots, lot status badge)
   6. Live-auction PoC widgets (dealer status card, hammer track,
      bid feed row, event log, connection status, feedback banners,
      winner overlay, private-message toast)
   7. Animations (pulse-warning, pulse-subtle, pulse-winning,
      pulse-outbid, confetti-fall, flash-sold)
   8. Debug panel (preserved verbatim — toggled by Ctrl+Shift+D)
   ============================================================ */

/* ============================================================
   1. Design tokens
   ============================================================ */
:root {
  /* -------- Brand palette (Autorola orange) -------- */
  --theme-primary: #ff5a00;
  --theme-primary-rgb: 255, 90, 0;
  --theme-primary-light: #ff7a20;
  --theme-primary-light-rgb: 255, 122, 32;
  --theme-primary-hover: #cc4800;
  --theme-primary-active: #b33f00;
  --theme-primary-disabled: #ffb084;

  /* -------- Semantic state colors -------- */
  --theme-success: #28a745;
  --theme-success-rgb: 40, 167, 69;
  --theme-success-dark: #198754;
  --theme-success-darker: #157347;
  --theme-warning: #ffc107;
  --theme-warning-rgb: 255, 193, 7;
  --theme-danger: #d10000;
  --theme-danger-rgb: 209, 0, 0;
  --theme-danger-bs: #dc3545;
  --theme-danger-bs-rgb: 220, 53, 69;
  --theme-info: #959595;
  --theme-info-rgb: 149, 149, 149;
  --theme-accent-blue: #0d6efd;
  --theme-accent-blue-rgb: 13, 110, 253;

  /* -------- Neutrals -------- */
  --theme-secondary: #959595;
  --theme-secondary-rgb: 149, 149, 149;
  --theme-light: #f8f9fa;
  --theme-light-rgb: 248, 249, 250;
  --theme-dark: #646464;
  --theme-dark-rgb: 100, 100, 100;
  --theme-white: #ffffff;
  --theme-white-rgb: 255, 255, 255;
  --theme-black: #000000;
  --theme-black-rgb: 0, 0, 0;
  --theme-text: #212529;
  --theme-text-muted: #495057;
  --theme-neutral-gray: #6c757d;
  --theme-surface-overlay-rgb: 18, 29, 61;
  --theme-persona-dealer-rgb: 102, 168, 255;

  /* -------- Typography -------- */
  --theme-font-sans:
    'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --theme-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace;

  /* -------- Radius (Bootstrap scale) -------- */
  --theme-radius-sm: 0.25rem;
  --theme-radius: 0.375rem;
  --theme-radius-lg: 0.5rem;

  /* -------- Bootstrap 5 shim -------- */
  --bs-primary: var(--theme-primary);
  --bs-primary-rgb: var(--theme-primary-rgb);
  --bs-secondary: var(--theme-secondary);
  --bs-secondary-rgb: var(--theme-secondary-rgb);
  --bs-success: var(--theme-success);
  --bs-success-rgb: var(--theme-success-rgb);
  --bs-info: var(--theme-info);
  --bs-info-rgb: var(--theme-info-rgb);
  --bs-warning: var(--theme-warning);
  --bs-warning-rgb: var(--theme-warning-rgb);
  --bs-danger: var(--theme-danger);
  --bs-danger-rgb: var(--theme-danger-rgb);
  --bs-light: var(--theme-light);
  --bs-light-rgb: var(--theme-light-rgb);
  --bs-dark: var(--theme-dark);
  --bs-dark-rgb: var(--theme-dark-rgb);
  --bs-link-color: var(--theme-primary);
  --bs-link-hover-color: var(--theme-primary-hover);
}

/* ============================================================
   2. Base
   ============================================================ */
html, body { height: 100%; margin: 0; padding: 0; }
body { font-family: var(--theme-font-sans); background: var(--theme-light); color: var(--theme-text); }
.app-container { min-height: 100%; display: flex; flex-direction: column; }
input, button, textarea, select { font: inherit; }

/* ============================================================
   3. Bootstrap overrides — buttons, navbar, forms, toasts, modals
   ============================================================ */
.btn-primary {
  --bs-btn-bg: var(--theme-primary);
  --bs-btn-border-color: var(--theme-primary);
  --bs-btn-hover-bg: var(--theme-primary-hover);
  --bs-btn-hover-border-color: var(--theme-primary-hover);
  --bs-btn-active-bg: var(--theme-primary-active);
  --bs-btn-active-border-color: var(--theme-primary-active);
  --bs-btn-disabled-bg: var(--theme-primary-disabled);
  --bs-btn-disabled-border-color: var(--theme-primary-disabled);
  color: #fff; font-weight: 700;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active { color: #fff; font-weight: 700; }
.btn-primary:disabled, .btn-primary.disabled { color: rgba(255, 255, 255, 0.7); font-weight: 700; }

.btn-outline-primary {
  --bs-btn-color: var(--theme-primary);
  --bs-btn-border-color: var(--theme-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--theme-primary);
  --bs-btn-hover-border-color: var(--theme-primary);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--theme-primary);
  --bs-btn-active-border-color: var(--theme-primary);
  font-weight: 700;
}
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active, .btn-outline-primary.active { color: #fff; font-weight: 700; }

.btn-secondary {
  --bs-btn-bg: #e9ecef;
  --bs-btn-border-color: #ced4da;
  --bs-btn-color: #495057;
  --bs-btn-hover-bg: #dae0e5;
  --bs-btn-hover-border-color: #adb5bd;
  --bs-btn-hover-color: #343a40;
  --bs-btn-active-bg: #ced4da;
  --bs-btn-active-border-color: #adb5bd;
  --bs-btn-active-color: #343a40;
  --bs-btn-disabled-bg: var(--theme-light);
  --bs-btn-disabled-border-color: #e9ecef;
  --bs-btn-disabled-color: #adb5bd;
  font-weight: 500;
}

.btn-outline-secondary {
  --bs-btn-color: #6c757d;
  --bs-btn-border-color: #ced4da;
  --bs-btn-hover-color: #495057;
  --bs-btn-hover-bg: #e9ecef;
  --bs-btn-hover-border-color: #adb5bd;
  --bs-btn-active-color: #343a40;
  --bs-btn-active-bg: #e9ecef;
  --bs-btn-active-border-color: #adb5bd;
  --bs-btn-disabled-color: #adb5bd;
  --bs-btn-disabled-border-color: #e9ecef;
  font-weight: 400;
  opacity: 0.7;
}
.btn-outline-secondary:disabled, .btn-outline-secondary.disabled { opacity: 0.5; cursor: not-allowed; }

/* Navbar orange gradient */
.navbar.bg-primary {
  background: linear-gradient(to bottom, var(--theme-primary-light), var(--theme-primary)) !important;
}

/* Badge */
.badge.fs-6 { font-size: 0.875rem !important; font-weight: 500; text-transform: uppercase; }

/* Tooltip */
.tooltip { font-size: 0.75rem; z-index: 1070; }
.tooltip-inner { background-color: rgba(0, 0, 0, 0.85); padding: 0.25rem 0.5rem; max-width: 250px; color: #fff; }

/* Forms validation */
.was-validated .form-control:valid, .form-control.is-valid { border-color: var(--theme-success); }
.was-validated .form-control:invalid, .form-control.is-invalid { border-color: var(--theme-danger); }
.valid-feedback { color: var(--theme-success); }
.invalid-feedback { color: var(--theme-danger); }
.form-range::-webkit-slider-thumb { background-color: var(--theme-primary); }
.form-range::-moz-range-thumb { background-color: var(--theme-primary); border: none; }
.form-switch-primary .form-check-input:checked { background-color: var(--theme-primary); border-color: var(--theme-primary); }

/* Modal */
.modal { background-color: rgba(0, 0, 0, 0.5); z-index: 9999; }
.modal.show { display: block; }

/* ============================================================
   4. Utility classes
   ============================================================ */
.fs-xxs { font-size: 0.85rem !important; }
.fs-xs { font-size: 0.875rem !important; }
.fs-sm-custom { font-size: 0.95rem !important; }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
.highlight-danny-dealer {
  background-color: #fff3cd; color: #533f03;
  padding: 0.125rem 0.35rem; border-radius: 0.25rem; font-weight: 600;
}

/* Extra-large text mode (accessibility enhancement) */
.extra-large-text-mode .fs-xxs { font-size: 1rem !important; }
.extra-large-text-mode .fs-xs { font-size: 1.05rem !important; }
.extra-large-text-mode .fs-sm-custom { font-size: 1.15rem !important; }
.extra-large-text-mode .fs-5 { font-size: 1.35rem !important; }
.extra-large-text-mode .fs-6 { font-size: 1.25rem !important; }
.extra-large-text-mode .small { font-size: 1rem !important; }
.extra-large-text-mode .badge { font-size: 1rem !important; }
.extra-large-text-mode h1, .extra-large-text-mode .h1 { font-size: 2.25rem !important; }
.extra-large-text-mode h2, .extra-large-text-mode .h2 { font-size: 1.85rem !important; }
.extra-large-text-mode h3, .extra-large-text-mode .h3 { font-size: 1.6rem !important; }
.extra-large-text-mode h4, .extra-large-text-mode .h4 { font-size: 1.75rem !important; }
.extra-large-text-mode .auction-title { font-size: 1.5rem; }
.extra-large-text-mode .user-identity__name { font-size: 1.05rem; }
.extra-large-text-mode .mobile-nav-btn { font-size: 1.05rem; padding: 1rem 1.15rem; }
.extra-large-text-mode .header-time { font-size: 0.95rem; }

/* ============================================================
   5. App header — sticky navbar + mobile glassmorphic collapse
   (verbatim from specs/ui-reference/components/header/header.component.scss)
   ============================================================ */
.app-logo { height: 40px; width: auto; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15)); }
@media (max-width: 767px) { .app-logo { height: 32px; } }

.app-header { position: sticky; top: 0; z-index: 1030; }
.app-header .navbar { padding: 0; }
.app-header .container-fluid { padding: 0.5rem 1rem; }
@media (min-width: 992px) { .app-header .container-fluid { padding: 0.75rem 1.5rem; } }

.header-main {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; gap: 1rem; position: relative;
}
.header-brand { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.header-title { display: flex; flex-direction: column; gap: 0.15rem; }
.auction-title {
  margin: 0; font-size: 1.25rem; font-weight: 700;
  color: var(--theme-white); line-height: 1.2;
  display: flex; align-items: center; gap: 0.5rem;
}
@media (min-width: 1200px) { .auction-title { font-size: 1.35rem; } }
.auction-id { font-size: 0.95rem; font-weight: 500; color: rgba(255, 255, 255, 0.75); }
.auction-meta {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.875rem; color: rgba(255, 255, 255, 0.8); margin-top: 0.25rem;
}
.auction-meta .meta-separator { color: rgba(255, 255, 255, 0.5); }

.header-actions { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.header-time {
  display: flex; align-items: center;
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: var(--theme-white);
  font-size: 0.875rem; font-weight: 600;
  letter-spacing: 0.02em; white-space: nowrap;
}
.header-buttons { display: flex; align-items: center; gap: 0.5rem; }
.header-divider { width: 1px; height: 24px; background: rgba(255, 255, 255, 0.25); margin: 0 0.25rem; }

/* Header button variants */
.app-header .btn-sm {
  padding: 0.4rem 0.75rem; font-size: 0.875rem;
  border-radius: 0.5rem; font-weight: 500;
  transition: all 0.2s ease;
}
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--theme-white);
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}
.btn-icon.active {
  background: rgba(255, 193, 7, 0.25);
  border-color: rgba(255, 193, 7, 0.5);
  color: var(--theme-warning);
}
.view-toggle-btn {
  background: rgba(13, 110, 253, 0.2);
  border: 1px solid rgba(13, 110, 253, 0.4);
  color: var(--theme-white);
}
.view-toggle-btn:hover { background: rgba(13, 110, 253, 0.3); border-color: rgba(13, 110, 253, 0.6); }
.view-toggle-btn.active {
  background: rgba(13, 110, 253, 0.35);
  border-color: rgba(13, 110, 253, 0.7);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}
.app-header .btn-outline-light { border-color: rgba(255, 255, 255, 0.3); color: var(--theme-white); }
.app-header .btn-outline-light:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.5); }
.app-header .btn-outline-danger {
  border-color: rgba(220, 53, 69, 0.5);
  color: var(--theme-white);
  background: rgba(220, 53, 69, 0.15);
}
.app-header .btn-outline-danger:hover { background: rgba(220, 53, 69, 0.25); border-color: rgba(220, 53, 69, 0.7); }
.app-header .btn-success {
  background: var(--theme-success-dark);
  border-color: var(--theme-success-dark);
  color: var(--theme-white);
}
.app-header .btn-success:hover { background: var(--theme-success-darker); border-color: var(--theme-success-darker); }

/* User menu + persona identity chip */
.user-menu { position: relative; }
.user-identity {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: var(--theme-white);
  cursor: pointer; transition: all 0.2s ease;
}
.user-identity:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}
.user-identity:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.6); outline-offset: 2px; }
.user-identity--auctioneer { border-color: rgba(255, 193, 7, 0.5); }
.user-identity--auctioneer:hover { border-color: rgba(255, 193, 7, 0.7); }
.user-identity--dealer { border-color: rgba(102, 168, 255, 0.5); }
.user-identity--dealer:hover { border-color: rgba(102, 168, 255, 0.7); }

.user-identity__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.05em;
  color: var(--theme-white);
}
.user-identity--auctioneer .user-identity__avatar {
  border-color: rgba(255, 193, 7, 0.8);
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.5), rgba(255, 145, 0, 0.4));
}
.user-identity--dealer .user-identity__avatar {
  border-color: rgba(102, 168, 255, 0.8);
  background: linear-gradient(135deg, rgba(102, 168, 255, 0.5), rgba(30, 81, 166, 0.5));
}
.user-identity__info { display: flex; align-items: center; line-height: 1.2; text-align: left; }
.user-identity__name { font-weight: 600; font-size: 0.9rem; color: var(--theme-white); }

.user-menu__dropdown {
  position: absolute; top: calc(100% + 0.5rem); right: 0;
  min-width: 200px; padding: 0.5rem;
  border-radius: 0.75rem;
  background: rgba(18, 29, 61, 0.97);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  z-index: 1040;
}
.user-menu__dropdown[hidden] { display: none; }
.user-menu__header { padding: 0.75rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 0.5rem; }
.user-menu__name { font-weight: 600; font-size: 0.95rem; color: var(--theme-white); margin-bottom: 0.25rem; }
.user-menu__role { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.7); }
.user-menu__item {
  width: 100%;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: none; border-radius: 0.5rem;
  background: transparent; color: var(--theme-white);
  font-weight: 500; font-size: 0.9rem;
  cursor: pointer; transition: all 0.2s ease;
}
.user-menu__item:hover { background: rgba(255, 255, 255, 0.12); }
.user-menu__item i { width: 18px; text-align: center; opacity: 0.8; }

/* Mobile hamburger */
.navbar-toggler {
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
}
.navbar-toggler:hover { background: rgba(255, 255, 255, 0.15); }
.navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2); }
.navbar-toggler-icon { width: 22px; height: 22px; }

/* Mobile collapsible menu with glassmorphic navy backdrop */
.header-collapse {
  position: absolute; top: 100%; left: 0; right: 0;
  background: rgba(18, 29, 61, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  z-index: 1020;
}
.header-collapse.show { max-height: calc(100vh - 80px); opacity: 1; overflow-y: auto; }
.header-collapse__content { padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }

.mobile-title { padding: 0.75rem; background: rgba(255, 255, 255, 0.05); border-radius: 0.5rem; margin-bottom: 0.5rem; }
.mobile-title .auction-title { font-size: 1.1rem; margin-bottom: 0.35rem; }
.mobile-title .auction-meta {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.85rem; color: rgba(255, 255, 255, 0.75);
}
.mobile-time {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: var(--theme-white); font-size: 0.9rem;
  display: flex; align-items: center;
}
.mobile-divider { height: 1px; background: rgba(255, 255, 255, 0.1); margin: 0.5rem 0; }
.mobile-nav-btn {
  width: 100%;
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: none; border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--theme-white);
  font-weight: 500; font-size: 0.95rem;
  cursor: pointer; transition: all 0.2s ease;
  text-align: left;
}
.mobile-nav-btn:hover { background: rgba(255, 255, 255, 0.15); }
.mobile-nav-btn:active { transform: scale(0.98); }
.mobile-nav-btn.active { background: rgba(13, 110, 253, 0.25); border: 1px solid rgba(13, 110, 253, 0.5); }
.mobile-nav-btn i { width: 20px; text-align: center; font-size: 1.1rem; }
.mobile-nav-btn--primary { background: var(--theme-success-dark); color: var(--theme-white); font-weight: 600; }
.mobile-nav-btn--primary:hover { background: var(--theme-success-darker); }
.mobile-nav-btn--danger { background: rgba(220, 53, 69, 0.2); color: #ff6b7a; }
.mobile-nav-btn--danger:hover { background: rgba(220, 53, 69, 0.3); }

@media (max-width: 767px) {
  .app-header .container-fluid { padding: 0.5rem 0.75rem; }
  .header-brand { gap: 0.65rem; }
}
@media (min-width: 768px) and (max-width: 991px) {
  .auction-title { font-size: 1.15rem; }
  .header-time { font-size: 0.8rem; padding: 0.35rem 0.7rem; }
}

/* ============================================================
   6. Card headers — match reference (h6 card-title + fs-5)
   ============================================================ */
.card .card-header.bg-white { background-color: var(--theme-white) !important; }
.card .card-title { color: var(--theme-text); }

/* Connection status pill inside header (live auction) */
.connection-status {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: var(--theme-white);
  font-size: 0.8rem; font-weight: 500;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--theme-danger);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
  transition: background 0.2s ease;
}
.status-dot.connected { background: #5fe394; }

/* ============================================================
   7. Vehicle gallery + thumbnail strip
   (specs/ui-reference/components/vehicle-details/*.scss)
   ============================================================ */
.vehicle-gallery { margin-top: 1rem; }
.vehicle-gallery__main {
  border-radius: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(13, 110, 253, 0.02));
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.vehicle-gallery__main-trigger {
  position: relative; display: block; width: 100%;
  padding: 0; border: 0; background: transparent; cursor: pointer;
}
.vehicle-gallery__main-trigger:focus-visible { outline: 3px solid var(--theme-accent-blue); outline-offset: 2px; }
.vehicle-gallery__main-image {
  width: 100%; height: 200px; object-fit: cover; display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.vehicle-gallery__main-trigger:hover .vehicle-gallery__main-image,
.vehicle-gallery__main-trigger:focus-visible .vehicle-gallery__main-image {
  transform: scale(1.01); filter: brightness(1.02);
}
.vehicle-gallery__thumbnails { overflow-x: auto; padding-bottom: 0.25rem; }

.thumbnail-btn {
  border: 1px solid transparent; border-radius: 0.5rem;
  padding: 0; width: 72px; height: 56px; overflow: hidden;
  background-color: var(--theme-white);
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.thumbnail-btn:focus-visible { outline: 3px solid var(--theme-accent-blue); outline-offset: 2px; }
.thumbnail-btn__image { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbnail-btn--active {
  border-color: var(--theme-accent-blue);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

/* ============================================================
   8. Activity chip (vehicle-details footer + planned lots)
   ============================================================ */
.activity-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.375rem;
  background-color: var(--theme-light);
  color: var(--theme-dark);
  cursor: pointer; transition: all 0.2s ease;
  font-weight: 500; text-decoration: none;
}
.activity-chip:hover {
  background-color: #dee2e6;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.activity-chip:focus { outline: 2px solid var(--theme-primary); outline-offset: 2px; }

/* ============================================================
   9. Current status — lot status badge + reserve-met pulse
   ============================================================ */
.lot-status-badge { min-height: 60px; }
.reserve-met-badge { animation: pulse-subtle 2s infinite; }

/* ============================================================
   10. Live-auction PoC widgets
   ============================================================ */

/* --- Bootstrap table touches (dealers, bids, planned lots) --- */
.table > :not(caption) > * > * { padding: 0.4rem 0.6rem; }
.table thead th { color: var(--theme-text-muted); background: var(--theme-light); }
.table.table-hover > tbody > tr:hover > * { background-color: rgba(var(--theme-primary-rgb), 0.05); }
.table.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(0, 0, 0, 0.015); }
.table tbody td { vertical-align: middle; }

/* --- Feedback banners (inline below control panels) --- */
.feedback {
  padding: 0.5rem 0.75rem;
  border-radius: var(--theme-radius);
  font-size: 0.875rem; display: none;
  margin-top: 0.5rem;
}
.feedback--visible { display: block; }
.feedback--success { background: #d1e7dd; color: #0a3622; border: 1px solid #a3cfbb; }
.feedback--error   { background: #f8d7da; color: #58151c; border: 1px solid #f1aeb5; }

/* --- Dealer hammer progress bar (sliding indicator) ---
   specs/screens/live-auction.md → Dealer status card → "Hammer-stage
   progress bar (horizontal, with sliding indicator)".
   specs/design/06-motion.md → "Sliding left position, 0.5 s
   cubic-bezier, as hammer state advances." */
.hammer-progress {
  position: relative;
  margin: 0.5rem 0 0.75rem 0;
}
.hammer-progress__track {
  position: relative;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
}
.hammer-progress__indicator {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 12.5%;       /* NONE: at the start of "Accepting bids" segment */
  background: var(--theme-primary);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.3s ease;
}
.hammer-progress[data-state="GOING_ONCE"]  .hammer-progress__indicator { width: 37.5%; background: var(--theme-warning); }
.hammer-progress[data-state="GOING_TWICE"] .hammer-progress__indicator { width: 62.5%; background: var(--theme-warning); }
.hammer-progress[data-state="SOLD"]        .hammer-progress__indicator { width: 100%;  background: var(--theme-success-dark); }
.hammer-progress__steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  margin-top: 0.5rem;
}
.hammer-progress__step {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--theme-text-muted);
  padding: 0.2rem 0.25rem;
  transition: color 0.3s ease;
}
.hammer-progress__step.is-active { color: var(--theme-text); }
.hammer-progress__step.is-done   { color: var(--theme-text); opacity: 0.7; }

/* --- Toast notifications --- */
/* specs/features/09-notifications.md: bottom-right, 12 px inset,
   stack newest-on-top, severity-coded backgrounds. */
.toast-container {
  position: fixed; z-index: 999999;
  bottom: 12px; right: 12px;
  display: flex; flex-direction: column; gap: 0.5rem;
  max-width: 360px;
}
.custom-toast {
  background: var(--theme-primary);
  color: var(--theme-white);
  padding: 0.75rem 1rem;
  border-radius: var(--theme-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.custom-toast.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.custom-toast__title {
  font-weight: 700; font-size: 0.875rem;
  margin-bottom: 0.25rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.custom-toast__body { font-size: 0.95rem; }
.custom-toast--success { background: var(--theme-success-dark); }
.custom-toast--error   { background: var(--theme-danger); }
.custom-toast--warning { background: var(--theme-primary); }  /* spec: warning is brand orange */
.custom-toast--info    { background: var(--theme-text); }

/* --- Winner overlay (dealer: "YOU WON!" confetti dialog) --- */
.winner-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9999;
  padding: 1rem;
}
.winner-overlay.visible { display: flex; }
.winner-card {
  background: var(--theme-white);
  padding: 2.5rem 3rem;
  border-radius: var(--theme-radius-lg);
  text-align: center;
  max-width: 420px; position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.winner-card h2 { color: var(--theme-success-dark); font-size: 2rem; margin-bottom: 0.5rem; }
.winner-card p { color: var(--theme-text); font-size: 1rem; margin-bottom: 1.5rem; }
.winner-card::before, .winner-card::after {
  content: "🎉"; position: absolute; top: -20px;
  font-size: 2rem; animation: confetti-fall 3s ease-in infinite;
}
.winner-card::before { left: 10%; animation-delay: 0s; }
.winner-card::after  { right: 10%; animation-delay: 0.5s; }

/* --- Login screen (dealer entry) --- */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #fff4e6 100%);
  padding: 1rem;
}
.login-box {
  background: var(--theme-white);
  padding: 2.5rem;
  border-radius: var(--theme-radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  text-align: center;
  width: 100%; max-width: 420px;
}
.login-box img { height: 48px; margin-bottom: 1.5rem; }
.login-box h1 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--theme-text); }
.login-box p { color: var(--theme-text-muted); margin-bottom: 1.5rem; }

/* ============================================================
   11. Animations
   ============================================================ */
@keyframes pulse-warning {
  0%   { box-shadow: 0 0 0 0 rgba(149, 149, 149, 0.7); }
  70%  { box-shadow: 0 0 0 5px rgba(149, 149, 149, 0); }
  100% { box-shadow: 0 0 0 0 rgba(149, 149, 149, 0); }
}
.countdown-active { animation: pulse-warning 1.5s infinite; }

@keyframes bootstrap-spinner {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.spinner-border { animation: bootstrap-spinner 0.75s linear infinite; }

@keyframes pulse-subtle {
  0%   { opacity: 1; }
  50%  { opacity: 0.8; }
  100% { opacity: 1; }
}
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg);  opacity: 1; }
  100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}

/* ============================================================
   12. Debug panel — preserved verbatim (toggled by Ctrl+Shift+D)
   ============================================================ */

/* The CSS variable is the single source of truth for the panel's
   height. It's read both by the panel itself and by the body's
   reserve-bottom so opening the panel SHRINKS the page rather than
   covering it. The user can drag the resize handle to set this
   value; debug.js persists it in localStorage. Capped at 30 % of
   the viewport so the panel can never dominate the page (debug.js
   enforces the same cap on the resize handle and on restore). */
:root { --debug-panel-height: 30vh; }

.debug-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--debug-panel-height);
  min-height: 160px;
  background: #11161c;
  color: #d9e1ea;
  border-top: 1px solid #2a3340;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  z-index: 99999;
  display: none;
  flex-direction: column;
}
.debug-panel[data-open="true"] { display: flex; }

/* When the panel is open, body reserves a slice at the bottom so the
   page surface above flows around it instead of being overlapped.
   `box-sizing: border-box` is required so the padding is consumed
   *inside* body's height (which the surfaces below size against) —
   without it, the padding extends body past the viewport and the
   100 %-height children continue to overlap the panel. */
body.has-debug-panel {
  padding-bottom: var(--debug-panel-height);
  box-sizing: border-box;
}
body.debug-panel-resizing { user-select: none; cursor: row-resize; }

/* Drag handle along the top edge — 6 px tall, hover-highlights so the
   affordance is discoverable. */
.debug-panel__resize {
  height: 6px;
  background: #1b2330;
  cursor: row-resize;
  border-bottom: 1px solid #2a3340;
  flex: 0 0 auto;
  transition: background-color 120ms ease;
}
.debug-panel__resize:hover,
body.debug-panel-resizing .debug-panel__resize { background: #2f8aff; }

.debug-panel__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #0b1016;
  border-bottom: 1px solid #2a3340;
}
.debug-panel__tabs { display: flex; gap: 4px; }
.debug-panel__tab,
.debug-panel__action {
  background: #1b2330;
  border: 1px solid #2a3340;
  color: #d9e1ea;
  padding: 4px 10px;
  cursor: pointer;
  font: inherit;
  border-radius: 3px;
}
.debug-panel__tab:hover,
.debug-panel__action:hover { background: #263242; }
.debug-panel__tab.is-active {
  background: #263242;
  border-color: #4a9eff;
  color: #fff;
}
.debug-panel__bar-spacer { flex: 1; }
.debug-panel__actions { display: flex; gap: 4px; }

.debug-panel__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c3ccd7;
  cursor: pointer;
  user-select: none;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
}
.debug-panel__toggle:hover { border-color: #2a3340; background: #161d26; }
.debug-panel__toggle[hidden] { display: none; }
.debug-panel__toggle input { accent-color: #4a9eff; cursor: pointer; }

.debug-panel__body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.debug-panel__pane { flex: 1; overflow: auto; padding: 8px 10px; }
.debug-panel__pane[hidden] { display: none; }

.debug-panel__empty { color: #6b7785; padding: 24px; text-align: center; }

.debug-panel__events { display: flex; flex-direction: column; }
.debug-panel__events-head,
.debug-panel__event-row {
  display: grid;
  grid-template-columns: 14px 68px 48px minmax(0, 1fr) 60px 56px;
  gap: 8px;
  align-items: center;
  padding: 2px 6px;
  line-height: 1.4;
}
.debug-panel__events-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0b1016;
  border-bottom: 1px solid #2a3340;
  color: #6b7785;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 4px;
  padding-bottom: 4px;
}
.debug-panel__event { border-bottom: 1px solid #141a22; }
.debug-panel__event--clickable { cursor: pointer; }
.debug-panel__event--clickable .debug-panel__event-row:hover { background: #161d26; }
.debug-panel__event--expanded { background: #141b23; }
.debug-panel__event--expanded .debug-panel__event-row { background: #161d26; }
.debug-panel__caret { color: #6b7785; text-align: center; font-size: 10px; }
.debug-panel__caret--empty { visibility: hidden; }
.debug-panel__time { color: #6b7785; font-size: 11px; font-variant-numeric: tabular-nums; }
.debug-panel__duration { color: #6b7785; text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; }

.debug-panel__event-err { margin: 0 6px 4px 94px; font-size: 11px; color: #ff6b6b; }
.debug-panel__err {
  color: #ff6b6b; font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-block; max-width: 100%;
}

.debug-panel__transport {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
  background: #1b2330;
  color: #d9e1ea;
}
.debug-panel__transport--http { background: #1e3a5f; color: #8cc8ff; }
.debug-panel__transport--ws { background: #3a2a1e; color: #ffa94d; }

.debug-panel__name-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.debug-panel__name-tag--query { background: #14283f; color: #8cc8ff; border: 1px solid #1e3a5f; }
.debug-panel__name-tag--mutation { background: #2a1c3f; color: #c79bff; border: 1px solid #3f2a5a; }
.debug-panel__name-tag--subscription { background: #1c2a14; color: #9ece6a; border: 1px solid #2a3f1e; }
.debug-panel__name-tag--ws { background: #2a1c14; color: #ffa94d; border: 1px solid #3a2a1e; }

.debug-panel__phase {
  font-size: 10px; font-weight: 600;
  text-transform: lowercase; letter-spacing: 0.02em;
  white-space: nowrap; color: #6b7785;
}
.debug-panel__phase--ok { color: #9ece6a; }
.debug-panel__phase--err { color: #ff6b6b; }
.debug-panel__phase--data { color: #8cc8ff; }
.debug-panel__phase--muted { color: #6b7785; }

.debug-panel__payload {
  background: #0b1016; border: 1px solid #2a3340; border-top: none;
  padding: 8px 10px; margin: 0 6px 4px 28px;
  max-height: 240px; overflow: auto;
  white-space: pre-wrap; word-break: break-all;
  color: #b8c5d4; font: inherit;
}

.debug-panel__latency-stats {
  display: flex; gap: 24px; flex-wrap: wrap;
  margin-bottom: 10px; align-items: center;
}
.debug-panel__series { display: flex; gap: 8px; align-items: center; }
.debug-panel__swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.debug-panel__series--http .debug-panel__swatch { background: #4a9eff; }
.debug-panel__series--ws .debug-panel__swatch { background: #ffa94d; }
.debug-panel__stat-empty { color: #6b7785; }
.debug-panel__hint { color: #6b7785; margin-left: auto; }

.debug-panel__graph {
  width: 100%; height: 140px;
  background: #0b1016; border: 1px solid #2a3340;
  border-radius: 3px; margin-bottom: 10px;
}
.debug-panel__latency-samples { display: flex; flex-direction: column; gap: 1px; }
.debug-panel__sample { display: grid; grid-template-columns: 60px 1fr 1fr; gap: 8px; padding: 2px 6px; }
.debug-panel__sample--head { color: #6b7785; border-bottom: 1px solid #2a3340; padding-bottom: 4px; margin-bottom: 4px; }
.debug-panel__sample-http { color: #4a9eff; }
.debug-panel__sample-ws { color: #ffa94d; }
