/* =============================================
   CreateCV — Style Sheet v2.0
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f3f7fc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe4f0;
  --dark: #0f172a;
  --dark-2: #111827;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --soft: #eef4ff;
  --danger: #dc2626;
  --success: #16a34a;
  --ai-color: #7c3aed;
  --ai-color-2: #6d28d9;
  --shadow: 0 18px 50px rgba(15,23,42,.08);
  --shadow-lg: 0 24px 64px rgba(15,23,42,.13);
  --radius: 20px;
  --radius-sm: 14px;
  --resume-width: 210mm;
  --font: 'Plus Jakarta Sans', Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.06), transparent 28%),
    linear-gradient(180deg, #f7faff 0%, #f3f7fc 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button, input, textarea, select {
  font: inherit;
}

.container {
  width: min(1440px, calc(100% - 32px));
  margin: auto;
}

/* ============ TOAST ============ */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: 14px;
  font-weight: 700;
  font-size: .93rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1) both;
  pointer-events: all;
  max-width: 320px;
}

.toast.success {
  background: #0f172a;
  color: #fff;
  border-left: 4px solid var(--success);
}

.toast.error {
  background: #0f172a;
  color: #fff;
  border-left: 4px solid var(--danger);
}

.toast.info {
  background: #0f172a;
  color: #fff;
  border-left: 4px solid var(--primary);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(.96); }
}

/* ============ AI PANEL ============ */
.ai-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  transition: opacity .25s ease;
}

.ai-overlay.hidden {
  display: none;
}

.ai-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100vw);
  background: #fff;
  z-index: 600;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(15,23,42,.18);
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}

.ai-panel.open {
  transform: translateX(0);
}

.ai-panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.ai-panel-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #4c1d95, #2563eb);
  color: #fff;
  flex-shrink: 0;
}

.ai-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
}

.ai-icon {
  font-size: 1.1rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.ai-close-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  display: grid;
  place-items: center;
  transition: background .2s;
}

.ai-close-btn:hover {
  background: rgba(255,255,255,.25);
}

.ai-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}

.ai-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top-color: var(--ai-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ai-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 60px 20px;
}

.ai-empty-icon {
  font-size: 3rem;
  color: var(--ai-color);
  opacity: .3;
}

.ai-empty p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.btn-ai-main {
  background: linear-gradient(135deg, var(--ai-color), #2563eb);
  color: #fff;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: .2s ease;
}

.btn-ai-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(124,58,237,.3);
}

.ai-result {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ai-section {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.ai-section-head {
  padding: 14px 16px;
  font-weight: 800;
  font-size: .94rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-section-head.green { background: #f0fdf4; color: #15803d; }
.ai-section-head.yellow { background: #fefce8; color: #a16207; }
.ai-section-head.blue { background: #eff6ff; color: #1d4ed8; }
.ai-section-head.purple { background: #f5f3ff; color: #6d28d9; }

.ai-section-body {
  padding: 14px 16px;
  font-size: .92rem;
  line-height: 1.75;
  color: var(--dark-2);
}

.ai-section-body ul {
  margin: 0;
  padding-left: 18px;
}

.ai-section-body li {
  margin-bottom: 6px;
}

.ai-score-display {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #4c1d95, #2563eb);
  border-radius: 16px;
  color: #fff;
}

.ai-score-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  flex-shrink: 0;
}

.ai-score-text strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.ai-score-text span {
  font-size: .88rem;
  opacity: .85;
}

.ai-reanalyze {
  margin-top: 8px;
  width: 100%;
}

/* ============ TOPBAR ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(219,228,240,.9);
}

.topbar-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  letter-spacing: .5px;
  background: linear-gradient(135deg, var(--dark), var(--primary));
  box-shadow: 0 12px 24px rgba(37,99,235,.22);
  font-size: .95rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 800;
}

.brand-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============ BUTTONS & CONTROLS ============ */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-btn, .btn, .template-select {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  transition: all .2s ease;
  font-family: var(--font);
}

.lang-btn {
  cursor: pointer;
  background: #eef2f7;
  color: var(--dark);
  font-weight: 700;
  font-size: .88rem;
}

.lang-btn.active {
  background: var(--dark);
  color: #fff;
}

.template-select {
  min-width: 150px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  font-size: .88rem;
}

.btn {
  cursor: pointer;
  font-weight: 800;
  font-size: .88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:hover, .lang-btn:hover, .template-select:hover {
  transform: translateY(-1px);
}

.btn:active, .lang-btn:active {
  transform: translateY(0);
}

.btn-soft {
  background: #eef2f7;
  color: var(--dark);
}

.btn-dark {
  background: var(--dark);
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 8px 20px rgba(37,99,235,.2);
}

.btn-ai {
  background: linear-gradient(135deg, var(--ai-color), #2563eb);
  color: #fff;
  box-shadow: 0 8px 20px rgba(124,58,237,.2);
}

.btn-soft.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-sm {
  padding: 8px 12px;
  font-size: .86rem;
  border-radius: 10px;
}

/* ============ HERO ============ */
.hero {
  padding: 24px 0 0;
}

.hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #fff;
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  overflow: hidden;
  position: relative;
}

.hero-card::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -80px;
  top: -80px;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 65%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
  font-weight: 800;
  font-size: .86rem;
  margin-bottom: 14px;
}

.hero-content h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.1;
  font-weight: 800;
}

.hero-content p {
  margin: 0;
  color: rgba(255,255,255,.88);
  max-width: 680px;
  line-height: 1.8;
  font-size: .96rem;
}

.hero-features {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-features span {
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.14);
  font-weight: 700;
  font-size: .85rem;
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 12px;
  min-width: 300px;
  max-width: 380px;
  width: 100%;
}

.stat-card {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  padding: 18px 14px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.stat-card strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.stat-card span {
  font-size: .86rem;
  color: rgba(255,255,255,.85);
}

/* ============ LAYOUT ============ */
.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 22px;
  align-items: start;
  margin: 22px auto 40px;
}

.editor-panel, .preview-panel {
  min-width: 0;
}

.panel-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sticky-card {
  position: sticky;
  top: 96px;
}

.panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #fff 0%, #fcfdff 100%);
}

.panel-header h3 {
  margin: 0 0 5px;
  font-size: 1.1rem;
  font-weight: 800;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: .9rem;
}

.panel-body {
  padding: 20px;
}

/* ============ SCORE ============ */
.score-box {
  min-width: 210px;
  max-width: 240px;
  width: 100%;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
  font-size: .9rem;
  margin-bottom: 8px;
}

.score-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #16a34a);
  border-radius: 999px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

.score-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}

/* ============ FORM BLOCKS ============ */
.form-block {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 16px;
  margin-bottom: 14px;
}

.form-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.form-block-head h4 {
  margin: 0;
  font-size: .98rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  font-size: .88rem;
  font-weight: 700;
  color: var(--dark-2);
}

.field small {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.55;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: .93rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.field textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.7;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37,99,235,.08);
}

#summary { min-height: 120px; }
#skills { min-height: 90px; }

/* ============ DYNAMIC ITEMS ============ */
.item-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  margin-bottom: 12px;
  transition: box-shadow .2s;
}

.item-card:last-child {
  margin-bottom: 0;
}

.item-card:hover {
  box-shadow: 0 4px 16px rgba(15,23,42,.06);
}

.item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.item-top strong {
  font-size: .88rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.remove-btn {
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 8px;
  padding: 5px 11px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: .15s;
  font-family: var(--font);
}

.remove-btn:hover {
  background: #fecaca;
}

/* ============ PREVIEW SHELL ============ */
.preview-shell {
  padding: 18px;
  background: #e8edf4;
  overflow-x: auto;
  min-height: 400px;
}

/* ============ RESUME PAPER ============ */
.resume-paper {
  width: var(--resume-width);
  min-height: 297mm;
  max-width: 100%;
  margin: auto;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 22px 60px rgba(15,23,42,.14);
  padding: 22mm 18mm 20mm;
  line-height: 1.55;
  border-radius: 8px;
  font-family: Arial, Helvetica, sans-serif;
  transition: .22s ease;
}

.resume-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 13px;
  margin-bottom: 18px;
  text-align: center;
}

.resume-header h1 {
  margin: 0 0 6px;
  font-size: 2rem;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: .2px;
  color: #0f172a;
}

.cv-role {
  margin: 0 0 10px;
  font-size: .98rem;
  color: #334155;
  font-weight: 700;
}

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  color: #475569;
  font-size: .88rem;
  line-height: 1.6;
}

.cv-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.resume-section {
  margin-top: 18px;
}

.resume-section h2 {
  margin: 0 0 9px;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  border-bottom: 1.5px solid #cbd5e1;
  padding-bottom: 6px;
  color: #0f172a;
  font-weight: 800;
}

.resume-section p {
  margin: 0;
  font-size: .92rem;
  white-space: pre-line;
  line-height: 1.72;
  color: #111827;
}

.resume-item {
  margin-bottom: 12px;
}

.resume-item:last-child {
  margin-bottom: 0;
}

.resume-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.resume-item-title {
  font-weight: 800;
  font-size: .94rem;
  line-height: 1.4;
  color: #0f172a;
}

.resume-item-sub {
  color: #475569;
  font-size: .88rem;
  font-weight: 700;
  margin-top: 1px;
}

.resume-item-date {
  white-space: nowrap;
  color: #475569;
  font-size: .86rem;
  font-weight: 700;
  flex-shrink: 0;
}

.resume-item-desc {
  font-size: .88rem;
  white-space: pre-line;
  color: #374151;
  line-height: 1.68;
  margin-top: 4px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d6deea;
  background: #f8fafc;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: .84rem;
  line-height: 1.3;
  color: #1e293b;
  font-weight: 600;
}

/* ============ TEMPLATE VARIANTS ============ */
.template-classic .resume-header {
  border-bottom: 2px solid #111827;
}

.template-classic .resume-section h2 {
  color: #111827;
  border-bottom: 1px solid #cbd5e1;
}

.template-modern .resume-header {
  border-bottom: 3px solid #2563eb;
}

.template-modern .resume-header h1 {
  color: #1e3a8a;
}

.template-modern .resume-section h2 {
  color: #1d4ed8;
  border-bottom: 1.5px solid #bfdbfe;
}

.template-modern .tag {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.template-compact {
  font-size: .93rem;
  padding: 16mm 14mm 14mm;
}

.template-compact .resume-header {
  margin-bottom: 12px;
  padding-bottom: 9px;
}

.template-compact .resume-header h1 {
  font-size: 1.7rem;
}

.template-compact .resume-section {
  margin-top: 13px;
}

.template-compact .resume-section h2 {
  font-size: .84rem;
  margin-bottom: 7px;
}

.template-compact .resume-item {
  margin-bottom: 9px;
}

/* ============ SECTION VISIBILITY ============ */
.resume-section.empty-section {
  display: none;
}

/* ============ FOOTER ============ */
.site-footer {
  padding: 8px 0 30px;
}

.footer-inner {
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
}

/* ============ RTL SUPPORT ============ */
html[dir="rtl"] body {
  text-align: right;
}

html[dir="rtl"] .brand {
  flex-direction: row-reverse;
}

html[dir="rtl"] .topbar-inner {
  flex-direction: row-reverse;
}

html[dir="rtl"] .topbar-actions {
  flex-direction: row-reverse;
}

html[dir="rtl"] .form-block-head,
html[dir="rtl"] .panel-header,
html[dir="rtl"] .item-top,
html[dir="rtl"] .score-row,
html[dir="rtl"] .resume-item-head {
  direction: rtl;
}

html[dir="rtl"] .cv-contact,
html[dir="rtl"] .tag-list,
html[dir="rtl"] .hero-features,
html[dir="rtl"] .lang-switch,
html[dir="rtl"] .topbar-actions {
  direction: rtl;
}

html[dir="rtl"] .resume-section h2 {
  letter-spacing: 0;
}

html[dir="rtl"] .resume-paper {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .resume-item-date {
  white-space: normal;
}

html[dir="rtl"] .hero-card {
  text-align: right;
}

html[dir="rtl"] .hero-features {
  justify-content: flex-start;
}

html[dir="rtl"] .ai-panel {
  right: auto;
  left: 0;
  box-shadow: 20px 0 60px rgba(15,23,42,.18);
  transform: translateX(-100%);
}

html[dir="rtl"] .ai-panel.open {
  transform: translateX(0);
}

html[dir="rtl"] .toast-container {
  right: auto;
  left: 28px;
}

html[dir="rtl"] .ai-section-body ul {
  padding-left: 0;
  padding-right: 18px;
}

/* ============ HIDDEN ============ */
.hidden {
  display: none !important;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1250px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sticky-card {
    position: relative;
    top: 0;
  }

  .resume-paper {
    width: 100%;
    min-height: auto;
  }
}

@media (max-width: 860px) {
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-card {
    padding: 24px;
  }

  .panel-body,
  .panel-header,
  .preview-shell {
    padding: 16px;
  }

  .resume-paper {
    padding: 16px 13px;
  }

  .resume-header h1 {
    font-size: 1.55rem;
  }

  .topbar-inner {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 20px, 1440px);
  }

  .topbar-actions {
    width: 100%;
  }

  .template-select,
  .btn,
  .lang-btn {
    width: 100%;
  }

  .lang-switch {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero-content h2 {
    font-size: 1.55rem;
  }

  .hero-card {
    border-radius: 20px;
    padding: 20px;
  }

  .form-block {
    padding: 14px;
  }

  .hero-stats {
    min-width: unset;
    max-width: 100%;
    width: 100%;
  }
}

/* ============ PRINT ============ */
@media print {
  body {
    background: #fff;
  }

  .topbar,
  .hero,
  .editor-panel,
  .site-footer,
  .ai-panel,
  .ai-overlay,
  .toast-container {
    display: none !important;
  }

  .app-layout {
    display: block;
    margin: 0;
    width: 100%;
  }

  .panel-card,
  .preview-panel {
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  .preview-shell {
    background: #fff !important;
    padding: 0 !important;
  }

  .resume-paper {
    box-shadow: none !important;
    width: auto !important;
    max-width: none !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 14mm 12mm !important;
    border-radius: 0 !important;
  }
}