/* ============================================================
   Beyblade X 零件倉庫 - Stylesheet
   Dark theme with type color coding
   ============================================================ */

:root {
  --bg-base: #0a0e1a;
  --bg-card: #131826;
  --bg-card-hover: #1a2030;
  --bg-input: #1a2032;
  --bg-tab: #1a1f2e;
  --border: #2a3142;
  --border-light: #3a4152;
  --text-primary: #e8eaf0;
  --text-secondary: #8a92a8;
  --text-muted: #5a6378;
  --accent: #00d4ff;
  --accent-dim: #00a4cc;
  --warn: #ffaa00;
  --error: #ff4444;

  /* Type colors */
  --type-attack: #ff4444;
  --type-defense: #4488ff;
  --type-stamina: #44dd66;
  --type-balance: #ffdd44;

  /* Line colors */
  --line-bx: #6c7a89;
  --line-ux: #b8860b;
  --line-cx: #9933ff;
  --line-bxh: #ff6b35;
  --line-bxg: #00bfff;

  --shadow: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.6);
  --radius: 10px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, "Segoe UI", "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 0.9em;
  color: var(--accent);
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  background: linear-gradient(180deg, #131826 0%, #0a0e1a 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 32px;
  line-height: 1;
}

.brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.header-stats {
  display: flex;
  gap: 16px;
}

.stat {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  text-align: center;
  min-width: 70px;
}

.stat-num {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* TABS */
.tabs {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

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

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

/* ============================================================
   MAIN
   ============================================================ */
.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-header {
  margin-bottom: 24px;
}

.panel-header h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

.panel-sub {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

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

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.chip.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   SERIES GRID (Catalog)
   ============================================================ */
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.series-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.series-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.series-card.owned {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.series-img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: radial-gradient(circle, #2a3142 0%, transparent 70%);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: block;
}

.series-img-placeholder {
  width: 100%;
  height: 140px;
  background: radial-gradient(circle, #2a3142 0%, transparent 70%);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.4;
}

.add-btn {
  width: 100%;
  margin-top: 10px;
  background: var(--accent);
  color: #000;
  border: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.add-btn:hover {
  background: var(--accent-dim);
}

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

.add-btn.remove:hover {
  background: rgba(255, 68, 68, 0.15);
  border-color: var(--error);
  color: var(--error);
}

.series-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.series-code {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.series-line {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  color: #000;
}

.line-BX  { background: var(--line-bx); }
.line-UX  { background: var(--line-ux); }
.line-CX  { background: var(--line-cx); color: #fff; }
.line-BXH { background: var(--line-bxh); }
.line-BXG { background: var(--line-bxg); }

.series-name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.series-tw {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.series-parts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.series-part-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.part-label {
  color: var(--text-muted);
  font-size: 11px;
  min-width: 70px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.part-value {
  color: var(--text-primary);
  font-weight: 500;
}

.owned-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.series-meta {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
}

.type-Attack  { background: var(--type-attack); }
.type-Defense { background: var(--type-defense); }
.type-Stamina { background: var(--type-stamina); color: #000; }
.type-Balance { background: var(--type-balance); color: #000; }

.rotation-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ============================================================
   INVENTORY
   ============================================================ */
.inventory-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.section-header-row h3 { margin-bottom: 4px; }

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.collapsible details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.collapsible summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.collapsible summary::-webkit-details-marker {
  display: none;
}

.collapsible summary::before {
  content: "▶";
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.collapsible details[open] summary::before {
  transform: rotate(90deg);
}

.collapsible summary h3 {
  margin: 0;
}

.collapsible .inventory-subsection {
  margin-top: 20px;
  margin-left: 16px;
}

.collapsible .inventory-subsection h4 {
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

/* Owned Series Grid */
.owned-series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.owned-series-card {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  gap: 12px;
  transition: all 0.2s;
}

.owned-series-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.owned-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  background: radial-gradient(circle, #2a3142 0%, transparent 70%);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.owned-img-placeholder {
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, #2a3142 0%, transparent 70%);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  opacity: 0.4;
}

.owned-info {
  flex: 1;
  min-width: 0;
}

.owned-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.owned-header .series-code {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.owned-header .series-line {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
}

.owned-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.owned-tw {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.owned-parts-mini {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.remove-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.remove-btn:hover {
  background: rgba(255, 68, 68, 0.15);
  border-color: var(--error);
  color: var(--error);
}

.inv-stat {
  text-align: center;
  padding: 12px 8px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.inv-stat-num {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.inv-stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.inventory-section {
  margin-bottom: 32px;
}

.inventory-section h3 {
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.inventory-section h3 .count {
  color: var(--accent);
  font-weight: 700;
}

.inventory-section .hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.part-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: radial-gradient(circle, #2a3142 0%, transparent 70%);
  border-radius: 4px;
  flex-shrink: 0;
}

.part-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.part-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.part-card.owned {
  background: rgba(0, 212, 255, 0.08);
  border-color: var(--accent);
}

.part-card.owned .part-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.part-card.owned .part-check::after {
  content: "✓";
  color: #000;
  font-weight: 700;
  font-size: 14px;
}

.part-check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-light);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.part-info {
  flex: 1;
  min-width: 0;
}

.part-id {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.part-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.part-type {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  color: #fff;
}

.part-type-Attack  { background: var(--type-attack); }
.part-type-Defense { background: var(--type-defense); }
.part-type-Stamina { background: var(--type-stamina); color: #000; }
.part-type-Balance { background: var(--type-balance); color: #000; }

.part-card.owned .part-id {
  color: var(--accent);
}

.bulk-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ============================================================
   COMBO BUILDER
   ============================================================ */
.combo-builder {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.combo-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.combo-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 140px;
  align-self: start;
}

.combo-preview h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.preview-content {
  font-size: 14px;
}

.preview-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.preview-line:last-child {
  border-bottom: none;
}

.preview-label {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.preview-value {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.preview-empty {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 20px 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row:has(textarea) {
  grid-template-columns: 1fr;
}

.form-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.form-row input,
.form-row select,
.form-row textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row textarea {
  resize: vertical;
  min-height: 70px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.combo-list-section {
  margin-top: 24px;
}

.combo-list-section h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.combo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.combo-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: relative;
}

.combo-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.combo-item-name {
  font-size: 16px;
  font-weight: 700;
}

.combo-item-actions {
  display: flex;
  gap: 4px;
}

.combo-item-actions button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.combo-item-actions button:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.combo-item-actions button.delete:hover {
  background: rgba(255, 68, 68, 0.2);
  border-color: var(--error);
  color: var(--error);
}

.combo-item-parts {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.combo-item-parts span {
  display: inline-block;
  margin-right: 8px;
  color: var(--text-secondary);
}

.combo-item-notes {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-input);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ============================================================
   EXPORT
   ============================================================ */
.export-options {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.export-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.export-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
}

.export-preview h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.markdown-preview {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-primary);
  overflow-x: auto;
  max-height: 600px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 800px;
}

.about-content h3 {
  margin-top: 24px;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 17px;
}

.about-content h3:first-child {
  margin-top: 0;
}

.about-content p,
.about-content ul {
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 10px;
}

.about-content ul {
  padding-left: 22px;
}

.about-content li {
  margin-bottom: 4px;
}

.code-block {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  margin: 8px 0 12px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
}

.btn-secondary {
  background: transparent;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  z-index: 1000;
  font-size: 14px;
  max-width: 360px;
  animation: slideIn 0.3s ease;
}

.toast.error { border-color: var(--error); }
.toast.success { border-color: var(--accent); }

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 48px;
}

.footer-sub {
  margin-top: 6px;
  color: var(--text-muted);
}

.footer-sub a {
  color: var(--text-secondary);
  margin: 0 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .combo-builder {
    grid-template-columns: 1fr;
  }
  .combo-preview {
    position: static;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .header-stats {
    gap: 8px;
  }
  .stat {
    min-width: 56px;
    padding: 6px 10px;
  }
  .stat-num {
    font-size: 18px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .brand h1 { font-size: 17px; }
  .tab { padding: 10px 14px; font-size: 13px; }
  .app-main { padding: 20px 14px; }
  .panel-header h2 { font-size: 22px; }
  .series-grid { grid-template-columns: 1fr; }
  .parts-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
