:root {
  --navy: #12325b;
  --navy-dark: #0b2342;
  --blue: #2563eb;
  --blue-soft: #edf4ff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #dbe3ee;
  --paper: #ffffff;
  --page-bg: #f3f6fa;
  --green: #15803d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--page-bg); color: var(--ink); }
body { margin: 0; min-width: 320px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.site-header { min-height: 76px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 12px clamp(16px, 4vw, 52px); gap: 18px; }
.brand { display: flex; gap: 11px; align-items: center; color: var(--navy); text-decoration: none; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; letter-spacing: -.06em; }
.brand strong { display: block; font-size: 17px; line-height: 1.2; }
.brand small { display: block; font-size: 9px; letter-spacing: .17em; font-weight: 800; margin-top: 4px; color: var(--muted); }
.header-actions, .preview-tools { display: flex; align-items: center; gap: 10px; }
.free-pill { border: 1px solid #b7e4c7; color: var(--green); background: #f0fdf4; padding: 7px 10px; border-radius: 99px; font-size: 10px; font-weight: 800; letter-spacing: .07em; }
.button { border: 1px solid transparent; border-radius: 9px; padding: 10px 15px; font-weight: 700; font-size: 13px; transition: background .15s, border-color .15s; }
.button-primary { background: var(--blue); color: white; }
.button-primary:hover { background: #1d4ed8; }
.button-quiet { background: white; border-color: var(--line); color: var(--ink); }
.button-quiet:hover, .button-outline:hover { background: #f8fafc; border-color: #b8c7da; }
.button-outline { background: #fff; border-color: #cbd5e1; color: var(--navy); }
.button-small { padding: 7px 11px; font-size: 12px; }
.button-wide { width: 100%; padding: 13px; }
.app-shell { max-width: 1600px; margin: 0 auto; padding: 28px clamp(14px, 3vw, 42px) 34px; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 0 0 24px; }
.eyebrow { margin: 0 0 7px; font-size: 10px; letter-spacing: .15em; font-weight: 800; color: var(--blue); }
.intro h1 { color: var(--navy-dark); margin: 0; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.04em; line-height: 1.13; }
.intro-copy { color: var(--muted); max-width: 700px; margin: 10px 0 0; line-height: 1.55; font-size: 14px; }
.privacy-note { color: #166534; font-size: 12px; white-space: nowrap; padding: 10px 12px; border-radius: 9px; background: #f0fdf4; border: 1px solid #bbf7d0; }
.privacy-note span { font-weight: 900; margin-right: 5px; }
.workspace { display: grid; grid-template-columns: minmax(330px, 470px) minmax(0, 1fr); gap: 24px; align-items: start; }
.editor-panel, .preview-panel { min-width: 0; }
.editor-panel { background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 5px 18px rgba(15, 39, 70, .035); overflow: hidden; }
.panel-heading, .preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading { padding: 22px 22px 16px; }
.panel-heading h2, .preview-toolbar h2 { margin: 0; font-size: 20px; color: var(--navy-dark); letter-spacing: -.025em; }
.text-button { border: 0; background: transparent; color: var(--blue); font-weight: 700; font-size: 12px; padding: 5px 0; }
.text-button:hover { text-decoration: underline; }
.template-picker { padding: 0 22px 20px; border-bottom: 1px solid var(--line); }
.field-label { font-size: 12px; font-weight: 800; margin: 0 0 10px; color: #334155; }
.template-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.template-option { text-align: left; padding: 9px; background: #fff; border: 1px solid var(--line); border-radius: 10px; min-width: 0; color: var(--ink); }
.template-option.selected { border: 2px solid var(--blue); padding: 8px; background: #f8fbff; box-shadow: 0 0 0 2px #dbeafe; }
.template-option strong { display: block; font-size: 11px; margin-top: 8px; }
.template-option small { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; line-height: 1.3; }
.template-mini { display: flex; height: 44px; border: 1px solid #d7e0ec; border-radius: 4px; padding: 5px; gap: 4px; overflow: hidden; background: #fff; }
.template-mini i { display: block; border-radius: 1px; background: #cbd5e1; }
.mini-professional { flex-direction: column; }
.mini-professional i:first-child { height: 7px; width: 70%; background: var(--navy); }
.mini-professional i:nth-child(2) { height: 3px; width: 100%; }
.mini-professional i:nth-child(3) { height: 17px; width: 75%; }
.mini-modern { flex-direction: row; }
.mini-modern i:first-child { width: 30%; height: 100%; background: var(--navy); }
.mini-modern i:nth-child(2) { width: 55%; height: 70%; }
.mini-modern i:nth-child(3) { display: none; }
.mini-ats { flex-direction: column; }
.mini-ats i { height: 4px; width: 100%; }
.mini-ats i:first-child { width: 62%; height: 7px; background: #64748b; }
.form-section { border-bottom: 1px solid #edf1f6; }
.form-section > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 17px 22px; cursor: pointer; font-size: 13px; font-weight: 800; color: #1e293b; }
.form-section > summary::-webkit-details-marker { display: none; }
.form-section > summary::after { content: "⌄"; margin-left: auto; color: #64748b; font-size: 17px; transition: transform .15s; }
.form-section:not([open]) > summary::after { transform: rotate(-90deg); }
.section-number { display: grid; place-items: center; width: 23px; height: 23px; flex: 0 0 23px; border-radius: 7px; background: var(--blue-soft); color: var(--blue); font-size: 11px; }
.summary-help { margin-left: auto; color: #94a3b8; font-size: 10px; font-weight: 500; }
.section-content { padding: 0 22px 20px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: #475569; font-weight: 700; min-width: 0; margin-bottom: 13px; }
.field-full { grid-column: 1 / -1; }
.field input, .field textarea { width: 100%; border: 1px solid #cfd8e5; background: #fff; border-radius: 7px; padding: 10px 11px; color: #0f172a; outline: none; font-size: 12px; font-weight: 400; min-width: 0; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #dbeafe; }
.field input::placeholder, .field textarea::placeholder { color: #a0adbd; }
.field-hint { display: block; color: #8491a3; font-size: 10px; line-height: 1.5; font-weight: 400; margin: 2px 0 0; }
.helper-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.entry-card { border: 1px solid #e2e8f0; border-radius: 9px; padding: 12px; margin-bottom: 12px; background: #fbfdff; }
.entry-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.entry-card-header strong { font-size: 11px; color: #334155; }
.remove-entry { border: 0; background: transparent; color: #b91c1c; font-size: 11px; font-weight: 700; }
.entry-card .field { margin-bottom: 11px; }
.entry-card .field:last-child { margin-bottom: 0; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.add-button { width: 100%; border-style: dashed; }
.editor-footer { padding: 20px 22px 22px; background: #f8fafc; }
.editor-footer p { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.5; margin: 10px 0 0; }
.preview-panel { position: sticky; top: 16px; }
.preview-toolbar { padding: 4px 0 15px; }
.live-status { display: inline-flex; align-items: center; gap: 6px; color: #15803d; font-size: 11px; font-weight: 700; }
.live-status span { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
.preview-instructions { border: 1px solid #cfe0fb; border-radius: 9px; padding: 11px 14px; background: #eff6ff; color: #36577f; font-size: 11px; line-height: 1.5; margin-bottom: 15px; }
.resume-page { width: 100%; max-width: 850px; min-height: 1080px; margin: 0 auto; padding: 52px 56px; background: #fff; box-shadow: 0 8px 35px rgba(15, 39, 70, .12); color: #263447; overflow-wrap: anywhere; }
.resume-empty { min-height: 850px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #64748b; }
.empty-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 17px; background: #eff6ff; color: var(--blue); font-weight: 900; font-size: 22px; margin-bottom: 14px; }
.resume-empty h2 { color: #334155; font-size: 19px; margin: 0 0 7px; }
.resume-empty p { font-size: 12px; }
.resume-name { font-size: 31px; line-height: 1.12; letter-spacing: -.035em; margin: 0; color: #12325b; font-weight: 800; }
.resume-title { margin: 7px 0 13px; color: #2563eb; font-size: 14px; font-weight: 700; }
.resume-contact { display: flex; flex-wrap: wrap; gap: 5px 13px; color: #64748b; font-size: 10px; line-height: 1.5; }
.resume-contact span { overflow-wrap: anywhere; }
.resume-divider { border: 0; border-top: 2px solid #dce5ef; margin: 22px 0 20px; }
.resume-section { margin-top: 21px; break-inside: avoid; }
.resume-section h3 { color: #12325b; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid #dce5ef; }
.resume-summary, .resume-bullet-text { font-size: 11px; line-height: 1.65; color: #3c4a5d; white-space: pre-line; margin: 0; }
.resume-entry { margin: 0 0 15px; break-inside: avoid; }
.resume-entry:last-child { margin-bottom: 0; }
.resume-entry-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.resume-entry-title { font-size: 12px; font-weight: 800; color: #24364c; margin: 0; }
.resume-entry-meta { font-size: 10px; color: #64748b; margin: 4px 0 0; }
.resume-entry-date { flex: 0 0 auto; font-size: 10px; color: #64748b; text-align: right; }
.resume-bullet-text { margin-top: 6px; }
.resume-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.resume-skill { font-size: 10px; padding: 5px 8px; border-radius: 5px; background: #f1f5f9; color: #334155; }
.resume-simple-list { margin: 0; padding-left: 15px; font-size: 11px; line-height: 1.7; color: #3c4a5d; white-space: pre-line; }
.resume-languages { font-size: 11px; line-height: 1.6; color: #3c4a5d; margin: 0; }
.preview-bottom { display: flex; justify-content: space-between; gap: 10px; padding: 13px 2px 0; color: #8491a3; font-size: 10px; }
.site-footer { max-width: 1600px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 42px) 26px; display: flex; justify-content: space-between; gap: 12px; color: #8793a4; font-size: 10px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #102a4c; color: #fff; border-radius: 9px; padding: 11px 16px; box-shadow: 0 6px 24px #0f172a33; font-size: 12px; z-index: 20; transition: opacity .2s, transform .2s; max-width: calc(100vw - 30px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }

/* Modern template */
.template-modern { padding: 0; }
.template-modern .modern-layout { display: grid; grid-template-columns: 34% 66%; min-height: 1080px; }
.template-modern .modern-sidebar { background: #12325b; color: #fff; padding: 45px 24px; }
.template-modern .modern-sidebar .resume-name { color: #fff; font-size: 24px; overflow-wrap: anywhere; }
.template-modern .modern-sidebar .resume-title { color: #a8d2ff; font-size: 12px; line-height: 1.45; }
.template-modern .modern-sidebar .resume-contact { display: flex; flex-direction: column; gap: 8px; color: #e2eaf5; font-size: 9px; }
.template-modern .modern-sidebar .resume-section { margin-top: 26px; }
.template-modern .modern-sidebar .resume-section h3 { color: #a8d2ff; border-color: #46617f; font-size: 10px; }
.template-modern .modern-sidebar .resume-summary, .template-modern .modern-sidebar .resume-languages, .template-modern .modern-sidebar .resume-simple-list { color: #edf4ff; font-size: 10px; }
.template-modern .modern-main { padding: 48px 34px; }
.template-modern .modern-main .resume-section:first-child { margin-top: 0; }
.template-modern .modern-main .resume-section h3 { color: #12325b; border-bottom: 2px solid #dce5ef; }
.template-modern .resume-skill { border-radius: 3px; background: #eaf2fb; }
.template-modern .resume-divider { display: none; }

/* ATS template: no columns, icons, or skill pills in the resume content */
.template-ats { padding: 48px 56px; font-family: Arial, Helvetica, sans-serif; color: #111827; }
.template-ats .resume-name { color: #111827; font-size: 28px; text-align: center; letter-spacing: 0; }
.template-ats .resume-title { text-align: center; color: #111827; font-size: 13px; font-weight: 400; }
.template-ats .resume-contact { justify-content: center; color: #374151; font-size: 10px; }
.template-ats .resume-divider { border-color: #6b7280; border-top-width: 1px; margin: 16px 0; }
.template-ats .resume-section { margin-top: 17px; }
.template-ats .resume-section h3 { color: #111827; font-size: 12px; letter-spacing: .02em; border-bottom: 1px solid #6b7280; }
.template-ats .resume-entry-title { color: #111827; }
.template-ats .resume-entry-meta, .template-ats .resume-entry-date { color: #374151; }
.template-ats .resume-summary, .template-ats .resume-bullet-text, .template-ats .resume-simple-list, .template-ats .resume-languages { color: #111827; font-size: 10.5px; }
.template-ats .resume-skills { display: block; font-size: 10.5px; line-height: 1.7; }
.template-ats .resume-skill { display: inline; padding: 0; background: none; color: #111827; font-size: 10.5px; }
.template-ats .resume-skill:not(:last-child)::after { content: ", "; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 16px; }
  .resume-page { padding: 38px 34px; min-height: 980px; }
  .template-modern { padding: 0; }
  .template-modern .modern-layout { min-height: 980px; grid-template-columns: 36% 64%; }
  .template-modern .modern-sidebar { padding: 34px 17px; }
  .template-modern .modern-main { padding: 36px 22px; }
}
@media (max-width: 760px) {
  .site-header { align-items: flex-start; padding: 12px 14px; }
  .brand-mark { width: 36px; height: 36px; }
  .header-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .header-actions .button { padding: 8px 10px; font-size: 11px; }
  .free-pill { display: none; }
  .app-shell { padding: 22px 12px 28px; }
  .intro { display: block; }
  .intro h1 { font-size: 29px; }
  .privacy-note { display: inline-block; margin-top: 14px; white-space: normal; }
  .workspace { display: flex; flex-direction: column; }
  .editor-panel, .preview-panel { width: 100%; }
  .preview-panel { position: static; }
  .preview-panel { order: -1; }
  .resume-page { max-width: 100%; min-height: 760px; padding: 30px 24px; }
  .template-modern { padding: 0; }
  .template-modern .modern-layout { min-height: 760px; grid-template-columns: 34% 66%; }
  .template-modern .modern-sidebar { padding: 26px 12px; }
  .template-modern .modern-main { padding: 28px 16px; }
  .template-modern .modern-sidebar .resume-name { font-size: 19px; }
  .template-modern .modern-sidebar .resume-contact { font-size: 8px; }
  .resume-name { font-size: 26px; }
  .preview-bottom { flex-wrap: wrap; }
  .site-footer { flex-direction: column; }
}
@media (max-width: 420px) {
  .brand strong { font-size: 14px; }
  .brand small { font-size: 8px; }
  .header-actions .button-quiet { display: none; }
  .template-options { gap: 5px; }
  .template-option { padding: 7px 5px; }
  .template-option.selected { padding: 6px 4px; }
  .template-option strong { font-size: 10px; }
  .template-option small { font-size: 8px; }
  .field-grid, .entry-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .summary-help { display: none; }
  .resume-page { padding: 25px 18px; }
  .template-modern .modern-sidebar { padding: 23px 9px; }
  .template-modern .modern-main { padding: 23px 12px; }
}

/* Print/PDF */
@page { size: A4; margin: 0; }
@media print {
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; width: 210mm; }
  body { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .no-print, .site-header, .intro, .editor-panel, .preview-toolbar, .preview-instructions, .preview-bottom, .site-footer, .toast { display: none !important; }
  .app-shell { max-width: none !important; margin: 0 !important; padding: 0 !important; }
  .workspace { display: block !important; margin: 0 !important; padding: 0 !important; }
  .preview-panel { position: static !important; width: 210mm !important; margin: 0 !important; padding: 0 !important; }
  .resume-page { display: block !important; width: 210mm !important; max-width: none !important; min-height: 297mm !important; margin: 0 !important; padding: 16mm 17mm !important; box-shadow: none !important; overflow: visible !important; }
  .template-modern { padding: 0 !important; }
  .template-modern .modern-layout { min-height: 297mm !important; }
  .template-modern .modern-sidebar { padding: 15mm 8mm !important; }
  .template-modern .modern-main { padding: 15mm 10mm !important; }
  .resume-empty { display: none !important; }
  .resume-entry, .resume-section { break-inside: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
}

/* Prominent free Resume Builder offer */
.free-offer {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 0 0 24px;
  padding: 17px 20px;
  border: 1px solid #b8e7ca;
  border-radius: 13px;
  background: linear-gradient(100deg, #f0fdf4, #ffffff);
  box-shadow: 0 4px 14px rgba(21, 128, 61, .045);
}
.free-offer-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #15803d;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}
.free-offer-copy { flex: 1; min-width: 0; }
.free-offer-copy h2 {
  margin: 0;
  color: #14532d;
  font-size: 16px;
  line-height: 1.4;
}
.free-offer-copy p {
  margin: 4px 0 0;
  color: #42634e;
  font-size: 12px;
  line-height: 1.5;
}
.free-offer-badge {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid #a7dfba;
  border-radius: 99px;
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
}
@media (max-width: 600px) {
  .free-offer { align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 14px; }
  .free-offer-icon { flex-basis: 34px; width: 34px; height: 34px; font-size: 18px; }
  .free-offer-copy { flex-basis: calc(100% - 50px); }
  .free-offer-copy h2 { font-size: 14px; }
  .free-offer-copy p { font-size: 11px; }
  .free-offer-badge { margin-left: 44px; }
}
