/* Profile content must fit its cards before the page's overflow clipping. */
.cv-experience-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
}
.cv-experience-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.cv-personas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: .75rem;
}
.cv-personas-header > div { flex: 1 1 240px; min-width: 0; }
.cv-personas-header > button { flex-shrink: 0; }
.cv-persona-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: .75rem;
  align-items: center;
}
.cv-persona-editor .persona-name { min-width: 0; width: 100%; }

@media (max-width: 640px) {
  .cv-experience-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cv-experience-heading { flex-direction: column; gap: 8px; }
  .cv-experience-heading > div { width: 100%; }
  .cv-experience-row { overflow-wrap: anywhere; }
  .cv-experience-heading > .cv-badge {
    max-width: 100%;
    height: auto !important;
    min-height: 20px;
    white-space: normal !important;
  }
  .cv-persona-editor { grid-template-columns: minmax(0, 1fr) auto; }
  .cv-persona-editor > label { grid-column: 1 / -1; }
  .cv-persona-editor .persona-name { grid-column: 1 / -1; }
  .cv-persona-editor > button { min-width: 44px; }
}

/* A clear sequence: add evidence, build, then review. */
.cv-profile-jump-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; }
.cv-profile-jump-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-size: 16px; text-decoration: underline; text-underline-offset: 4px; }
.cv-profile-jump-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cv-profile-library-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
#profile-details-to-review { scroll-margin-top: 24px; }
#profile-documents-heading, #experience-notes-heading, #profile-review { scroll-margin-top: 90px; }
.cv-profile-stage-header { margin: 28px 0 16px; }
.cv-profile-stage-number { display: block; color: var(--accent); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.cv-profile-stage-header h2 { font-size: 24px; line-height: 1.25; margin: 0 0 6px; }
.cv-profile-stage-header p { margin: 0; color: var(--ink-3); max-width: 680px; line-height: 1.5; }
.cv-profile-input-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.cv-profile-input-grid > .cv-profile-input-card { min-width: 0; margin: 0; padding: 24px; }
.cv-profile-card-title { font-size: 20px; font-weight: 600; line-height: 1.3; margin: 0 0 12px; color: var(--ink); }
.cv-profile-stage-header h2 { font-weight: 600; }
.cv-profile-input-card .btn, .cv-profile-analysis-card .btn { font-size: 16px; min-height: 44px; }
.cv-profile-input-card #experience-notes { border: 1px solid var(--rule-strong); border-radius: 8px; line-height: 1.5; }
.cv-profile-input-card :is(input, textarea, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cv-profile-input-card p { line-height: 1.5; }
.cv-profile-field-label { display: block; font-weight: 600; margin: 0 0 8px; }
.cv-profile-file-picker { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.cv-profile-file-picker input[type=file] { flex: none !important; padding: 14px; border: 1px dashed var(--rule-strong); border-radius: 8px; background: var(--paper-2); }
.cv-profile-file-picker input[type=file]::file-selector-button { font: inherit; padding: 8px 10px; margin-right: 8px; border: 1px solid var(--rule-strong); border-radius: 6px; color: var(--ink); background: var(--paper); cursor: pointer; }
.cv-profile-form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cv-profile-page .btn.cv-profile-button-secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--rule-strong); box-shadow: none; min-height: 44px; }
.cv-profile-page .btn.cv-profile-button-quiet { background: var(--paper-2); color: var(--ink-3); border: 1px solid transparent; box-shadow: none; min-height: 44px; }
.cv-profile-page .btn.cv-profile-button-primary { background: var(--accent); color: var(--paper); border: 1px solid var(--accent); min-height: 44px; }
.cv-profile-page .cv-profile-analysis-card { margin: 24px 0 32px; padding: 24px; border-color: var(--accent-tint-2); background: var(--paper-2); }
.cv-profile-analysis-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.cv-profile-analysis-header .cv-profile-card-title { margin-bottom: 0; }
.cv-profile-analysis-help { max-width: 700px; margin-bottom: 16px; line-height: 1.5; }
.cv-profile-input-card [data-dictation-status] { margin: 12px 0 0; font-size: 14px; }
.cv-profile-input-card [data-dictation-disclosure] { margin-top: 10px; font-size: 14px; }
.cv-profile-page #master-profile-status:empty { display: none; }
.cv-profile-page #master-profile-content { overflow-wrap: anywhere; }
@media (max-width: 800px) {
  .cv-profile-input-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 640px) {
  .cv-profile-stage-header { margin-top: 20px; }
  .cv-profile-stage-header h2 { font-size: 22px; }
  .cv-profile-input-grid > .cv-profile-input-card,
  .cv-profile-page .cv-profile-analysis-card { padding: 18px; }
  .cv-profile-form-actions > .btn,
  .cv-profile-analysis-header > .btn { width: 100%; white-space: normal; }
  .cv-profile-file-picker input[type=file] { padding: 10px; }
}

@media (max-width: 640px) {
  main.cv-profile-page { padding-left: 24px; padding-right: 24px; }
  .cv-persona-editor > button { white-space: normal !important; }
}
