@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;1,500;1,600&family=Caveat:wght@600;700&family=Inter:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; }

:root {
  --bg: #fbfaf7;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-2: #f6f5f0;
  --border: #e3e1d9;
  --border-soft: #e3e1d9;
  --text: #2f3b33;
  --text-dim: #5c6a60;
  --text-faint: #9aa69e;
  --accent: #7ba689;
  --accent-hover: #6a9578;
  --accent-soft: #e3ede6;
  --accent-ink: #ffffff;
  --success: #b9e6b0;
  --success-ink: #1f4d20;
  --success-soft: rgba(185,230,176,0.4);
  --danger: #f26d6d;
  --danger-soft: rgba(242,109,109,0.12);
  --purple: #f0e2c4;
  --purple-ink: #6b5220;
  --orange: #e0a13d;
  --orange-ink: #5e3c06;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-card: 0 1px 2px rgba(47,59,51,0.03), 0 16px 32px -18px rgba(47,59,51,0.16);
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}

button, input, textarea {
  font-family: inherit;
}

h1, h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.topbar-title h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-name {
  font-family: 'Inter', ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ================= ENTRANCE ANIMATION ================= */
@keyframes dash-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .sidebar, .topbar, .form-panel, .preview-panel {
    animation: dash-fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .topbar { animation-delay: 0.05s; }
  .form-panel { animation-delay: 0.1s; }
  .preview-panel { animation-delay: 0.15s; }
}

/* ================= DASHBOARD LAYOUT ================= */
.dashboard {
  display: flex;
  min-height: 100vh;
  padding: 14px;
  gap: 14px;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-shadow: var(--shadow-card);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.steps {
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 3px;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  width: 100%;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.step:hover {
  background: var(--panel-2);
  color: var(--text);
  transform: translateX(2px);
}

.step.active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
}

.step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid var(--text-faint);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.step.active .step-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: scale(1.1);
}

.step.done .step-icon {
  background: var(--success);
  border-color: var(--success);
  color: var(--success-ink);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-tip {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.sidebar-tip-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--accent);
  margin: 0 0 4px;
}

.sidebar-tip-body {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.45;
  margin: 0;
}

.sidebar-progress {
  padding: 14px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

.progress-label {
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.progress-label #progressPct {
  color: var(--accent);
  font-weight: 800;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 9px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- MAIN ---------- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}

.topbar-title h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 3px;
}

.topbar-title p {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
  max-width: 46ch;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.download-hint {
  font-size: 12px;
  color: var(--text-dim);
  max-width: 220px;
  line-height: 1.4;
}

.download-hint strong { color: var(--text); }

.section-label {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 3px;
}

.section-label-spaced {
  margin-top: 22px;
}

.section-hint {
  font-size: 12.5px;
  color: var(--text-dim);
  margin: 0 0 12px;
}

.photo-field {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.photo-preview {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1.5px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#photoPlaceholder {
  font-size: 9.5px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.2;
}

.photo-field-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.photo-upload-btn {
  display: inline-block;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.photo-upload-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

.photo-remove-btn {
  background: transparent;
  color: var(--danger);
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 2px;
}

.photo-hint {
  flex-basis: 100%;
  font-size: 11px;
  color: var(--text-faint);
  margin: 0;
}

.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.template-card {
  text-align: left;
  background: var(--panel-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.template-card:hover { border-color: var(--text-faint); }

.template-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.template-swatch {
  height: 40px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.template-swatch span {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: #1a1a1a;
}

.template-swatch span:first-child { width: 55%; }
.template-swatch span:nth-child(2) { width: 85%; opacity: 0.5; }
.template-swatch span:last-child { width: 70%; opacity: 0.5; }

.template-card[data-template="modern"] .template-swatch span {
  background: #1f4fd8;
  border-radius: 1px;
}

.template-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.template-card-desc {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.35;
}

.download-btn {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.download-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -6px rgba(123,166,137,0.55);
}

.download-btn:active { transform: translateY(0); box-shadow: none; }

.workspace {
  flex: 1;
  display: flex;
  gap: 14px;
  overflow: auto;
}

/* ---------- FORM PANEL ---------- */
.form-panel {
  flex: 1;
  min-width: 320px;
  max-width: 460px;
  display: flex;
  flex-direction: column;
}

.panel-card {
  display: none;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.panel-card.active {
  display: block;
  animation: panel-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.field-row {
  display: flex;
  gap: 10px;
}

.field-row input { flex: 1; min-width: 0; }

label.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin: 0 0 6px 2px;
}

input, textarea, select {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
  background: var(--panel-2);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  border-radius: var(--radius-md);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235c6a60' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
}

select:invalid, select option[value=""] { color: var(--text-faint); }

input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { resize: vertical; line-height: 1.5; }

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
  box-shadow: 0 0 0 999px var(--panel-2) inset;
}

.char-count {
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: right;
  margin-top: -6px;
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.skill-chip {
  background: var(--purple);
  color: var(--purple-ink);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}

.entry-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  background: var(--panel-2);
  animation: dash-fade-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.entry-block input, .entry-block textarea, .entry-block select {
  background-color: var(--panel);
}

.entry-block > *:last-child { margin-bottom: 0; }

.entry-block-head {
  display: flex;
  justify-content: flex-end;
  margin: -4px -4px 8px 0;
}

.remove-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-faint);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.remove-btn::before {
  content: "×";
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
}

.remove-btn:hover {
  background: var(--danger-soft);
  color: var(--danger);
  transform: scale(1.08);
}

.add-btn {
  background: transparent;
  color: var(--text);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.add-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.add-btn:active { transform: translateY(0); }

.panel-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
}

.nav-btn {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-btn:hover:not(:disabled) { background: var(--accent-soft); transform: translateY(-1px); }
.nav-btn:active:not(:disabled) { transform: translateY(0); }

.nav-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.nav-btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 8px 16px -6px rgba(123,166,137,0.55);
}

.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------- PREVIEW PANEL ---------- */
.preview-panel {
  flex: 0.95;
  min-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-toolbar-title {
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.doc-switch {
  display: flex;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.doc-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.doc-btn:hover { color: var(--text); }

.doc-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.ats-badge {
  font-size: 12px;
  font-weight: 700;
  background: var(--success);
  color: var(--success-ink);
  padding: 5px 12px;
  border-radius: 999px;
}

.preview-scale-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(123,166,137,0.10), transparent 70%),
    radial-gradient(circle, var(--border) 1.5px, transparent 1.5px) 0 0/18px 18px,
    var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 32px;
  overflow: auto;
  box-shadow: var(--shadow-card);
}

.preview {
  display: none;
  background: #fff;
  width: 100%;
  max-width: 660px;
  height: fit-content;
  padding: 50px 58px;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.04), 0 20px 44px -22px rgba(0,0,0,0.35);
  font-family: Georgia, "Times New Roman", Times, serif;
  color: #1a1a1a;
}

.preview.doc-active {
  display: block;
  animation: dash-fade-up 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cover-preview p { font-size: 13px; line-height: 1.6; margin: 0; color: #1a1a1a; }

.cover-header {
  text-align: center;
  border-bottom: 1.5px solid #1a1a1a;
  padding-bottom: 14px;
  margin-bottom: 22px;
}

.cover-name { font-weight: 700; font-size: 15px; margin-bottom: 4px !important; }
.cover-address { color: #333; }

.cover-date { margin-bottom: 20px !important; }

.cover-recipient {
  margin-bottom: 18px;
}

.cover-recipient p { margin: 0; }

.cover-salutation { margin-bottom: 14px !important; }

.cover-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}

.cover-body p { margin: 0; text-align: justify; }

.cover-sign-space { height: 32px; }
.cover-signature { font-weight: 700; }

.preview-header {
  text-align: center;
  padding-bottom: 6px;
  margin-bottom: 14px;
}

.preview-photo { display: none; }

.preview h1 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 3px;
  text-transform: uppercase;
}

.preview .p-title {
  font-size: 12px;
  margin: 2px 0 6px;
  color: #1a1a1a;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-align: center;
}

.preview .p-contact {
  font-size: 11.5px;
  margin: 0;
  color: #1a1a1a;
  text-align: center;
}

.preview .p-contact a {
  color: #1a1a1a;
  text-decoration: none;
}

.preview .p-contact a:hover { text-decoration: underline; }

.preview .p-contact .contact-item:not(:last-child)::after {
  content: " | ";
  color: #666;
}

.preview .p-section {
  margin-bottom: 14px;
}

.preview .p-section:empty { display: none; }

.preview h2 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid #555;
  padding-bottom: 3px;
  margin: 0 0 8px;
}

.preview p {
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 5px;
  text-align: left;
}

.entry-preview {
  margin-bottom: 10px;
}

.entry-preview:last-child { margin-bottom: 0; }

.entry-preview .entry-header {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 3px;
}

.entry-preview .entry-header span:last-child {
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
}

.entry-preview .entry-sub {
  font-size: 12px;
  line-height: 1.4;
  color: #333;
  margin: 0 0 5px;
}

.entry-preview ul {
  margin: 2px 0 0;
  padding-left: 20px;
  font-size: 12px;
  line-height: 1.5;
}

.entry-preview li { margin-bottom: 2px; }

.entry-preview li::marker { color: #1a1a1a; }

.skills-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 32px;
  font-size: 12px;
  line-height: 1.6;
}

.skills-grid li {
  break-inside: avoid;
  padding-left: 14px;
  position: relative;
}

.skills-grid li::before {
  content: "•";
  position: absolute;
  left: 0;
}

/* ---------- MODERN TEMPLATE VARIANT (two-column, timeline experience) ---------- */
.modern-greeting { display: none; }

.preview[data-template="modern"] {
  display: grid;
  grid-template-columns: 176px 1fr;
  column-gap: 30px;
  grid-template-areas:
    "head head"
    "edu summary"
    "skills experience"
    "skills extra";
  align-content: start;
  padding: 44px 46px;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  background: #fdf6ee;
}

.preview[data-template="modern"] h1,
.preview[data-template="modern"] h2 {
  font-family: 'Inter', Arial, Helvetica, sans-serif;
}

.preview[data-template="modern"] .preview-header {
  grid-area: head;
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: left;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 8px;
}

.preview[data-template="modern"] .preview-photo {
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #1f3fb8;
  flex-shrink: 0;
}

.preview[data-template="modern"] .preview-photo[hidden] { display: none; }

.preview[data-template="modern"] .preview-header-text { min-width: 0; }

.preview[data-template="modern"] h1 {
  color: #1f3fb8;
  text-transform: none;
  letter-spacing: -0.01em;
}

.preview[data-template="modern"] .p-title {
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  color: #555;
  font-weight: 500;
}

.preview[data-template="modern"] .p-contact {
  text-align: left;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
}

.preview[data-template="modern"] .contact-item { display: inline-flex; align-items: center; gap: 5px; }
.preview[data-template="modern"] .contact-item:not(:last-child)::after { content: none; }
.preview[data-template="modern"] .contact-item::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1f3fb8;
  flex-shrink: 0;
}

.preview[data-template="modern"] h2 {
  color: #1f3fb8;
  border-bottom: none;
  letter-spacing: 0.04em;
  font-size: 13px;
}

.preview[data-template="modern"] p { text-align: left; }

.preview[data-template="modern"] #pEducationSection { grid-area: edu; }
.preview[data-template="modern"] #pSkillsSection { grid-area: skills; }
.preview[data-template="modern"] #pSummarySection { grid-area: summary; }
.preview[data-template="modern"] #pExperienceSection { grid-area: experience; }
.preview[data-template="modern"] #pExtraSection { grid-area: extra; }

.preview[data-template="modern"] #pEducationSection,
.preview[data-template="modern"] #pSkillsSection {
  padding-right: 16px;
}

.preview[data-template="modern"] .modern-greeting {
  display: block;
  font-family: 'Caveat', Georgia, serif;
  font-style: italic;
  font-size: 30px;
  font-weight: 700;
  color: #1f3fb8;
  margin: 0 0 2px;
  transform: rotate(-2deg);
}

.preview[data-template="modern"] #pSkillsSection .skills-grid {
  columns: 1;
  gap: 8px;
}

.preview[data-template="modern"] #pSkillsSection .skills-grid li {
  list-style: none;
  padding: 0 0 0 10px;
  border-left: 2px solid #1f3fb8;
  font-weight: 600;
  color: #23324f;
  margin-bottom: 8px;
}

.preview[data-template="modern"] #pSkillsSection .skills-grid li::before { content: none; }

.preview[data-template="modern"] #pEducationSection .entry-preview {
  border-left: 2px solid #1f3fb8;
  padding-left: 10px;
}

.preview[data-template="modern"] #pEducationSection .entry-header {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
}

.preview[data-template="modern"] #pEducationSection .entry-header span:last-child {
  color: #1f3fb8;
  font-weight: 700;
}

.preview[data-template="modern"] #pEducationSection .entry-header span:first-child {
  color: #1a1a1a;
}

.preview[data-template="modern"] #pExperienceSection .entry-preview {
  display: grid;
  grid-template-columns: 76px 1fr;
  column-gap: 14px;
  grid-template-areas:
    "period role"
    "period sub"
    "period bullets";
  border-left: 2px solid #1f3fb8;
  padding-left: 14px;
  margin-bottom: 20px;
}

.preview[data-template="modern"] #pExperienceSection .entry-preview:last-child { margin-bottom: 0; }

.preview[data-template="modern"] #pExperienceSection .entry-header {
  display: contents;
}

.preview[data-template="modern"] #pExperienceSection .entry-header span:first-child {
  grid-area: role;
  color: #1a1a1a;
}

.preview[data-template="modern"] #pExperienceSection .entry-header span:last-child {
  grid-area: period;
  color: #1f3fb8;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
}

.preview[data-template="modern"] #pExperienceSection .entry-sub {
  grid-area: sub;
  font-style: italic;
  margin-top: 1px;
}

.preview[data-template="modern"] #pExperienceSection .entry-preview ul {
  grid-area: bullets;
  margin-top: 6px;
}

.field-invalid {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15);
}

/* ---------- PRINT (PDF EXPORT) ---------- */
@page {
  size: A4;
  margin: 14mm 16mm;
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .form-panel, .preview-toolbar { display: none !important; }
  .dashboard, .main, .workspace { display: block; padding: 0; margin: 0; }
  .preview-scale-wrap {
    background: #fff;
    border: none;
    padding: 0;
    margin: 0;
    display: block;
    overflow: visible;
    box-shadow: none;
  }
  .preview {
    box-shadow: none;
    border-radius: 0;
    max-width: none;
    width: 100%;
    padding: 0;
    animation: none !important;
  }
  .preview a, .cover-preview a {
    color: #1a1a1a !important;
    text-decoration: none !important;
  }
  .p-section, .entry-preview { break-inside: avoid; }
  .preview h2 { break-after: avoid; }
}

@media (max-width: 1000px) {
  .workspace { flex-direction: column; }
  .form-panel, .preview-panel { max-width: none; }
}

@media (max-width: 700px) {
  .dashboard { flex-direction: column; padding: 10px; gap: 10px; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    overflow-x: auto;
  }
  .brand { flex-shrink: 0; }
  .steps { flex-direction: row; }
  .step { flex-shrink: 0; width: auto; padding: 8px 10px; }
  .step-label { display: none; }
  .sidebar-footer { display: none; }
  .topbar { padding: 16px 20px; }
  .workspace { padding: 0; }
}
