/* ============================================================
   GENERATOR.CSS — Invoice Generator Styles
   Job type cards, collapsible sections, line items, preview
   ============================================================ */

/* ---------- Generator Layout ---------- */
.generator-wrapper {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

.generator-container {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-6);
  max-width: var(--container-2xl);
  margin: 0 auto;
  padding: var(--space-6);
  position: relative;
}

@media (max-width: 1200px) {
  .generator-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .generator-container {
    padding: var(--space-3);
  }
}

/* ---------- Generator Hero Section ---------- */
.generator-hero {
  position: relative;
  padding: var(--space-12) 0 var(--space-6);
  text-align: center;
  overflow: hidden;
}

.generator-hero::before {
  content: '';
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.generator-hero h1 {
  margin-bottom: var(--space-4);
  position: relative;
}

.generator-hero p {
  font-size: var(--text-lg);
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* ---------- Job Type Selector ---------- */
.job-type-section {
  margin-bottom: var(--space-8);
}

.job-type-section h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.job-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3);
}

@media (max-width: 480px) {
  .job-type-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--space-2);
  }
}

.job-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-3);
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 110px;
}

.job-type-card:hover {
  border-color: var(--border-active);
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.job-type-card.selected {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: var(--accent-glow);
}

.job-type-card .jt-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  font-size: 28px;
  line-height: 1;
}

.job-type-card .jt-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.job-type-card .jt-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.3;
}

@media (max-width: 640px) {
  .job-type-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }
  .job-type-card {
    padding: var(--space-4) var(--space-2);
    min-height: 90px;
  }
}

/* ---------- Generator Form Sections ---------- */
.gen-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.gen-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.gen-section:hover {
  border-color: var(--border-default);
}

.gen-section.active {
  border-color: var(--border-active);
}

.gen-section.conditional-hidden {
  display: none;
}

.gen-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast);
}

.gen-section-header:hover {
  background: var(--bg-glass-hover);
}

.gen-section-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.gen-section-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chip-bg);
  border-radius: var(--border-radius-sm);
  color: var(--accent-primary);
  flex-shrink: 0;
}

.gen-section-icon svg {
  width: 16px;
  height: 16px;
}

.gen-section-title {
  font-size: var(--text-md);
  font-weight: 600;
}

.gen-section-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.gen-section-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.gen-section-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--success);
  background: var(--success-bg);
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
}

.gen-section-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.gen-section.open .gen-section-chevron {
  transform: rotate(180deg);
}

.gen-section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.gen-section.open .gen-section-body {
  max-height: 5000px;
}

.gen-section-content {
  padding: 0 var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ---------- Chip Select Component ---------- */
.chip-select {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chip-select-search {
  position: relative;
}

.chip-select-search input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-10);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.chip-select-search input::placeholder { color: var(--text-muted); }

.chip-select-search input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chip-select-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.chip-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: var(--z-dropdown);
  display: none;
}

.chip-select-dropdown.visible {
  display: block;
  animation: dropdownIn 0.2s ease;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.chip-select-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.chip-select-dropdown-item:hover {
  background: var(--bg-glass-hover);
}

.chip-select-dropdown-item.selected {
  color: var(--accent-primary);
}

.chip-select-dropdown-item .match-highlight {
  color: var(--accent-primary);
  font-weight: 600;
}

.chip-select-selected {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-height: 24px;
}

.chip-select-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip-select-more {
  font-size: var(--text-xs);
  color: var(--accent-primary);
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--chip-border);
  border-radius: var(--border-radius-full);
  transition: all var(--transition-fast);
}

.chip-select-more:hover {
  background: var(--chip-bg);
  border-color: var(--accent-primary);
}

/* ---------- Line Items Table ---------- */
.line-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.line-item-header {
  display: grid;
  grid-template-columns: 2fr 80px 80px 100px 100px 40px;
  gap: var(--space-3);
  padding: 0 var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.line-item-row {
  display: grid;
  grid-template-columns: 2fr 80px 80px 100px 100px 40px;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  transition: border-color var(--transition-fast);
  animation: rowIn 0.25s ease;
}

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

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

.line-item-row input,
.line-item-row select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.line-item-row input:focus,
.line-item-row select:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-input-focus);
}

.line-item-row .item-total {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--success);
  text-align: right;
  padding: var(--space-2) var(--space-3);
}

.line-item-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.line-item-remove:hover {
  background: var(--error-bg);
  color: var(--error);
}

.line-item-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px dashed var(--border-default);
  border-radius: var(--border-radius-md);
  color: var(--text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.line-item-add:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--chip-bg);
}

.line-item-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-2);
}

.line-item-presets .chip {
  font-size: var(--text-xs);
  padding: 4px var(--space-2);
}

@media (max-width: 768px) {
  .line-item-header {
    display: none;
  }
  .line-item-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .line-item-row input::placeholder {
    font-size: var(--text-xs);
  }
}

/* ---------- Totals Section ---------- */
.totals-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 400px;
  margin-left: auto;
}

.totals-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
}

.totals-row .label {
  color: var(--text-secondary);
}

.totals-row .value {
  font-family: var(--font-mono);
  font-weight: 600;
}

.totals-row.subtotal {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-3);
}

.totals-row.grand-total {
  border-top: 2px solid var(--accent-primary);
  padding-top: var(--space-4);
  font-size: var(--text-lg);
}

.totals-row.grand-total .value {
  color: var(--success);
  font-size: var(--text-xl);
}

.totals-input {
  width: 100px;
  text-align: right;
}

/* ---------- Scope of Work ---------- */
.scope-preview {
  padding: var(--space-4);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  margin-top: var(--space-3);
}

.scope-preview-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-2);
}

.scope-preview-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  white-space: pre-wrap;
}

.scope-edit-toggle {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--accent-primary);
  cursor: pointer;
}

.scope-edit-toggle:hover { text-decoration: underline; }

.scope-textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: var(--leading-relaxed);
  resize: vertical;
  margin-top: var(--space-2);
}

.scope-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ---------- Signature Pad ---------- */
.signature-area {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.signature-canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 160px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-default);
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

.signature-canvas-wrapper canvas {
  width: 100%;
  height: 100%;
}

.signature-canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  pointer-events: none;
}

.signature-actions {
  display: flex;
  gap: var(--space-2);
}

.signature-typed {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.signature-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

/* ---------- Live Preview Panel ---------- */
.preview-panel {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-6));
  height: calc(100vh - var(--nav-height) - var(--space-12));
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
}

.preview-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 2;
}

.preview-panel-header h3 {
  font-size: var(--text-md);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.preview-panel-actions {
  display: flex;
  gap: var(--space-2);
}

.preview-content {
  padding: var(--space-5);
}

/* ---------- Invoice Preview (inside the panel) ---------- */
.invoice-preview {
  background: white;
  color: #111;
  border-radius: var(--border-radius-md);
  padding: 32px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  transform-origin: top center;
}

.invoice-preview * {
  color: #111;
}

.inv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #6366f1;
}

.logo-upload-box {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: var(--space-4);
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.logo-upload-box:hover {
  border-color: var(--accent-primary);
  background: var(--bg-glass-hover);
}

.logo-upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}

.logo-upload-prompt svg {
  color: var(--accent-primary);
}

.logo-upload-prompt span {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.logo-upload-prompt small {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.logo-preview-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.logo-preview-wrapper img {
  max-height: 50px;
  max-width: 180px;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
  background: white;
  padding: 4px;
}

.logo-remove-btn {
  color: var(--error);
}

.inv-logo-container {
  margin-bottom: 8px;
}

.inv-logo {
  max-height: 55px;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.inv-company h2 {
  font-size: 18px;
  color: #6366f1;
  margin-bottom: 4px;
}

.inv-company p {
  font-size: 10px;
  color: #555;
  line-height: 1.5;
}

.inv-meta {
  text-align: right;
}

.inv-meta h3 {
  font-size: 22px;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.inv-meta-table {
  font-size: 10px;
}

.inv-meta-table td {
  padding: 2px 0;
}

.inv-meta-table td:first-child {
  color: #888;
  padding-right: 12px;
  text-align: right;
}

.inv-addresses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 20px;
}

.inv-addresses h4 {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 6px;
}

.inv-addresses p {
  font-size: 11px;
  color: #333;
  line-height: 1.5;
}

.inv-scope {
  background: #f8f8ff;
  border-left: 3px solid #6366f1;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 0 4px 4px 0;
}

.inv-scope h4 {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6366f1;
  margin-bottom: 6px;
}

.inv-scope p {
  font-size: 10px;
  color: #444;
  line-height: 1.6;
}

.inv-table {
  width: 100%;
  margin-bottom: 20px;
  border-collapse: collapse;
}

.inv-table-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6366f1;
  margin-bottom: 8px;
}

.inv-table thead th {
  background: #6366f1;
  color: white;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  text-align: left;
}

.inv-table thead th:last-child {
  text-align: right;
}

.inv-table tbody td {
  padding: 8px 10px;
  font-size: 10px;
  border-bottom: 1px solid #eee;
}

.inv-table tbody td:last-child {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.inv-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.inv-totals {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.inv-totals-table {
  width: 250px;
}

.inv-totals-table tr td {
  padding: 4px 0;
  font-size: 10px;
}

.inv-totals-table tr td:first-child {
  color: #888;
}

.inv-totals-table tr td:last-child {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.inv-totals-table tr.total-row {
  border-top: 2px solid #6366f1;
}

.inv-totals-table tr.total-row td {
  padding-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #6366f1;
}

.inv-footer {
  border-top: 1px solid #eee;
  padding-top: 12px;
  font-size: 9px;
  color: #888;
}

.inv-notes {
  margin-bottom: 12px;
}

.inv-notes h4 {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 4px;
}

.inv-notes p {
  font-size: 10px;
  color: #555;
}

.inv-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
  padding-top: 12px;
}

.inv-sig-line {
  border-top: 1px solid #ccc;
  padding-top: 8px;
}

.inv-sig-line p {
  font-size: 9px;
  color: #888;
}

.inv-sig-line img {
  max-height: 40px;
  margin-bottom: 4px;
}

/* ---------- Mobile Preview Button ---------- */
.mobile-preview-toggle {
  display: none;
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-sticky);
}

@media (max-width: 1200px) {
  .preview-panel {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--nav-height);
    border-radius: 0;
    z-index: var(--z-overlay);
    height: auto;
  }
  .preview-panel.mobile-open {
    display: block;
  }
  .mobile-preview-toggle {
    display: flex;
  }
}

/* ---------- Export Bar ---------- */
.export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  margin-top: var(--space-4);
}

@media (max-width: 640px) {
  .export-bar {
    padding: var(--space-3);
    gap: var(--space-2);
  }
  .export-bar .btn {
    flex: 1 1 calc(50% - var(--space-2));
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-3);
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .export-bar .btn {
    flex: 1 1 100%;
  }
}

.export-bar-title {
  width: 100%;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

/* ---------- Checkbox / Radio styled as toggle ---------- */
.check-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.check-item:hover {
  background: var(--bg-glass-hover);
}

.check-item input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-default);
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.check-item input[type="checkbox"]:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.check-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.check-item label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

/* ---------- Same-as-property toggle ---------- */
.same-address-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
  cursor: pointer;
}

.same-address-toggle input {
  accent-color: var(--accent-primary);
}

/* ---------- Quick Add Presets ---------- */
.line-item-presets-container {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
}

.line-item-presets-container h4 {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-3);
}

.line-item-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.line-item-presets .chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  padding: var(--space-1-5) var(--space-3);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--border-radius-full);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.line-item-presets .chip:hover {
  background: var(--bg-input-focus);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

/* ---------- Multi-Photo Upload Thumbnails ---------- */
.photo-thumb-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  aspect-ratio: 1;
  background: var(--bg-tertiary);
}

.photo-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-thumb-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.75);
  color: #ff4d4d;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
}

.photo-thumb-delete:hover {
  background: #dc2626;
  color: white;
  transform: scale(1.1);
}

/* ---------- Visual Generator Architecture Section ---------- */
.generator-guide-section {
  padding: var(--space-16) 0;
  position: relative;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
}

.guide-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.guide-step-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-xl);
  padding: var(--space-6);
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.guide-step-card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.guide-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.guide-step-num {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--accent-primary);
  opacity: 0.9;
}

.guide-step-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  padding: 4px 10px;
  border-radius: var(--border-radius-full);
}

.guide-step-card h3 {
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin: 0;
}

.guide-step-card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
}

.guide-step-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-2);
}

.guide-tag {
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.flow-diagram-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-xl);
  padding: var(--space-8);
  margin-top: var(--space-10);
}

.flow-diagram-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.flow-diagram-header h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.flow-nodes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.flow-node {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: var(--space-4) var(--space-5);
  text-align: center;
  min-width: 140px;
}

.flow-node-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.flow-node-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.flow-arrow {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

