:root {
  --bg: #f4efe7;
  --panel: rgba(255, 255, 255, 0.84);
  --card: #ffffff;
  --ink: #1d2433;
  --muted: #5d6577;
  --line: rgba(29, 36, 51, 0.1);
  --accent: #b42318;
  --accent-soft: #f9d9d5;
  --gold: #b68a43;
  --gold-soft: #f4e8cd;
  --danger: #9c2f2f;
  --shadow: 0 22px 50px rgba(31, 39, 54, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(180, 35, 24, 0.14), transparent 28%),
    radial-gradient(circle at bottom right, rgba(164, 118, 51, 0.14), transparent 30%),
    linear-gradient(180deg, #f8f5ef 0%, #efe8dc 100%);
}

.page-shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: 100vh;
}

.app-intro {
  padding: 48px 32px;
  background: rgba(17, 24, 39, 0.94);
  color: #f4f3ef;
}

.brand-lockup {
  padding: 18px;
  margin-bottom: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(180, 35, 24, 0.2), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-lockup h2 {
  margin: 0 0 6px;
  font-size: 1.8rem;
}

.brand-copy {
  margin: 0 0 10px;
  color: rgba(244, 243, 239, 0.82);
  line-height: 1.5;
}

.brand-link {
  display: block;
  color: #ffe8e2;
  text-decoration: none;
  line-height: 1.7;
}

.brand-link:hover {
  text-decoration: underline;
}

.eyebrow,
.panel-label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 800;
}

.app-intro h1,
.panel-header h2,
.section-title-row h3 {
  margin: 0;
  line-height: 1.05;
}

.app-intro h1 {
  font-size: clamp(2.2rem, 4vw, 3.6rem);
}

.lead {
  margin: 20px 0 28px;
  color: rgba(244, 243, 239, 0.8);
  line-height: 1.7;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.mini-stat {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
}

.mini-stat strong,
.completion-box strong {
  display: block;
  font-size: 1.05rem;
}

.mini-stat span,
.completion-box span {
  color: rgba(244, 243, 239, 0.72);
  font-size: 0.86rem;
}

.tip-card {
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
}

.tip-card.muted {
  background: rgba(255, 255, 255, 0.04);
}

.tip-card h2 {
  margin-top: 0;
  font-size: 1rem;
}

.tip-card ul {
  margin: 0;
  padding-left: 18px;
  color: rgba(244, 243, 239, 0.86);
  line-height: 1.7;
}

.contact-card,
.inline-cta,
.lead-capture {
  border-radius: 26px;
}

.contact-card {
  padding: 22px;
  background: linear-gradient(135deg, rgba(182, 138, 67, 0.24), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-card h3,
.inline-cta h3,
.lead-capture h3 {
  margin: 0 0 10px;
}

.contact-card p,
.inline-cta p,
.lead-capture p {
  margin: 0;
  line-height: 1.6;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.cta-button,
.text-link {
  text-decoration: none;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #cfa45e);
  color: #1c160c;
  font-weight: 800;
}

.text-link {
  color: #f5f0e4;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 540px) minmax(360px, 1fr);
  gap: 22px;
  padding: 28px;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 26px;
}

.preview-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-header,
.section-title-row,
.entry-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-header {
  margin-bottom: 22px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.ghost-button,
.secondary-button,
.danger-button {
  padding: 11px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.ghost-button {
  background: #101522;
  color: #f5f2eb;
}

.ghost-button.subtle {
  background: rgba(16, 21, 34, 0.08);
  color: var(--ink);
}

.secondary-button {
  background: var(--accent-soft);
  color: var(--accent);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.danger-button {
  background: rgba(156, 47, 47, 0.1);
  color: var(--danger);
}

form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.helper-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(180, 35, 24, 0.08), rgba(164, 118, 51, 0.12));
  border: 1px solid rgba(180, 35, 24, 0.14);
}

.helper-banner strong {
  display: block;
  margin-bottom: 4px;
}

.helper-banner p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.lead-capture {
  padding: 20px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(182, 138, 67, 0.08), rgba(180, 35, 24, 0.08));
  border: 1px solid rgba(182, 138, 67, 0.16);
}

.lead-grid {
  margin-top: 16px;
}

.checkbox-row {
  flex-direction: row;
  align-items: flex-start;
  margin-top: 16px;
}

.checkbox-row input {
  width: auto;
  margin-top: 4px;
}

.lead-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.completion-box {
  min-width: 110px;
  text-align: right;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 15px;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
}

.photo-field input {
  padding: 10px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(180, 35, 24, 0.18);
  border-color: rgba(180, 35, 24, 0.4);
}

textarea {
  resize: vertical;
  min-height: 92px;
}

.full-width {
  width: 100%;
}

.entry-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.entry-card {
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(29, 36, 51, 0.08);
}

.cv-sheet {
  background: var(--card);
  border-radius: 24px;
  padding: 44px;
  box-shadow: inset 0 0 0 1px rgba(29, 36, 51, 0.08);
}

.letter-sheet {
  padding-top: 36px;
}

.cv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  border-bottom: 2px solid rgba(180, 35, 24, 0.14);
  padding-bottom: 22px;
  margin-bottom: 24px;
}

.cv-name,
.cv-headline,
.cv-sheet h3 {
  font-family: Georgia, "Times New Roman", serif;
}

.cv-name {
  font-size: 2.5rem;
  margin: 0;
}

.cv-headline {
  margin: 6px 0 0;
  color: var(--accent);
  font-size: 1.15rem;
}

.cv-contact {
  min-width: 220px;
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--muted);
}

.cv-photo-wrap {
  flex: 0 0 108px;
}

.cv-photo {
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid rgba(29, 36, 51, 0.08);
}

.hidden {
  display: none !important;
}

.cv-sheet section {
  margin-bottom: 24px;
}

.letter-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 2px solid rgba(180, 35, 24, 0.14);
}

.letter-brand-box {
  min-width: 220px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(180, 35, 24, 0.08);
  color: var(--accent);
}

.letter-brand-box strong,
.letter-brand-box span {
  display: block;
}

.inline-cta {
  padding: 22px;
  background: linear-gradient(135deg, rgba(16, 21, 34, 0.96), rgba(180, 35, 24, 0.9));
  color: #f4f3ef;
}

.inline-cta p {
  color: rgba(244, 243, 239, 0.84);
}

.inline-cta .text-link {
  color: #ffe5df;
}

.cv-sheet h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.cv-copy {
  margin: 0;
  white-space: pre-line;
  line-height: 1.7;
  color: #374055;
}

.cv-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.empty-state {
  color: var(--muted);
}

.cv-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(29, 36, 51, 0.08);
}

.cv-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.cv-item-title {
  margin: 0;
  font-weight: 800;
  font-size: 1rem;
}

.cv-item-subtitle,
.cv-item-date,
.cv-item-location,
.cv-item-details {
  margin: 0;
  color: var(--muted);
}

.cv-item-details {
  grid-column: 1 / -1;
  white-space: pre-line;
  line-height: 1.65;
}

.cv-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

@media (max-width: 1120px) {
  .page-shell,
  .workspace {
    grid-template-columns: 1fr;
  }

  .app-intro {
    padding-bottom: 20px;
  }

  .cv-sheet {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 18px;
  }

  .letter-header,
  .helper-banner,
  .form-grid,
  .cv-columns,
  .cv-header {
    grid-template-columns: 1fr;
  }

  .helper-banner {
    display: grid;
  }

  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .letter-header {
    display: grid;
  }

  .cv-header {
    display: grid;
  }

  .cv-sheet {
    padding: 24px;
  }

  .mini-stats {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .app-intro,
  .form-panel,
  .panel-header .ghost-button {
    display: none !important;
  }

  .workspace,
  .preview-panel,
  .panel,
  .cv-sheet {
    display: block;
    box-shadow: none;
    border: 0;
    padding: 0;
    margin: 0;
    background: #fff;
  }
}
