/* Parts Grid & Category Cards */
.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2.2rem;
  width: 100%;
  min-width: 0;
}

.part-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  min-width: 0;
}

.part-card.is-populated {
  border-color: var(--border-populated);
  box-shadow: 0 8px 24px -6px rgba(56, 189, 248, 0.14);
}

.part-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.part-title-group { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.part-icon { width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--radius-md); background: var(--bg-elevated); display: grid; place-items: center; font-size: 1.1rem; }
.part-label { font-size: 0.95rem; font-weight: 700; }
.part-badge { display: inline-block; font-size: 0.68rem; color: var(--accent-cyan); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

.retail-link-btn { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.74rem; font-weight: 600; padding: 0.35rem 0.65rem; border-radius: var(--radius-sm); background: rgba(251, 191, 36, 0.14); color: var(--accent-amber); border: 1px solid rgba(251, 191, 36, 0.38); text-decoration: none; transition: all 0.15s ease; white-space: nowrap; }
.retail-link-btn:hover:not(.is-disabled) { background: var(--accent-amber); color: #060911; }
.retail-link-btn.is-disabled { background: var(--bg-input); color: var(--text-muted); border-color: var(--border-subtle); pointer-events: none; opacity: 0.6; }

.part-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; width: 100%; min-width: 0; }
.field-group { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.field-group.full-span { grid-column: 1 / -1; }
.field-label { font-size: 0.7rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.field-input { width: 100%; min-width: 0; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.84rem; padding: 0.48rem 0.6rem; outline: none; transition: border-color 0.15s ease; }
.field-input:focus { border-color: var(--border-focus); }
.price-input-wrap { position: relative; display: flex; align-items: center; }
.currency-prefix { position: absolute; left: 0.6rem; color: var(--text-secondary); font-size: 0.84rem; pointer-events: none; }
.price-input { padding-left: 1.45rem; }

/* Sub-section Divider */
.locker-subsection-title { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; font-size: 1.05rem; font-weight: 700; color: var(--accent-cyan); margin: 0.5rem 0 0.85rem; }
.locker-subsection-pill { font-size: 0.72rem; background: var(--bg-elevated); color: var(--text-secondary); padding: 0.18rem 0.55rem; border-radius: 999px; border: 1px solid var(--border-subtle); }

/* Tailored Build Guide Section */
.guide-section { border-top: 1px solid var(--border-subtle); padding-top: 1.75rem; width: 100%; min-width: 0; }
.guide-progress-card { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 0.85rem 1.1rem; margin-bottom: 1.35rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.85rem; }
.progress-track { flex: 1; min-width: 180px; height: 10px; background: var(--bg-input); border-radius: 999px; overflow: hidden; border: 1px solid var(--border-subtle); }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald)); transition: width 0.25s ease; }
.guide-steps-list { display: flex; flex-direction: column; gap: 1.25rem; width: 100%; min-width: 0; }
.guide-step-card { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.3rem; transition: border-color 0.2s ease; width: 100%; min-width: 0; overflow: hidden; }
.guide-step-card.is-completed { border-color: rgba(52, 211, 153, 0.45); background: rgba(17, 24, 39, 0.65); }
.guide-step-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.9rem; }
.step-check-label { display: inline-flex; align-items: center; gap: 0.55rem; cursor: pointer; }
.step-checkbox { width: 18px; height: 18px; accent-color: var(--accent-emerald); cursor: pointer; }
.step-number-badge { background: var(--bg-elevated); color: var(--accent-cyan); font-size: 0.76rem; font-weight: 700; padding: 0.25rem 0.6rem; border-radius: var(--radius-sm); border: 1px solid rgba(56, 189, 248, 0.3); }
.step-heading-wrap { flex: 1; min-width: 210px; }
.step-phase-tag { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent-indigo); font-weight: 600; }
.step-title { font-size: 1.08rem; font-weight: 700; }
.step-parts-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.step-part-pill { font-size: 0.73rem; background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-secondary); padding: 0.2rem 0.55rem; border-radius: 999px; }

.step-instructions { margin: 0 0 0.95rem 1.2rem; color: var(--text-primary); display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.92rem; }
.step-instructions strong { color: var(--accent-cyan); }
.step-instructions kbd { background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 0.08rem 0.38rem; font-size: 0.78rem; }

/* Hardware-Specific Warning Callout */
.hardware-warning-box { display: flex; align-items: flex-start; gap: 0.65rem; background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.38); border-left: 4px solid var(--accent-amber); border-radius: var(--radius-md); padding: 0.75rem 0.95rem; margin-bottom: 1rem; font-size: 0.85rem; color: #fde68a; width: 100%; }
.warning-icon { font-size: 1.05rem; line-height: 1.2; flex-shrink: 0; }

/* Full-Width Stack for Phase 2 SVG Blueprint & Phase 3 Video Tip Drawer (No Squishing) */
.phase-placeholders-grid { display: flex; flex-direction: column; gap: 0.95rem; width: 100%; min-width: 0; }
.slot-pill { font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: var(--radius-sm); }
.phase-2-pill { background: rgba(56, 189, 248, 0.14); color: var(--accent-cyan); }
.phase-3-pill { background: rgba(129, 140, 248, 0.16); color: var(--accent-indigo); }

/* Modal & Toast */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(5, 8, 15, 0.8); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 0.85rem; }
.modal-card { width: 100%; max-width: 700px; background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-card); }
.paste-textarea { width: 100%; min-height: 200px; margin: 0.8rem 0; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); color: var(--text-primary); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.8rem; padding: 0.75rem; resize: vertical; }
.modal-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.65rem; }
.toast-banner { position: fixed; bottom: 1.2rem; right: 1.2rem; left: 1.2rem; max-width: 420px; margin-left: auto; z-index: 60; background: var(--bg-elevated); border: 1px solid var(--accent-cyan); color: var(--text-primary); padding: 0.75rem 1rem; border-radius: var(--radius-md); font-size: 0.85rem; box-shadow: var(--shadow-card); opacity: 0; transform: translateY(10px); pointer-events: none; transition: all 0.2s ease; }
.toast-banner.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
  .parts-grid { grid-template-columns: 1fr; gap: 0.9rem; }
  input, textarea, select, .field-input, .paste-textarea { font-size: 16px !important; }
  .guide-step-card, .part-card { padding: 0.95rem; }
  .step-heading-wrap { min-width: 100%; }
}

@media (max-width: 480px) {
  .part-form-grid { grid-template-columns: 1fr; }
  .step-instructions { margin-left: 1rem; font-size: 0.87rem; }
}
