/* =============================================
   CV-skaparen 2 — Form components
   ============================================= */

/* === Field wrapper === */
.cv2-field {
  margin-bottom: var(--space-4);
}

.cv2-field:last-child {
  margin-bottom: 0;
}

.cv2-label {
  display: block;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body);
  color: var(--color-text-heading);
  margin-bottom: var(--space-2);
}

.cv2-field-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: var(--space-1);
}

/* === Text input (v2 dashed style) === */
.cv2-input {
  width: 100%;
  background: var(--color-bg-page);
  border: 2px dashed rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  color: var(--color-text-primary);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  line-height: var(--line-height-normal);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.cv2-input:hover {
  border-color: rgba(var(--color-primary-rgb), 0.4);
  background: rgba(var(--color-primary-rgb), 0.02);
}

.cv2-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.03);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.08);
}

.cv2-input::placeholder {
  color: var(--color-text-muted);
}

/* === Textarea (v2 dashed style) === */
.cv2-textarea {
  width: 100%;
  background: var(--color-bg-page);
  border: 2px dashed rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  color: var(--color-text-primary);
  padding: var(--space-4);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: var(--line-height-relaxed);
  resize: vertical;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.cv2-textarea:hover {
  border-color: rgba(var(--color-primary-rgb), 0.4);
  background: rgba(var(--color-primary-rgb), 0.02);
}

.cv2-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.03);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.08);
}

.cv2-textarea::placeholder {
  color: var(--color-text-muted);
}

/* === Skip / Undo === */
.cv2-skip-link {
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color 0.15s;
}

.cv2-skip-link:hover {
  color: var(--color-text-secondary);
}

.cv2-skipped-pill {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  background: var(--color-bg-input);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  margin-top: var(--space-2);
}

.cv2-undo-link {
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  color: var(--color-primary);
  text-decoration: underline;
  cursor: pointer;
  margin-left: var(--space-2);
  padding: 0;
  font-weight: var(--font-weight-medium);
}

/* === Extra material section === */
.cv2-extras {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: var(--border-subtle);
}

/* === Expandable === */
.cv2-expandable {
  border-bottom: 1px solid var(--color-border);
}

.cv2-expandable:last-child {
  border-bottom: none;
}

.cv2-expandable-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: var(--space-3) var(--space-1);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-heading);
  text-align: left;
  transition: color 0.15s;
}

.cv2-expandable-header:hover {
  color: var(--color-secondary-teal);
}

.cv2-expand-icon {
  font-size: 20px;
  font-weight: 300;
  color: var(--color-secondary-teal);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.cv2-expandable.open .cv2-expand-icon {
  transform: rotate(45deg);
}

.cv2-expandable-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 var(--space-1);
}

.cv2-expandable.open .cv2-expandable-content {
  max-height: 500px;
  padding: 0 var(--space-1) var(--space-4);
}

/* === Builder sections === */
.cv2-builder-section {
  margin-bottom: var(--space-6);
}

.cv2-builder-section:last-child {
  margin-bottom: 0;
}

.cv2-builder-heading {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-heading);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: var(--border-subtle);
}

/* === Builder entry === */
.cv2-entry {
  background: var(--color-bg-subtle);
  border: var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

/* Entry display mode (confirmed) */
.cv2-entry-display {
  display: none;
}

.cv2-entry.is-confirmed .cv2-entry-form {
  display: none;
}

.cv2-entry.is-confirmed .cv2-entry-display {
  display: block;
}

.cv2-display-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}

.cv2-display-main {
  display: flex;
  flex-direction: column;
}

.cv2-display-title {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-heading);
}

.cv2-display-subtitle {
  font-size: var(--font-size-small);
  color: var(--color-text-secondary);
}

.cv2-display-dates {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.cv2-display-description {
  font-size: var(--font-size-small);
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-3);
}

.cv2-entry-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.cv2-improvement-hint {
  font-size: var(--font-size-small);
  color: var(--color-secondary-teal);
  font-weight: var(--font-weight-medium);
  margin-right: auto;
  opacity: 0.85;
}
.cv2-improvement-hint.cv2-improvement-done {
  color: var(--color-secondary-teal);
}

.cv2-btn-edit {
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  color: var(--color-primary);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* Entry form mode */
.cv2-entry-form label {
  display: block;
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-heading);
  margin-bottom: var(--space-1);
  margin-top: var(--space-3);
}

.cv2-entry-form label:first-child {
  margin-top: 0;
}

.cv2-date-fields {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.cv2-date-fields label {
  flex: 1;
  margin-top: 0;
}

.cv2-date-fields .cv2-input {
  margin-top: var(--space-1);
}

/* Progressive reveal of fields */
.cv2-entry .cv2-group-dates,
.cv2-entry .cv2-group-description {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}

.cv2-entry.show-dates .cv2-group-dates {
  max-height: 200px;
  opacity: 1;
}

.cv2-entry.show-description .cv2-group-description {
  max-height: 500px;
  opacity: 1;
}

/* Generate button row */
.cv2-description-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-3);
  margin-bottom: var(--space-1);
}

.cv2-description-header label {
  margin: 0;
}

.cv2-btn-generate {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px 14px;
  background: var(--color-bg-page);
  border: var(--border-subtle);
  border-radius: var(--radius-pill);
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.cv2-btn-generate:hover {
  border-color: var(--color-secondary-teal);
  color: var(--color-secondary-teal);
}

/* Confirm button */
.cv2-btn-confirm {
  margin-top: var(--space-4);
}

/* === Modal (generator) === */
.cv2-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 52, 52, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 1000;
}

/* Contact overlay */
.cv2-modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: none;
  border: none;
  font-size: 18px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}

.cv2-modal-close:hover {
  background: rgba(0,0,0,0.05);
  color: var(--color-text-heading);
}

.cv2-contact-modal {
  position: relative;
  max-width: 560px;
}

.cv2-contact-intro {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.cv2-contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cv2-contact-row {
  display: flex;
  gap: var(--space-3);
}

.cv2-contact-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cv2-contact-field-full {
  flex: 1 1 100%;
}

.cv2-contact-field label {
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-heading);
}

.cv2-optional {
  font-weight: normal;
  color: var(--color-text-muted);
  font-size: 12px;
}

.cv2-contact-field input {
  padding: 10px 12px;
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  background: var(--color-bg-main);
  color: var(--color-text-body);
  transition: border-color 0.15s;
}

.cv2-contact-field input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(0,160,155,0.12);
}

.cv2-contact-field input::placeholder {
  color: rgba(0,0,0,0.3);
}

.cv2-backdrop.open {
  display: flex;
}

.cv2-modal {
  max-width: 720px;
  width: 100%;
  background: var(--color-bg-card);
  border: var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.cv2-modal-title {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-heading);
  margin-bottom: var(--space-4);
}

.cv2-modal-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-4);
}

.cv2-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border-bottom: var(--border-subtle);
}

.cv2-suggestion:last-child {
  border-bottom: none;
}

.cv2-suggestion p {
  margin: 0;
  font-size: var(--font-size-small);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  flex: 1;
}

/* === Responsive === */
@media (max-width: 640px) {
  .cv2-date-fields {
    flex-direction: column;
    gap: 0;
  }

  .cv2-display-header {
    flex-direction: column;
    gap: var(--space-1);
  }
}

/* === Skip step link (step 2) === */
.cv2-skip-step-link {
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-left: var(--space-3);
  transition: color 0.15s;
}

.cv2-skip-step-link:hover {
  color: var(--color-text-secondary);
}

/* === Structure list (Step 7) === */
.cv2-structure-list {
  margin-bottom: var(--space-5);
}

.cv2-structure-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-card);
  border: var(--border-subtle);
  border-radius: var(--radius-card);
  margin-bottom: var(--space-2);
  cursor: grab;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.cv2-structure-item:hover {
  border-color: rgba(0, 160, 155, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cv2-structure-item:active {
  cursor: grabbing;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--color-secondary-teal);
}

.cv2-structure-handle {
  font-size: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  line-height: 1;
}

.cv2-structure-label {
  flex: 1;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-heading);
}

.cv2-structure-pos {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  background: var(--color-bg-subtle);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.cv2-structure-placeholder {
  height: 48px;
  border: 2px dashed rgba(0, 160, 155, 0.4);
  border-radius: var(--radius-card);
  margin-bottom: var(--space-2);
  background: rgba(0, 160, 155, 0.05);
  transition: height 0.15s ease;
}

.cv2-structure-item.dragging {
  opacity: 0.4;
}

/* === Custom sections (Step 6) === */
.cv2-custom-section {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-subtle);
  border: var(--border-subtle);
  border-radius: var(--radius-card);
}

.cv2-custom-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.cv2-custom-section-title {
  flex: 1;
}

.cv2-custom-section-remove {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--space-1);
  flex-shrink: 0;
  transition: color 0.15s;
}

.cv2-custom-section-remove:hover {
  color: var(--color-text-primary);
}

/* Custom section: confirmed display state */
.cv2-custom-section.is-confirmed {
  padding: var(--space-3) var(--space-4);
}

.cv2-custom-section-form .cv2-custom-confirm-btn {
  margin-top: var(--space-3);
}

.cv2-custom-section-display-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.cv2-custom-section-display-title {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-heading);
}

.cv2-custom-section-display-text {
  font-size: var(--font-size-small);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

.cv2-custom-section-display-text p {
  margin: var(--space-1) 0;
  font-size: var(--font-size-small);
  color: var(--color-text-secondary);
}

.cv2-custom-section-display-text p:first-child { margin-top: 0; }
.cv2-custom-section-display-text p:last-child { margin-bottom: 0; }

/* === CV Preview button (ghost, left-aligned in step-continue) === */
.cv-preview-btn {
  margin-right: auto;
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  transition: all 0.15s;
  white-space: nowrap;
}

.cv-preview-btn:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.cv-preview-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--color-border);
}

/* === Step 2: button spacing === */
#step2 .step-continue {
  gap: var(--space-5);
}

/* ── Template teaser (step 1) ── */
.cv2-template-teaser {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-app);
  border: var(--border-subtle);
  border-radius: var(--radius-card);
  margin-top: var(--space-4);
}

.cv2-template-teaser-thumb {
  flex-shrink: 0;
}

.cv2-template-mini {
  width: 52px;
  height: 68px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 3px;
  padding: 6px 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.cv2-template-mini-header {
  height: 6px;
  background: #2c3e50;
  border-radius: 1px;
  margin-bottom: 2px;
}

.cv2-template-mini-line {
  height: 2px;
  background: rgba(0,0,0,0.15);
  border-radius: 1px;
}

.cv2-template-mini-line.w80 { width: 80%; }
.cv2-template-mini-line.w60 { width: 60%; }
.cv2-template-mini-line.w90 { width: 90%; }
.cv2-template-mini-line.w70 { width: 70%; }
.cv2-template-mini-line.w85 { width: 85%; }
.cv2-template-mini-line.w75 { width: 75%; }
.cv2-template-mini-line.w50 { width: 50%; }

.cv2-template-mini-gap {
  height: 3px;
}

.cv2-template-teaser-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cv2-template-teaser-label {
  font-size: 14px;
  color: var(--color-text-body);
}

.cv2-template-teaser-label strong {
  font-weight: var(--font-weight-medium);
}

.cv2-template-teaser-hint {
  font-size: 12px;
  color: rgba(0,0,0,0.45);
}

/* =============================================
   Pågående checkbox (ongoing dates)
   ============================================= */

.cv2-ongoing-label {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-small) !important;
  font-weight: normal !important;
  color: var(--color-text-secondary) !important;
  margin-top: 0 !important;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.cv2-ongoing-check {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.cv2-date-fields .cv2-input:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: var(--color-bg-subtle);
}

/* =============================================
   Markdown display in confirmed entries
   ============================================= */

.cv2-display-description {
  white-space: normal;
}

.cv2-display-description ul {
  margin: var(--space-1) 0;
  padding-left: var(--space-4);
  list-style: disc;
}

.cv2-display-description li {
  font-size: var(--font-size-small);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: 2px;
}

.cv2-display-description p {
  margin: var(--space-1) 0;
  font-size: var(--font-size-small);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

.cv2-display-description p:first-child {
  margin-top: 0;
}

.cv2-display-description p:last-child {
  margin-bottom: 0;
}

/* =============================================
   Skill tags (chips)
   ============================================= */

.cv2-tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-2);
  min-height: 28px;
}

.cv2-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(var(--color-primary-rgb), 0.08);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--color-text-primary);
  line-height: 1.3;
  transition: background 0.15s, border-color 0.15s;
}

.cv2-tag:hover {
  background: rgba(var(--color-primary-rgb), 0.12);
  border-color: rgba(var(--color-primary-rgb), 0.35);
}

.cv2-tag-remove {
  background: none;
  border: none;
  font-size: 14px;
  line-height: 1;
  color: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  padding: 0;
  margin-left: 2px;
  transition: color 0.15s;
}

.cv2-tag-remove:hover {
  color: rgba(220, 53, 69, 0.7);
}

.cv2-tag-input {
  margin-top: 0;
  font-size: 13px !important;
  padding: var(--space-2) var(--space-3) !important;
}

/* =============================================
   Item rows (languages, courses)
   ============================================= */

.cv2-item-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.cv2-item-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.cv2-item-row .cv2-input {
  padding: var(--space-2) var(--space-3);
  font-size: 14px;
}

.cv2-item-name {
  flex: 2;
}

.cv2-item-detail {
  flex: 2;
}

.cv2-item-date {
  flex: 1;
  min-width: 70px;
  max-width: 90px;
}

.cv2-item-remove {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
  line-height: 1;
}

.cv2-item-remove:hover {
  color: rgba(220, 53, 69, 0.7);
}

.cv2-add-item-btn {
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  color: var(--color-primary);
  cursor: pointer;
  padding: var(--space-1) 0;
  font-weight: var(--font-weight-medium);
  transition: color 0.15s;
}

.cv2-add-item-btn:hover {
  color: var(--color-primary-hover);
}
/* =============================================
   Skill groups (categories + tags)
   ============================================= */

.cv2-skill-group {
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg-page);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.cv2-skill-group-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.cv2-skill-group-name {
  flex: 1;
  font-size: 13px !important;
  padding: var(--space-1) var(--space-2) !important;
  border-style: dashed !important;
}

.cv2-skill-group-remove {
  flex-shrink: 0;
}

.cv2-skill-group .cv2-tag-container {
  margin-bottom: var(--space-2);
}

.cv2-skill-group .cv2-tag-input {
  font-size: 13px !important;
  padding: var(--space-2) var(--space-3) !important;
}

/* =============================================
   Compact entries (Courses, Volunteer)
   ============================================= */

.cv2-entry-compact {
  padding: var(--space-3);
  margin-bottom: var(--space-2);
}

.cv2-entry-compact .cv2-display-description:empty {
  display: none;
}

.cv2-entry-compact .cv2-display-description {
  margin-bottom: var(--space-2);
}

.cv2-entry-compact .cv2-entry-controls {
  gap: var(--space-3);
}

.cv2-compact-remove {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color 0.15s;
  line-height: 1;
}

.cv2-compact-remove:hover {
  color: rgba(220, 53, 69, 0.7);
}

/* Compact form layout */
.cv2-compact-form-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.cv2-compact-form-row .cv2-input {
  flex: 2;
  padding: var(--space-2) var(--space-3);
  font-size: 14px;
}

.cv2-compact-form-row .cv2-compact-date {
  flex: 1;
  min-width: 70px;
  max-width: 100px;
}

.cv2-compact-dates {
  flex-wrap: nowrap;
  margin-bottom: var(--space-2);
}

.cv2-compact-dates .cv2-input {
  flex: 1;
  max-width: 120px;
}

.cv2-date-sep {
  color: var(--color-text-muted);
  font-size: 14px;
}

.cv2-compact-desc {
  font-size: 13px !important;
  padding: var(--space-2) var(--space-3) !important;
  resize: vertical;
  min-height: 32px;
  margin-bottom: var(--space-1);
}

.cv2-entry-compact .cv2-btn-confirm {
  margin-top: var(--space-2);
}

/* Compact form: no labels, tighter spacing */
.cv2-entry-compact .cv2-entry-form label {
  display: none;
}

@media (max-width: 640px) {
  .cv2-compact-form-row {
    flex-wrap: wrap;
  }
  .cv2-compact-form-row .cv2-input {
    flex: 1 1 100%;
  }
  .cv2-compact-form-row .cv2-compact-date {
    flex: 1 1 auto;
    max-width: none;
  }
  .cv2-compact-dates .cv2-input {
    max-width: none;
  }
}

/* Field hint text */
.cv2-field-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .cv2-item-row-top {
    flex-wrap: wrap;
  }
  .cv2-item-row-top .cv2-item-name,
  .cv2-item-row-top .cv2-item-detail {
    flex: 1 1 100%;
  }
  .cv2-item-row-top .cv2-item-date {
    flex: 1 1 auto;
    max-width: none;
  }
  .cv2-item-row-dates .cv2-item-date {
    max-width: none;
  }
}

/* Responsive: stack item rows on mobile */
@media (max-width: 640px) {
  .cv2-item-row {
    flex-wrap: wrap;
  }
  .cv2-item-name,
  .cv2-item-detail {
    flex: 1 1 100%;
  }
  .cv2-item-date {
    flex: 1 1 auto;
    max-width: none;
  }
}

/* =============================================
   Section block: display/edit toggle (Intro)
   ============================================= */

.cv2-section-block {
  margin-bottom: var(--space-4);
}

.cv2-section-display {
  background: var(--color-bg-subtle);
  border: var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--space-4);
}

.cv2-section-display-text {
  font-size: var(--font-size-small);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-3);
}

.cv2-section-display-text p {
  margin: var(--space-1) 0;
  font-size: var(--font-size-small);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

.cv2-section-display-text p:first-child { margin-top: 0; }
.cv2-section-display-text p:last-child { margin-bottom: 0; }

.cv2-section-form .cv2-section-confirm {
  margin-top: var(--space-3);
}

/* =============================================
   Expandable: confirmed state + summary
   ============================================= */

.cv2-expandable-summary {
  flex: 1;
  font-size: 13px;
  font-weight: normal;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: var(--space-2);
}

/* When confirmed: teal check styling on header */
.cv2-expandable.is-confirmed .cv2-expandable-header {
  color: var(--color-text-heading);
}

.cv2-expandable.is-confirmed .cv2-expand-icon {
  transform: none;
  color: var(--color-primary);
}

.cv2-expandable.is-confirmed .cv2-expand-icon::after {
  content: '✓';
}

/* Hide the + when confirmed — show ✓ instead */
.cv2-expandable.is-confirmed .cv2-expand-icon {
  font-size: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--color-primary-rgb), 0.1);
  border-radius: 50%;
}

.cv2-expandable.is-confirmed .cv2-expand-icon::after {
  font-size: 13px;
  font-weight: 600;
}

/* When re-opened from confirmed state, revert icon */
.cv2-expandable.open .cv2-expand-icon {
  font-size: 20px;
  width: 24px;
  height: auto;
  display: inline;
  background: none;
  border-radius: 0;
}

.cv2-expandable.open .cv2-expand-icon::after {
  content: none;
}

/* Confirm button inside expandable */
.cv2-expandable-confirm {
  margin-top: var(--space-3);
  display: block;
}
