@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@400;500;600;700&family=Noto+Sans+Arabic:wght@300;400;500;600;700&display=swap');

:root {
  --navy: #081725;
  --navy-2: #10283a;
  --teal: #52dccc;
  --teal-deep: #14827f;
  --paper: #fbfaf6;
  --ink: #142a39;
  --muted: #6b7b82;
  --line: #dce3df;
  --body: "Noto Sans Arabic", Tahoma, sans-serif;
  --display: "Noto Kufi Arabic", "Noto Sans Arabic", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--navy); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--navy); font-family: var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.workspace { min-height: 100vh; position: relative; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; gap: 12px; padding: 14px 22px 22px; background: radial-gradient(circle at 12% 18%, rgba(82,220,204,.12), transparent 26%), radial-gradient(circle at 90% 82%, rgba(82,220,204,.08), transparent 30%), #07131e; }
.workspace::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .14; background-image: linear-gradient(rgba(125,174,177,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(125,174,177,.16) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(145deg, #000, transparent 70%); }
.page-tools { position: relative; z-index: 20; width: min(210mm, 100%); }
.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.tool-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 8px 13px; border: 1px solid rgba(255,255,255,.2); border-radius: 3px 11px 3px 11px; box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: 12px; font-weight: 700; cursor: pointer; transition: transform .2s ease, background .2s ease, opacity .2s ease; }
.tool-button:hover:not(:disabled) { transform: translateY(-1px); }
.tool-button:focus-visible, .editor-panel button:focus-visible, .editor-panel input:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.edit-button { color: #eef8f5; background: #173448; }
.login-button { color: var(--navy); background: #e5f7f3; }
.owner-only { display: none !important; }
.is-owner .owner-only { display: inline-flex !important; }
.is-owner .login-button { display: none !important; }
.edit-button[aria-pressed="true"] { color: var(--navy); background: #b8f4eb; }
.save-button { color: #eff9f6; background: #14827f; }
.save-button:disabled { opacity: .48; cursor: not-allowed; }
.publish-button { color: #fff; background: #8a5d24; }
.print-button { color: var(--navy); background: var(--teal); }
.editor-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 14px; margin-top: 9px; padding: 11px 13px; color: #eaf4f1; border: 1px solid rgba(82,220,204,.3); border-radius: 3px 14px 3px 14px; background: rgba(13,33,47,.96); box-shadow: 0 12px 30px rgba(0,0,0,.24); }
.editor-panel[hidden] { display: none !important; }
.editor-guidance, .local-save-note { margin: 0; color: #cadad8; font-size: 11px; line-height: 1.6; }
.editor-guidance { grid-column: 1 / -1; }
.add-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.add-controls button { padding: 5px 8px; color: #eaf7f4; border: 1px solid rgba(82,220,204,.25); border-radius: 3px 8px; background: #153548; font-size: 10px; cursor: pointer; }
.add-controls button:hover { color: var(--navy); background: var(--teal); }
.photo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.photo-picker, .photo-restore { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 6px 9px; color: #eaf7f4; border: 1px solid rgba(82,220,204,.25); border-radius: 3px 8px; background: #153548; font-size: 10px; cursor: pointer; }
.photo-picker:hover, .photo-restore:hover { color: var(--navy); background: var(--teal); }
.photo-picker:focus-within { outline: 2px solid #fff; outline-offset: 2px; }
.photo-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.photo-restore { font: inherit; font-size: 10px; }
.photo-help { grid-column: 1 / -1; margin: 0; color: #cadad8; font-size: 10px; line-height: 1.5; }
.linkedin-editor { display: flex; align-items: center; gap: 7px; color: #a9cfca; font-size: 10px; }
.linkedin-editor input { width: 220px; max-width: 50vw; padding: 6px 8px; color: #102a3a; border: 1px solid #a9cfca; border-radius: 3px; background: #f7fbf9; font: 11px Arial, sans-serif; }
.local-save-note { align-self: center; font-size: 10px; }
.editor-status { min-height: 0; margin: 5px 0 0; color: #9fe8dc; font-size: 10px; }
.editor-status:empty { display: none; }
.print-button:hover { transform: translateY(-2px); background: #8af0e5; }
.print-button span { font-size: 16px; }
.resume-page { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3.4mm; width: 210mm; min-height: 297mm; padding: 9mm 10mm 7mm; overflow: visible; background: var(--paper); box-shadow: 0 22px 75px rgba(0,0,0,.38); color: var(--ink); }
.resume-page::before { content: ""; position: absolute; z-index: -0; top: 50mm; left: -32mm; width: 82mm; height: 82mm; border: 1px solid rgba(20,130,127,.07); border-radius: 50%; box-shadow: 0 0 0 8mm rgba(20,130,127,.025), 0 0 0 17mm rgba(20,130,127,.018); pointer-events: none; }
.resume-page > * { position: relative; z-index: 1; }
.resume-header { position: relative; display: flex; flex: 0 0 43mm; align-items: center; gap: 7mm; min-height: 43mm; overflow: hidden; padding: 5mm 7mm; color: #f4f8f6; background: linear-gradient(112deg, #081725 0%, #102b3d 66%, #164346 100%); border-radius: 2mm 7mm 2mm 7mm; }
.resume-header::before { content: ""; position: absolute; left: -17mm; top: -33mm; width: 75mm; height: 75mm; border: 1px solid rgba(82,220,204,.24); border-radius: 50%; box-shadow: 0 0 0 5mm rgba(82,220,204,.035), 0 0 0 12mm rgba(82,220,204,.025); }
.resume-header::after { content: ""; position: absolute; inset: 0; opacity: .13; background: repeating-linear-gradient(135deg, transparent 0 8mm, rgba(225,245,242,.14) 8.1mm 8.2mm); mask-image: linear-gradient(270deg, #000, transparent 72%); pointer-events: none; }
.header-ornament { position: absolute; right: 2mm; top: 0; bottom: 0; width: 1px; background: linear-gradient(transparent, rgba(82,220,204,.65), transparent); }
.identity-block { position: relative; z-index: 2; flex: 1; min-width: 0; }
.brandline { display: flex; align-items: center; gap: 2.5mm; margin-bottom: 1mm; }
.brand-mark { width: 9mm; height: 9mm; display: inline-grid; place-items: center; flex: 0 0 9mm; color: var(--teal); border: 1px solid rgba(82,220,204,.75); border-radius: 2mm 2mm 2mm .5mm; font-family: var(--display); font-size: 7pt; font-weight: 700; letter-spacing: -.08em; transform: rotate(-4deg); }
.brand-caption { display: flex; align-items: center; gap: 2mm; color: rgba(236,246,243,.69); font-size: 7pt; }
.brand-caption i { display: inline-block; width: 5mm; height: 1px; background: var(--teal); }
.identity-block h1 { margin: 0; color: #f5f7f4; font-family: var(--display); font-size: 24pt; font-weight: 600; line-height: 1.4; letter-spacing: -.045em; }
.current-role h3[data-field="currentRoleTitle"] { white-space: pre-line; }
.professional-title { display: flex; align-items: center; flex-wrap: wrap; gap: 1.8mm; margin: .7mm 0 2.2mm; color: #c4d7d8; font-size: 8.2pt; }
.professional-title b { display: inline-block; width: 1mm; height: 1mm; border-radius: 50%; background: var(--teal); }
.contact-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 1.8mm 4mm; }
.contact-strip a { display: inline-flex; align-items: center; gap: 1.2mm; color: #f3f7f3; font-size: 7pt; transition: color .15s ease; }
.contact-strip a:hover { color: var(--teal); }
.contact-icon { display: inline-grid; place-items: center; width: 4mm; height: 4mm; color: var(--teal); border: 1px solid rgba(82,220,204,.34); border-radius: 50%; font-family: Arial, sans-serif; font-size: 7pt; line-height: 1; }
.portrait-frame { position: relative; z-index: 2; flex: 0 0 27mm; width: 27mm; height: 34mm; margin: 0; overflow: hidden; border: 1px solid rgba(82,220,204,.72); border-radius: 14mm 14mm 2mm 2mm; background: #d8e0e0; box-shadow: 0 0 0 1.5mm rgba(82,220,204,.11); }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 9%; }
.portrait-frame figcaption { position: absolute; right: 0; bottom: 0; left: 0; display: flex; justify-content: center; gap: 1mm; padding: .8mm 1mm; color: var(--navy); background: rgba(82,220,204,.92); font-family: Arial, sans-serif; font-size: 5.8pt; font-weight: 700; letter-spacing: .08em; }
.portrait-frame figcaption span { color: #25434a; font-size: 5pt; }
.header-stamp { position: absolute; left: 5mm; bottom: 3mm; display: flex; align-items: center; gap: 1.5mm; color: rgba(241,249,246,.36); font-family: Arial, sans-serif; font-size: 6pt; letter-spacing: .12em; }
.header-stamp i { width: 5mm; height: 1px; background: var(--teal); }

.objective-section { display: grid; grid-template-columns: 34mm minmax(0, 1fr); align-items: start; gap: 4mm; padding: 2mm 1mm 3.2mm; border-bottom: 1px solid var(--line); }
.section-label { display: flex; align-items: center; gap: 2mm; padding-top: .4mm; }
.section-label > span, .section-number { color: var(--teal-deep); font-family: Arial, sans-serif; font-size: 7pt; font-weight: 700; letter-spacing: .08em; }
.section-label h2 { margin: 0; color: var(--ink); font-family: var(--display); font-size: 9pt; font-weight: 600; }
.objective-section > p { margin: 0; color: #4b5e65; font-size: 8pt; line-height: 1.7; }
.resume-grid { display: grid; grid-template-columns: minmax(0, 1fr) 58mm; gap: 5mm; flex: 1 1 auto; min-height: 0; }
.primary-column, .sidebar { min-width: 0; }
.primary-column { display: flex; flex-direction: column; gap: 3.5mm; }
.experience-section { display: flex; flex: 1 1 auto; flex-direction: column; }
.sidebar { display: flex; flex-direction: column; gap: 3.1mm; padding-right: 4mm; border-right: 1px solid var(--line); }
.resume-section { min-width: 0; }
.section-heading { display: flex; align-items: center; gap: 2mm; margin-bottom: 2mm; }
.section-number { display: inline-flex; justify-content: center; align-items: center; width: 6mm; height: 6mm; flex: 0 0 6mm; color: var(--teal-deep); border: 1px solid rgba(20,130,127,.27); border-radius: 50%; font-size: 6pt; }
.section-heading > div { min-width: max-content; }
.section-heading > div p { margin: 0; color: #7b898c; font-size: 6pt; line-height: 1.25; }
.section-heading h2 { margin: 0; color: var(--ink); font-family: var(--display); font-size: 10pt; font-weight: 600; line-height: 1.5; }
.heading-line { height: 1px; flex: 1; margin-right: 1mm; background: linear-gradient(90deg, var(--line), rgba(20,130,127,.5)); }
.current-role { position: relative; margin-bottom: 1.3mm; padding: 2.1mm 3mm 2mm; color: #f4f8f6; background: linear-gradient(105deg, #10283a, #143943); border-right: 1mm solid var(--teal); border-radius: 1mm 3mm 1mm 1mm; }
.current-role::after { content: ""; position: absolute; left: 2mm; top: 2mm; width: 12mm; height: 12mm; border: 1px solid rgba(82,220,204,.16); border-radius: 50%; }
.current-tag { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 1.5mm; margin-bottom: .6mm; color: var(--teal); font-size: 6pt; font-weight: 600; }
.current-tag i { width: 1mm; height: 1mm; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 1mm rgba(82,220,204,.12); }
.current-role h3 { position: relative; z-index: 1; margin: 0; color: #f5f7f4; font-family: var(--display); font-size: 9.5pt; font-weight: 500; line-height: 1.6; }
.current-role p { position: relative; z-index: 1; margin: .5mm 0 0; color: rgba(236,245,241,.7); font-size: 7pt; line-height: 1.55; }
.experience-list { display: flex; flex: 1 1 auto; flex-direction: column; justify-content: space-between; gap: 0; margin: 0; padding: 0; list-style: none; }
.experience-list li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 2mm; min-height: 13mm; padding: 1.2mm 3mm 1.2mm 1mm; border-bottom: 1px solid rgba(20,42,57,.1); }
.experience-list li::before { content: ""; position: absolute; top: 50%; right: 0; width: 1mm; height: 1mm; border-radius: 50%; background: var(--teal-deep); transform: translateY(-50%); }
.experience-list strong { color: #1c3544; font-size: 8pt; font-weight: 700; line-height: 1.5; }
.experience-list li > span { color: #738186; font-size: 7.2pt; line-height: 1.5; }
.experience-list small { color: #738186; font-size: 6pt; font-weight: 400; }
.education-section { padding-top: 2mm; border-top: 1px solid rgba(20,42,57,.13); }
.education-list { display: grid; grid-template-columns: 1fr; gap: .7mm; margin: 0; padding: 0; list-style: none; }
.education-list li { display: flex; align-items: baseline; gap: 2mm; color: #324b56; font-size: 7.5pt; line-height: 1.55; }
.education-dot { position: relative; top: -1px; width: 1.1mm; height: 1.1mm; flex: 0 0 1.1mm; border-radius: 50%; background: var(--teal-deep); }
.education-list b { color: #69797d; font-family: Arial, sans-serif; font-size: 6.2pt; font-weight: 500; }

.compact-heading { gap: 1.8mm; margin-bottom: 1.6mm; }
.compact-heading .section-number { width: 5.6mm; height: 5.6mm; flex-basis: 5.6mm; }
.compact-heading > div p { font-size: 5.8pt; }
.compact-heading h2 { font-size: 8.4pt; }
.skill-section { display: flex; flex: 1 1 auto; flex-direction: column; padding-bottom: 2.4mm; border-bottom: 1px solid var(--line); }
.skill-list { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-content: space-between; align-items: flex-start; gap: 1.7mm; margin: 0; padding: 0; list-style: none; }
.skill-list li { position: relative; max-width: 100%; padding: 1.35mm 2mm 1.35mm 1.7mm; color: #38515a; border: 1px solid rgba(20,42,57,.11); border-radius: .5mm 2mm .5mm 2mm; background: rgba(255,255,255,.72); font-size: 7.1pt; line-height: 1.5; }
.skill-list li::before { content: ""; display: inline-block; width: .8mm; height: .8mm; margin-left: 1mm; border-radius: 50%; vertical-align: middle; background: var(--teal-deep); }
.personal-section .skill-list li::before { background: #75959a; }
.language-section { margin-top: auto; }
.language-list { display: flex; flex-wrap: wrap; gap: 2mm; }
.language-list > span { display: inline-flex; align-items: baseline; gap: 1.4mm; padding: 1.3mm 2.2mm; color: #1c3947; border-right: 1px solid var(--teal-deep); background: rgba(20,130,127,.07); font-size: 7.7pt; font-weight: 700; }
.language-list small { color: #718086; font-size: 5.8pt; font-weight: 400; }
.resume-footer { display: flex; align-items: center; gap: 1.8mm; min-height: 4mm; padding-top: 1mm; color: #768489; border-top: 1px solid var(--line); font-size: 5.8pt; }
.resume-footer > i { width: .8mm; height: .8mm; border-radius: 50%; background: var(--teal-deep); }
.resume-footer > span:first-child { color: #36505a; font-weight: 600; }
.footer-mark { margin-right: auto; color: var(--teal-deep); font-family: Arial, sans-serif; font-size: 5.6pt; letter-spacing: .1em; }
.is-editing [data-field], .is-editing [data-item-field] { outline: 1px dashed rgba(82,220,204,.8); outline-offset: 2px; cursor: text; }
.is-editing [data-field]:focus, .is-editing [data-item-field]:focus { outline: 2px solid var(--teal); background: rgba(82,220,204,.08); }
.remove-item { display: none; flex: 0 0 auto; align-items: center; justify-content: center; width: 5mm; height: 5mm; padding: 0; color: #fff; border: 0; border-radius: 50%; background: #b64d4d; font: 14px/1 Arial, sans-serif; cursor: pointer; }
.is-editing .remove-item { display: inline-flex; }
.experience-list .remove-item { position: absolute; left: 1mm; top: 50%; transform: translateY(-50%); }
.education-list li { position: relative; padding-left: 7mm; }
.education-list .remove-item, .skill-list .remove-item { position: absolute; left: 1mm; top: 50%; transform: translateY(-50%); }
.skill-list li { padding-left: 7mm; }
.language-item { position: relative; }
.language-item .remove-item { width: 4mm; height: 4mm; margin-right: 1mm; font-size: 12px; }

@media (max-width: 850px) {
  .workspace { padding: 15px; }
  .resume-page { width: min(100%, 210mm); height: auto; min-height: 297mm; }
}

@media (max-width: 620px) {
  .workspace { padding: 12px 9px 14px; }
  .page-tools { width: 100%; }
  .editor-toolbar { gap: 6px; }
  .editor-toolbar .tool-button { flex: 1 1 auto; }
  .editor-panel { grid-template-columns: 1fr; gap: 9px; padding: 10px; }
  .add-controls button { flex: 1 1 auto; }
  .photo-controls > * { flex: 1 1 auto; }
  .photo-picker, .photo-restore { width: 100%; }
  .linkedin-editor { flex-wrap: wrap; }
  .linkedin-editor input { flex: 1 1 100%; width: 100%; max-width: none; }
  .print-button { padding: 9px 12px; font-size: 11px; }
  .resume-page { width: 100%; min-height: 0; height: auto; padding: 5mm 4.5mm; gap: 3mm; }
  .resume-header { min-height: 37mm; flex-basis: 37mm; gap: 4mm; padding: 4mm; }
  .portrait-frame { flex-basis: 23mm; width: 23mm; height: 30mm; }
  .identity-block h1 { font-size: clamp(15pt, 6vw, 20pt); }
  .professional-title { gap: 1.1mm; margin-block: .7mm 1.7mm; font-size: 6.6pt; }
  .contact-strip { gap: 1mm 2mm; }
  .contact-strip a { gap: .8mm; font-size: 5.8pt; }
  .contact-icon { width: 3.4mm; height: 3.4mm; font-size: 6pt; }
  .brand-mark { width: 7mm; height: 7mm; flex-basis: 7mm; font-size: 6pt; }
  .brand-caption { font-size: 5.8pt; }
  .objective-section { grid-template-columns: 25mm minmax(0, 1fr); gap: 2mm; padding-block: 1.5mm 2.5mm; }
  .section-label { gap: 1mm; }
  .section-label h2 { font-size: 7.6pt; }
  .objective-section > p { font-size: 6.8pt; line-height: 1.65; }
  .resume-grid { grid-template-columns: 1fr; gap: 4mm; }
  .primary-column { gap: 3mm; }
  .sidebar { padding: 3mm 0 0; border-right: 0; border-top: 1px solid var(--line); }
  .experience-list li { min-height: 9.8mm; gap: 1.5mm; }
  .experience-list strong { font-size: 7pt; }
  .experience-list li > span { font-size: 6.2pt; }
  .current-role h3 { font-size: 8pt; }
  .education-list li { font-size: 7pt; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 3mm; }
  .language-section { grid-column: 1 / -1; margin-top: 0; }
  .skill-section { padding-bottom: 2mm; }
  .skill-list li { font-size: 6.1pt; }
  .resume-footer { font-size: 5.2pt; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { width: 210mm; min-height: 297mm; height: auto; margin: 0; padding: 0; overflow: visible; background: #fff; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .workspace { width: 210mm; height: auto; min-height: 297mm; margin: 0; padding: 0; display: block; overflow: visible; background: #fff; }
  .workspace::before, .page-tools { display: none !important; }
  .resume-page { width: 210mm; height: auto; min-height: 297mm; max-height: none; margin: 0; padding: 8mm 9mm 6mm; gap: 2.8mm; overflow: visible; box-shadow: none; break-inside: auto; }
  .resume-header { flex-basis: 41mm; min-height: 41mm; padding: 4.5mm 6mm; }
  .identity-block h1 { font-size: 22pt; }
  .professional-title { font-size: 7.7pt; }
  .contact-strip a { font-size: 6.6pt; }
  .portrait-frame { flex-basis: 25mm; width: 25mm; height: 32mm; }
  .objective-section { padding-block: 1.5mm 2.5mm; }
  .objective-section > p { font-size: 7.4pt; line-height: 1.58; }
  .resume-grid { grid-template-columns: minmax(0, 1fr) 56mm; gap: 4mm; }
  .primary-column { gap: 2.7mm; }
  .sidebar { gap: 2.4mm; padding-right: 3mm; }
  .section-heading { margin-bottom: 1.5mm; }
  .section-heading h2 { font-size: 8.8pt; }
  .section-heading > div p { font-size: 5.6pt; }
  .current-role { padding: 1.6mm 2.5mm; }
  .current-role h3 { font-size: 8.2pt; }
  .current-role p { font-size: 5.8pt; }
  .experience-list li { min-height: 13mm; padding-block: 1mm; break-inside: avoid; }
  .experience-list strong { font-size: 7.8pt; }
  .experience-list li > span { font-size: 7pt; }
  .education-list li { font-size: 7.3pt; }
  .education-list li, .skill-list li { break-inside: avoid; }
  .skill-list { gap: 1.5mm; }
  .skill-list li { padding: 1.15mm 1.5mm; font-size: 7pt; }
  .language-list > span { font-size: 7pt; }
  .resume-footer { font-size: 5.4pt; }
  .remove-item { display: none !important; }
  [contenteditable] { outline: none !important; }
  a { color: inherit; }
}
