/* ===== BUILDER LAYOUT - Three Panel ===== */
.builder-layout {
  display: grid;
  grid-template-columns: 220px 1fr 1fr;
  gap: 0;
  max-width: 100%;
  margin: 0;
  min-height: calc(100vh - var(--header-height) - 32px);
  position: relative;
}

/* ===== SIDEBAR ===== */
.builder-sidebar {
  background: var(--color-bg-card);
  border-right: 1px solid var(--color-border);
  padding: var(--space-4) 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: sticky;
  top: calc(var(--header-height) + 16px);
  height: calc(100vh - var(--header-height) - 32px);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: var(--space-2);
}

.sidebar-brand {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-md);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--space-2);
  flex: 1;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-item:hover {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

.sidebar-item.active {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--color-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sidebar-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.sidebar-label {
  flex: 1;
}

.sidebar-check {
  color: var(--color-success);
  font-size: 14px;
  font-weight: var(--font-weight-bold);
}

.sidebar-item.completed { cursor: pointer; }
.sidebar-item.completed .sidebar-label { color: var(--color-success); }
.sidebar-item.completed svg { color: var(--color-success); }

/* Sidebar Progress */
.sidebar-progress {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border-light);
  margin-top: auto;
}

.sidebar-progress-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}

.sidebar-progress-bar {
  height: 6px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-1);
}

.sidebar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.sidebar-progress-pct {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: var(--z-modal-backdrop);
}

/* ===== FORM PANEL ===== */
.builder-form {
  padding: var(--space-6);
}

.progress-header {
  display: none;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
}

.mobile-sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  padding: 8px;
  border-radius: var(--radius-md);
  color: var(--color-text);
  cursor: pointer;
}

.progress-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
}

.progress-bar-track {
  flex: 1;
  height: 6px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.progress-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  white-space: nowrap;
}

/* Section Content Card */
.section-content-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  animation: fadeUp 0.3s ease;
}

.section-card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--space-5);
  color: var(--color-text);
}

.section-divider {
  height: 1px;
  background: var(--color-border-light);
  margin: var(--space-5) 0;
}

/* ===== PREVIEW PANEL ===== */
.builder-preview {
  background: #f5f5f7;
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: calc(var(--header-height) + 16px);
  height: calc(100vh - var(--header-height) - 32px);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-card);
}

.preview-toolbar-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.zoom-controls {
  display: flex;
  gap: 4px;
}

.zoom-btn {
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.zoom-btn:hover {
  background: var(--color-primary-subtle);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.zoom-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.preview-stage {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-6);
  overflow-y: auto;
}

.a4-paper {
  width: 595px;
  min-height: 842px;
  background: white;
  box-shadow: 0 2px 20px rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.06);
  border-radius: 4px;
  padding: 40px;
  transform-origin: top center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.preview-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-card);
  display: flex;
  gap: var(--space-2);
}

/* ===== RESUME PREVIEW (inside A4) ===== */
.resume-preview {
  font-size: 10pt;
  line-height: 1.5;
  color: #1E293B;
}

.resume-preview .resume-header {
  margin-bottom: 16px;
}

.resume-preview .resume-name {
  font-size: 18pt;
  font-weight: 700;
  margin: 0 0 4px;
  color: #1E293B;
}

.resume-preview .resume-contact {
  font-size: 9pt;
  color: #64748B;
  margin-bottom: 2px;
}

.resume-preview .resume-contact a {
  color: var(--color-primary);
}

.resume-preview .resume-target-role {
  font-size: 10pt;
  color: var(--color-primary);
  font-weight: 500;
  margin: 4px 0;
}

.resume-preview .resume-section {
  margin-bottom: 12px;
}

.resume-preview .section-title {
  font-size: 10pt;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 6px;
  padding-bottom: 3px;
  border-bottom: 1.5px solid var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.resume-preview .resume-item {
  margin-bottom: 8px;
}

.resume-preview .resume-item strong {
  font-weight: 600;
}

.resume-preview .resume-meta {
  font-size: 9pt;
  color: #64748B;
}

.resume-preview .resume-desc {
  font-size: 9pt;
  margin: 3px 0 0;
  color: #475569;
}

.resume-preview .resume-skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.resume-preview .resume-skill-tag {
  font-size: 9pt;
  padding: 1px 8px;
  background: #F1F5F9;
  border-radius: 3px;
  color: #475569;
}

/* Template: Classic */
.template-classic .resume-header {
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-primary);
  margin-bottom: 16px;
}

.template-classic .resume-name {
  font-size: 20pt;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.template-classic .section-title {
  border-bottom-width: 2px;
}

/* Template: Modern */
.template-modern .resume-name {
  color: var(--color-secondary);
}

.template-modern .section-title {
  color: var(--color-secondary);
  border-bottom-color: var(--color-secondary);
  padding-left: 8px;
  border-left: 3px solid var(--color-secondary);
  border-bottom: none;
  padding-bottom: 0;
}

/* Template: Compact */
.template-compact {
  font-size: 9pt;
}

.template-compact .resume-name {
  font-size: 16pt;
}

.template-compact .section-title {
  font-size: 9pt;
}

/* ===== FORM ELEMENTS ===== */
.field-group {
  margin-bottom: var(--space-4);
}

.field-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.label-hint {
  font-weight: var(--font-weight-normal);
  color: var(--color-text-tertiary);
  text-transform: none;
  letter-spacing: normal;
  font-size: var(--font-size-xs);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 11px 14px;
  font-size: var(--font-size-sm);
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg-glass);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--color-primary);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.6;
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  margin-top: var(--space-1);
  line-height: 1.4;
}

.dynamic-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-4);
}

.dynamic-row > .field-group {
  margin-bottom: 0;
}

/* ===== CHIPS ===== */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--space-2) 0;
}

.chip {
  padding: 6px 14px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  background: var(--color-bg-glass);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.chip:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

.chip.selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(67,97,238,0.2);
}

/* ===== YES/NO CARD ===== */
.yesno-card {
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  animation: fadeUp 0.3s ease;
}

.yesno-question {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--space-4);
  color: var(--color-text);
}

.yesno-btns {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

/* ===== SKILLS ===== */
.skill-category {
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  transition: border-color var(--transition-fast);
}

.skill-category:hover {
  border-color: var(--color-border-dark);
}

.skill-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.skill-category-label {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  min-height: 28px;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: var(--font-size-xs);
  background: var(--color-primary-subtle);
  color: var(--color-primary-dark);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
}

.skill-tag .skill-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  border-radius: var(--radius-full);
  padding: 0;
  font-size: 10px;
  line-height: 1;
}

.skill-tag .skill-tag-remove:hover {
  background: var(--color-primary);
  color: white;
}

.skill-input-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.skill-input-row .form-input {
  flex: 1;
}

/* ===== EDUCATION CARDS ===== */
.edu-card {
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.edu-card:hover {
  border-color: var(--color-border-dark);
}

.edu-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
}

.edu-card-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.edu-card-remove {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.edu-card-remove:hover {
  background: var(--color-error-light);
  color: var(--color-error);
}

.edu-card-body {
  padding: var(--space-4);
}

/* ===== ENTRY ITEMS (Projects, Experience) ===== */
.entry-item {
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  transition: all var(--transition-fast);
}

.entry-item:hover {
  border-color: var(--color-border-dark);
}

.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
}

.entry-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.entry-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-size: 14px;
}

.entry-action-btn:hover {
  background: var(--color-error-light);
  color: var(--color-error);
}

.entry-body .dynamic-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ===== DESCRIPTION PREVIEW ===== */
.desc-preview {
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-top: var(--space-2);
}

.desc-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-2);
  line-height: 1.5;
}

.desc-actions {
  display: flex;
  gap: var(--space-2);
}

/* Fresher card */
.fresher-card {
  background: linear-gradient(135deg, var(--color-primary-subtle), var(--color-secondary-light));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
}

.fresher-text {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--space-2);
  color: var(--color-text);
}

.fresher-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
}

/* ===== OBJECTIVE BOX ===== */
.objective-box {
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.objective-text {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  margin: 0 0 var(--space-3);
  line-height: 1.6;
}

.objective-actions {
  display: flex;
  gap: var(--space-2);
}

/* ===== ADD BUTTON ===== */
.btn-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  color: var(--color-primary);
  background: var(--color-primary-subtle);
  border: 1.5px dashed var(--color-primary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
}

.btn-add:hover {
  background: rgba(67,97,238,0.14);
  border-style: solid;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(67,97,238,0.12);
}

/* ===== SETTINGS: TEMPLATE GRID SMALL ===== */
.template-grid-sm {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.tmpl-card {
  background: var(--color-bg-glass);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tmpl-card:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
}

.tmpl-card.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.tmpl-card-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.tmpl-card-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

.zoom-options {
  display: flex;
  gap: var(--space-2);
}

/* ===== EMPTY PREVIEW ===== */
.empty-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
}

.empty-preview-icon {
  width: 64px;
  height: 64px;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.empty-preview-title {
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

.empty-preview-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  margin: 0;
  max-width: 260px;
  line-height: 1.6;
}

/* ===== AI SUGGESTION CARD ===== */
.ai-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  animation: fadeIn 0.2s ease;
}

.ai-suggestion-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.15);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: all 0.3s ease;
}

.ai-suggestion-card.visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.ai-suggestion-icon {
  font-size: 28px;
  margin-bottom: var(--space-3);
}

.ai-suggestion-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.ai-suggestion-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}

.ai-suggestion-text {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  line-height: 1.6;
  padding: var(--space-3);
  background: var(--color-primary-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.ai-original-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.ai-suggestion-original {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  line-height: 1.5;
  padding: var(--space-2);
  background: var(--color-bg-glass);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  text-decoration: line-through;
}

.ai-suggestion-meta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.ai-benefit {
  font-size: var(--font-size-xs);
  color: var(--color-success);
  font-weight: var(--font-weight-medium);
}

.ai-divider {
  height: 1px;
  background: var(--color-border-light);
  margin-bottom: var(--space-4);
}

.ai-suggestion-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}

/* ===== WIZARD NAV (Mobile) ===== */
.builder-wizard-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: var(--color-bg-card);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}

.wizard-step-indicator {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-tertiary);
  white-space: nowrap;
  text-align: center;
  flex-shrink: 0;
}

.wizard-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 20px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-heading);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-bg-glass);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 90px;
  justify-content: center;
}

.wizard-nav-btn:hover:not(:disabled) {
  background: var(--color-bg-glass-hover);
  border-color: var(--color-border-dark);
}

.wizard-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.wizard-nav-btn.primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-primary);
}

.wizard-nav-btn.primary:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(67,97,238,0.35);
  transform: translateY(-1px);
}

/* Wizard progress dots */
.wizard-dots {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: var(--space-2) var(--space-4) 0;
}

.wizard-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border);
  transition: all var(--transition-fast);
}

.wizard-dot.active {
  background: var(--color-primary);
  width: 20px;
  border-radius: 3px;
}

.wizard-dot.done {
  background: var(--color-success);
}

/* ===== AI INLINE REVIEW CARD ===== */
.ai-review-card {
  background: linear-gradient(135deg, rgba(67,97,238,0.06), rgba(124,58,237,0.06));
  border: 1px solid rgba(67,97,238,0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  animation: slideUp 0.3s ease;
  position: relative;
}

.ai-review-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.ai-review-card-icon {
  font-size: 18px;
}

.ai-review-card-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.ai-review-card-body {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  padding: var(--space-3);
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.ai-review-card-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  flex-wrap: wrap;
}

.ai-review-card-actions .btn {
  font-size: var(--font-size-xs);
  padding: 6px 14px;
}

/* ===== AUTOSAVE INDICATOR ===== */
.autosave-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-tertiary);
  transition: all var(--transition-fast);
}

.autosave-indicator.saving {
  color: var(--color-primary);
}

.autosave-indicator.saved {
  color: var(--color-success);
}

.autosave-indicator.error {
  color: var(--color-error);
}

.autosave-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(67,97,238,0.15);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.autosave-indicator.saved .autosave-spinner {
  border-color: var(--color-success);
  animation: none;
}

/* ===== OFFLINE BANNER ===== */
.offline-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-warning);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-align: center;
}

.offline-banner.visible {
  display: flex;
}

/* ===== LOADING SHIMMER SECTIONS ===== */
.section-loading {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
}

.section-loading .skeleton-line {
  height: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--color-border-light) 25%, var(--color-border) 50%, var(--color-border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.section-loading .skeleton-line:nth-child(1) { width: 60%; }
.section-loading .skeleton-line:nth-child(2) { width: 90%; }
.section-loading .skeleton-line:nth-child(3) { width: 75%; }
.section-loading .skeleton-line:nth-child(4) { width: 45%; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.fade-in {
  animation: fadeUp 0.3s ease;
}

.slide-up {
  animation: slideUp 0.35s ease-out both;
}

/* Mobile Preview Base Styles (Hidden on Desktop) */
.mobile-preview-fab {
  display: none;
}

.mobile-preview-close {
  display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .builder-layout {
    grid-template-columns: 200px 1fr 1fr;
  }

  .a4-paper {
    width: 500px;
    min-height: 707px;
    padding: 30px;
  }
}

@media (max-width: 1024px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }

  .builder-sidebar {
    display: none;
  }

  .builder-sidebar.open {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: var(--z-dropdown);
    width: 280px;
    border-radius: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .main-content {
    padding-bottom: 72px;
  }

  .builder-form {
    max-height: none;
    overflow-y: visible;
    padding: var(--space-4);
    padding-bottom: 80px;
  }

  .progress-header {
    display: flex;
  }

  .mobile-sidebar-toggle {
    display: none;
  }

  .builder-wizard-nav {
    display: flex;
  }

  .builder-preview {
    display: none;
  }

  .builder-preview.mobile-open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.5);
    height: 100vh;
    width: 100vw;
    border: none;
    flex-direction: column;
  }

  .builder-preview.mobile-open .preview-toolbar {
    background: var(--color-bg-card);
    padding: var(--space-3) var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    border-bottom: 1px solid var(--color-border);
  }

  .builder-preview.mobile-open .preview-stage {
    flex: 1;
    overflow: auto;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: #f5f5f7;
  }

  .builder-preview.mobile-open .a4-paper {
    margin: 0 auto var(--space-4);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform-origin: top center;
  }

  .mobile-preview-fab {
    display: flex;
    position: fixed;
    bottom: 96px;
    right: 20px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 20px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
    z-index: 99;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-preview-fab:active {
    transform: scale(0.95);
  }

  .mobile-preview-close {
    display: block;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    margin-left: auto;
  }

  .a4-paper {
    width: 100%;
    max-width: 595px;
    min-height: auto;
    padding: 24px;
    transform: none !important;
    background: #ffffff;
    box-sizing: border-box;
  }

  .builder-preview.mobile-open .zoom-controls {
    display: none;
  }
}

@media (max-width: 640px) {
  .builder-form {
    padding: var(--space-3);
    padding-bottom: 76px;
  }

  .section-content-card {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
  }

  .dynamic-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .template-grid-sm {
    grid-template-columns: 1fr;
  }

  .yesno-btns {
    flex-direction: column;
  }

  .ai-suggestion-card {
    margin: var(--space-4);
    padding: var(--space-4);
  }

  .ai-suggestion-actions {
    flex-direction: column;
  }

  .builder-wizard-nav {
    padding: var(--space-2) var(--space-3);
  }

  .wizard-nav-btn {
    padding: 8px 14px;
    min-width: 72px;
    font-size: var(--font-size-xs);
  }
}

/* ===== PRINT ===== */
@media print {
  .builder-sidebar,
  .builder-form,
  .preview-toolbar,
  .preview-footer,
  .header,
  .footer {
    display: none !important;
  }

  .builder-layout {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .builder-preview {
    position: static;
    border: none;
    background: white;
  }

  .preview-stage {
    padding: 0;
    max-height: none;
  }

  .a4-paper {
    box-shadow: none;
    padding: 0;
    transform: none !important;
  }

  .resume-preview {
    padding: 0;
  }
}

