/* ─── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0e0f11;
  --bg2:       #16181c;
  --bg3:       #1e2128;
  --border:    #2a2d35;
  --text:      #e8eaf0;
  --text-muted:#7a7f8e;
  --accent:    #c8f400;      /* neon lime */
  --accent2:   #86b000;
  --danger:    #ff4f4f;
  --radius:    8px;
  --transition:0.18s ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ─── Header ───────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 54px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.header-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.header-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0e0f11;
}

.header-tab__count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  text-align: center;
  font-size: 11px;
}

.logo-mark {
  font-size: 24px;
  color: var(--accent);
  line-height: 1;
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-total {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 14px;
}

.total-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.total-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ─── Bike type bar ─────────────────────────────────────────── */
.biketype-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 40px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
}

.biketype-bar::-webkit-scrollbar { display: none; }

.biketype-pill {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  flex-shrink: 0;
}

.biketype-pill:hover {
  border-color: var(--accent);
  color: var(--text);
}

.biketype-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* ─── Layout ───────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 220px 1fr 300px;
  height: calc(100vh - 94px);
  overflow: hidden;
}

/* ─── Shared panel styles ───────────────────────────────────── */
.panel-slots,
.panel-browser,
.panel-build {
  overflow-y: auto;
  overflow-x: hidden;
}

.panel-slots   { border-right: 1px solid var(--border); background: var(--bg2); }
.panel-browser { background: var(--bg); }
.panel-build   { border-left: 1px solid var(--border); background: var(--bg2); }

.panel-header {
  padding: 12px 16px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg2);
  z-index: 1;
}

.panel-header--tools {
  top: auto;
  position: relative;
  margin-top: 8px;
}

/* ─── Slot list ─────────────────────────────────────────────── */
.slot-list {
  padding: 6px 0;
}

.slot-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background var(--transition), border-color var(--transition);
  user-select: none;
}

.slot-item:hover {
  background: var(--bg3);
}

.slot-item.active {
  background: var(--bg3);
  border-left-color: var(--accent);
}

.slot-item.filled .slot-dot {
  background: var(--accent);
}

.slot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background var(--transition);
}

.slot-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.slot-price {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.slot-item--featured {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-left: 3px solid var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.slot-item--featured:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.slot-item--featured.active {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-left-color: var(--accent);
}

.slot-item--featured .slot-name {
  font-size: 13px;
  font-weight: 700;
}

.slot-item--nested {
  padding-left: 34px;
}

.slot-subgroup {
  margin: 2px 10px 8px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg3) 72%, transparent);
  overflow: hidden;
}

.slot-subgroup-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.slot-subgroup-toggle:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.slot-subgroup-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.slot-subgroup-label {
  font-size: 12px;
  font-weight: 700;
}

.slot-subgroup-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.slot-subgroup-chevron {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
}

.slot-subgroup-items {
  display: none;
  border-top: 1px solid var(--border);
  padding: 4px 0;
}

.slot-subgroup.expanded .slot-subgroup-items {
  display: block;
}

.slot-divider {
  padding: 14px 16px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ─── Product tags (bike_type / material) ───────────────────── */
.product-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0;
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.tag--modal {
  margin-right: 4px;
  margin-bottom: 8px;
  display: inline-block;
}

.tools-toggle {
  margin: 10px 16px;
  width: calc(100% - 32px);
  padding: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  transition: border-color var(--transition);
}

.tools-toggle:hover { border-color: var(--accent); }

/* ─── Browser toolbar ───────────────────────────────────────── */
.browser-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.browser-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

.browser-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 140px;
  padding: 7px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}

.search-input:focus { border-color: var(--accent); }

.filter-select {
  padding: 7px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.filter-select:focus { border-color: var(--accent); }

.stock-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.stock-toggle input { accent-color: var(--accent); }

/* ─── Product grid ──────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 16px;
}

.product-grid--garage {
  display: block;
  padding: 0;
}

.product-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), transform var(--transition);
  cursor: pointer;
}

.product-card:hover {
  border-color: var(--accent2);
  transform: translateY(-2px);
}

.product-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(200, 244, 0, 0.15);
}

.product-card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  padding: 8px;
}

.product-card__img-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--border);
}

.product-card__body {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-card__brand {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent2);
  font-weight: 600;
}

.product-card__name {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.variant-row {
  padding: 0 10px 8px;
}

.variant-select {
  width: 100%;
  padding: 6px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.variant-select:focus { border-color: var(--accent); }

.product-card__footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 10px;
}

.product-card__footer--tire {
  flex-wrap: wrap;
}

.product-card__footer--tire .btn[data-action="use-front"],
.product-card__footer--tire .btn[data-action="use-rear"],
.product-card__footer--tire .btn[data-action="use-both"] {
  flex: 1 1 calc(50% - 6px);
}

.btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity var(--transition), background var(--transition);
}

.btn:hover { opacity: 0.85; }

.btn--primary {
  background: var(--accent);
  color: #0e0f11;
  flex: 1;
}

.btn--secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--compact {
  padding: 6px 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.btn--danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn--muted {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn--full {
  flex: 1 1 100%;
}

/* ─── Empty state ───────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
}

.empty-icon {
  font-size: 48px;
  opacity: 0.2;
}

.empty-state--small {
  padding: 30px 16px;
  font-size: 12px;
}

/* ─── Build gallery ─────────────────────────────────────────── */
.build-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  background: var(--bg2);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat-na {
  color: var(--text-muted);
  font-size: 12px;
}

.build-actions {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.build-actions__btn {
  flex: 1;
}

.clear-btn {
  float: right;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  margin-top: -1px;
  transition: color var(--transition);
}

.clear-btn:hover { color: var(--danger); }

.build-gallery {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.render-panel {
  padding: 12px 10px 4px;
  border-bottom: 1px solid var(--border);
}

.render-label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.render-note {
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.render-select {
  width: 100%;
  margin-bottom: 10px;
}

.generate-bike-btn {
  width: 100%;
  padding: 10px 12px;
  background: linear-gradient(135deg, var(--accent), #f5ff87);
  color: #0e0f11;
  border: none;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform var(--transition), opacity var(--transition);
}

.generate-bike-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.generate-bike-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.render-status {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.render-result {
  margin-top: 10px;
}

.render-result__card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.render-result__img {
  display: block;
  width: 100%;
  background: #fff;
  cursor: zoom-in;
}

.render-result__actions {
  display: flex;
  gap: 8px;
  padding: 10px;
}

.render-result__actions a,
.render-result__actions button {
  flex: 1;
}

.garage-view {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding: 20px;
}

.garage-hero,
.garage-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.garage-hero {
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.garage-hero__title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.garage-hero__copy {
  color: var(--text-muted);
  max-width: 560px;
  font-size: 13px;
}

.garage-hero__stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.garage-pill {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  min-width: 92px;
}

.garage-pill--value {
  min-width: 136px;
}

.garage-pill__label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.garage-pill__value {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
}

.garage-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.garage-section__title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.garage-section__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.garage-section__body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.garage-bike-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg3);
}

.garage-bike-card__media {
  width: 84px;
  height: 84px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
  flex-shrink: 0;
}

.garage-bike-card__media--interactive {
  cursor: zoom-in;
}

.image-preview {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius);
}

.garage-bike-card__media-placeholder {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.garage-bike-card__body {
  flex: 1;
  min-width: 0;
}

.garage-bike-card__eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent2);
  margin-bottom: 4px;
}

.garage-bike-card__title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.garage-bike-card__meta {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.garage-bike-card__value {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.garage-bike-card__parts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.garage-bike-part {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--border);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.garage-bike-part:hover {
  border-color: var(--accent2);
}

.garage-bike-part__main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 4px 5px 8px;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
}

.garage-bike-part__main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.garage-bike-part__remove {
  width: 24px;
  height: 24px;
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 0 999px 999px 0;
}

.garage-bike-part__remove:hover {
  color: var(--danger);
}

.garage-bike-part__slot {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--accent2);
  white-space: nowrap;
}

.garage-bike-part__name {
  font-size: 11px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.garage-bike-card__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  min-width: 150px;
}

.garage-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: none;
  line-height: 1.4;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.garage-status--mounted {
  color: var(--accent);
  border-color: rgba(200, 244, 0, 0.35);
  background: rgba(200, 244, 0, 0.08);
}

.garage-status--loose {
  color: var(--text-muted);
}

.garage-item__meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.garage-item-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.garage-item-card__media {
  width: 72px;
}

.garage-item-card__img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
}

.garage-item-card__img-placeholder {
  width: 72px;
  height: 72px;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--border);
}

.garage-item-card__body {
  min-width: 0;
}

.garage-item-card__name-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.garage-item-card__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
  flex: 1;
}

.garage-qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(200, 244, 0, 0.12);
  border: 1px solid rgba(200, 244, 0, 0.28);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.garage-item-card__status {
  margin-top: 6px;
}

.garage-item-card__price {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.garage-item-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  min-width: 120px;
}

.garage-item-card__actions a,
.garage-item-card__actions button.btn {
  justify-content: center;
  text-align: center;
}

.garage-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.garage-picker__item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg3);
}

.garage-picker__img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
}

.garage-picker__img-placeholder {
  width: 72px;
  height: 72px;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--border);
}

.garage-picker__body {
  min-width: 0;
}

/* Build item card (horizontal) */
.build-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.build-item:hover { border-color: var(--accent2); }

.build-item__img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
  padding: 4px;
}

.build-item__img-placeholder {
  width: 64px;
  height: 64px;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--border);
  flex-shrink: 0;
}

.build-item__info {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
}

.build-item__slot {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.build-item__name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.build-item__variant {
  font-size: 11px;
  color: var(--accent2);
  font-weight: 500;
}

.build-item__price {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.build-item__actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  flex-shrink: 0;
}

.build-item__actions a,
.build-item__actions button.btn {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.build-item__actions a {
  background: var(--accent);
  color: #0e0f11;
  text-decoration: none;
}

.build-item__actions a:hover,
.build-item__actions button.btn:hover { opacity: 0.8; }

.build-item__remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: color var(--transition);
  padding: 2px 4px;
  align-self: center;
}

.build-item__remove:hover { color: var(--danger); }

/* ─── Tools section ─────────────────────────────────────────── */
.tools-section {
  border-top: 1px solid var(--border);
  padding-bottom: 16px;
}

.tools-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

/* ─── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: border-color var(--transition);
}

.modal-close:hover { border-color: var(--accent); }

.modal-content {
  padding: 24px;
}

.modal-img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.modal-brand {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent2);
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.modal-variant-row {
  margin-bottom: 4px;
}

.modal-variant-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions .btn {
  padding: 10px 20px;
  font-size: 13px;
}

.modal-choice-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.modal-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg3);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.modal-choice input {
  accent-color: var(--accent);
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Loading state ─────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

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

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

/* ─── Out of stock badge ─────────────────────────────────────── */
.badge-oos {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  html, body { overflow: auto; }
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .panel-slots { max-height: none; }
  .panel-build { max-height: none; }
  .header {
    height: auto;
    padding: 12px 16px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .header-nav,
  .build-actions,
  .garage-hero,
  .garage-section__header {
    flex-direction: column;
    align-items: stretch;
  }
  .garage-bike-card {
    grid-template-columns: 1fr;
  }
  .garage-bike-card__actions {
    flex-direction: row;
    min-width: 0;
  }
  .garage-item-card {
    grid-template-columns: 1fr;
  }
  .garage-item-card__media {
    width: 72px;
  }
  .garage-item-card__actions {
    min-width: 0;
  }
}

/* ─── Affiliate disclosure bar ─────────────────────────────── */
.affiliate-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 20px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.affiliate-bar__text {
  text-align: center;
}

.affiliate-bar__text strong {
  color: var(--text);
  font-weight: 600;
}

.affiliate-bar__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}

.affiliate-bar__close:hover {
  color: var(--text);
  background: var(--bg3);
}

.shared-preview-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 6px 0 0;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent, #3b82f6);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  pointer-events: none;
  animation: toast-in 0.2s ease, toast-out 0.3s ease 2.2s forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
