/* صانع السيرة الذاتية — واجهة التحرير (تنسيق النماذج نفسها داخل cv-maker.js) */
.cvb { --cvc: #0d9488; position: relative; min-height: 420px; }
.cvb-loading { padding: 60px 0; text-align: center; color: var(--muted); }
.cvb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: border-color .15s, color .15s, background .15s; }
.cvb-btn:hover { border-color: var(--cvc); color: var(--cvc); }
.cvb-btn.danger:hover { border-color: #dc2626; color: #dc2626; }
.cvb-pri { background: var(--cvc); border-color: var(--cvc); color: #fff; }
.cvb-pri:hover { color: #fff; filter: brightness(1.08); }
.cvb-big { padding: 11px 20px; font-size: .95rem; }

/* معرض النماذج */
.cvg { max-width: 1120px; margin: 0 auto; padding: 8px 0 10px; text-align: center; }
.cvg-resume { margin-bottom: 18px; }
.cvg-h { margin: 0; font-size: 1.35rem; }
.cvg-sub { margin: 6px 0 22px; color: var(--muted); }
.cvg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.cvg-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text); text-align: center; transition: transform .18s, box-shadow .18s, border-color .18s; }
.cvg-card:hover, .cvg-card:focus-visible { transform: translateY(-4px); border-color: var(--cvc); box-shadow: 0 18px 36px rgba(20, 22, 40, .12); outline: none; }
.cvg-thumb { position: relative; display: block; width: 100%; aspect-ratio: 794 / 1123; overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 2px 10px rgba(20, 22, 40, .1); }
.cvg-scale { position: absolute; top: 0; left: 0; width: 794px; transform-origin: 0 0; transform: scale(var(--gs, .27)); pointer-events: none; }
.cvg-name { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 1.02rem; }
.cvg-dot { width: 10px; height: 10px; border-radius: 50%; }
.cvg-use { padding: 9px 12px; border-radius: 10px; background: color-mix(in srgb, var(--cvc) 10%, transparent); color: var(--cvc); font-weight: 700; font-size: .88rem; }
.cvg-card:hover .cvg-use { background: var(--cvc); color: #fff; }

/* مساحة العمل */
.cvw { display: flex; flex-direction: column; height: 100%; min-height: 640px; }
.cvb.cvb-full { position: fixed; z-index: 45; inset: var(--pdx-top, 0px) 0 0 0; min-height: 0; margin: 0; background: var(--surface-2); }
.cvb-full .cvw { min-height: 0; }
.cvt { display: flex; align-items: center; gap: 10px 14px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.cvt-g { display: flex; align-items: flex-end; gap: 10px 14px; flex-wrap: wrap; flex: 1; min-width: 0; }
.cvt-f { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.cvt-f > span { font-size: .7rem; font-weight: 700; color: var(--muted); }
.cvt-f select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: .86rem; max-width: 170px; }
.cvsw { display: flex; align-items: center; gap: 5px; padding: 3px 0; }
.cvsw button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.cvsw button.on { box-shadow: 0 0 0 2px var(--text); }
.cvsw-c { position: relative; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); box-shadow: 0 0 0 1px var(--border); cursor: pointer; margin: 0; }
.cvsw-c input { position: absolute; inset: -6px; width: 40px; height: 40px; opacity: 0; cursor: pointer; }
.cvt-dl { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.cvt-pages { font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.cvt-pages.warn { color: #b45309; }
.cvdd { position: relative; }
.cvdd-t { padding: 11px 10px; }
.cvdd-m { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 20; width: 330px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 40px rgba(20, 22, 40, .16); }
.cvdd-m button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: .88rem; text-align: start; cursor: pointer; line-height: 1.5; }
.cvdd-m button:hover { background: var(--surface-2); color: var(--cvc); }
.cvm-tabs { display: none; }
.cvw-b { flex: 1; min-height: 0; display: grid; grid-template-columns: 440px minmax(0, 1fr); }
.cvw-ed { overflow-y: auto; padding: 16px; background: var(--surface); border-inline-end: 1px solid var(--border); }
.cvw-pv { overflow: auto; padding: 24px 20px 40px; display: flex; justify-content: center; align-items: flex-start; }
.cvpaper { position: relative; flex-shrink: 0; background: #fff; box-shadow: 0 10px 40px rgba(20, 22, 40, .16); }
.cvbrk { position: absolute; inset-inline: -14px; height: 0; border-top: 2px dashed #f59e0b; pointer-events: none; }
.cvbrk span { position: absolute; top: -11px; inset-inline-end: 18px; padding: 1px 8px; border-radius: 6px; background: #f59e0b; color: #fff; font-size: .68rem; font-weight: 700; }

/* لوحة التحرير */
.cvs { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.cvs > summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; list-style: none; user-select: none; }
.cvs > summary::-webkit-details-marker { display: none; }
.cvs > summary b { flex: 1; font-size: .95rem; }
.cvs > summary > svg { transition: transform .2s; color: var(--muted); }
.cvs[open] > summary > svg { transform: rotate(180deg); }
.cvs.is-hidden > summary b { opacity: .45; text-decoration: line-through; }
.cvs-a { display: inline-flex; gap: 2px; }
.cvs-a button, .cvi-a button { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; }
.cvs-a button:hover:not(:disabled), .cvi-a button:hover:not(:disabled) { background: var(--surface-2); color: var(--cvc); }
.cvs-a button:disabled, .cvi-a button:disabled { opacity: .3; cursor: default; }
.cvs-b { padding: 4px 14px 14px; display: grid; gap: 10px; }
.cvf { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.cvf > span { font-size: .78rem; font-weight: 600; color: var(--muted); }
.cvf input, .cvf textarea, .cvr input[type=text], .cvr select, .cvph select { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--text); font: inherit; font-size: .92rem; transition: border-color .15s, box-shadow .15s; }
.cvf input:focus, .cvf textarea:focus, .cvr input:focus, .cvr select:focus { outline: 0; border-color: var(--cvc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cvc) 18%, transparent); background: var(--surface); }
.cvf textarea { resize: vertical; line-height: 1.6; }
.cvf input:disabled { opacity: .5; }
.cvf-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cvc { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .88rem; font-weight: 500; cursor: pointer; }
.cvph { display: flex; align-items: center; gap: 14px; }
.cvph-i { display: grid; place-items: center; width: 74px; height: 74px; flex-shrink: 0; border-radius: 50%; overflow: hidden; background: var(--surface-2); color: var(--muted); border: 2px dashed var(--border); }
.cvph-i img { width: 100%; height: 100%; object-fit: cover; }
.cvph-a { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cvph-a select { width: auto; padding: 8px 10px; }
.cvi { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--bg); }
.cvi-h { display: flex; align-items: center; gap: 6px; padding: 8px 10px; cursor: pointer; }
.cvi-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cvi-t b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cvi-t small { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cvi-a { display: inline-flex; gap: 0; }
.cvi-h > svg { color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.cvi.open .cvi-h > svg { transform: rotate(180deg); }
.cvi-b { display: none; padding: 4px 10px 12px; gap: 10px; }
.cvi.open .cvi-b { display: grid; }
.cvb-add { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 10px; border: 1.5px dashed color-mix(in srgb, var(--cvc) 45%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--cvc) 4%, transparent); color: var(--cvc); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; }
.cvb-add:hover { background: color-mix(in srgb, var(--cvc) 10%, transparent); }
.cvr { display: grid; gap: 8px; }
.cvr-r { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 8px; align-items: center; }
.cvr-r input[type=range] { width: 100%; accent-color: var(--cvc); }
.cvs-data { padding: 14px; background: var(--surface-2); }
.cvd { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.cvd label.cvb-btn { margin: 0; }
.cvs-note { margin: 0; font-size: .8rem; color: var(--muted); }
.cvb-saved { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; margin-inline-end: 4px; }
.cvw-busy { position: absolute; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 12px; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(2px); }
.cvw-busy[hidden] { display: none; }
.cvw-busy p { margin: 0; font-weight: 700; }
.cvw-spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid color-mix(in srgb, var(--cvc) 20%, transparent); border-top-color: var(--cvc); animation: cvspin .8s linear infinite; }
@keyframes cvspin { to { transform: rotate(360deg); } }
.cvb-toast { position: fixed; z-index: 9500; bottom: 24px; left: 50%; translate: -50% 0; max-width: min(560px, 92vw); padding: 12px 18px; border-radius: 12px; background: #22242f; color: #fff; font-size: .9rem; font-weight: 600; line-height: 1.6; box-shadow: 0 14px 30px rgba(0, 0, 0, .25); }

@media (max-width: 1180px) { .cvw-b { grid-template-columns: 380px minmax(0, 1fr); } .cvt-l { display: none; } }
@media (max-width: 900px) {
  .cvt { padding: 8px 10px; gap: 8px; }
  .cvt-g { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .cvt-f { flex-shrink: 0; }
  .cvm-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); background: var(--surface); }
  .cvm-tabs button { padding: 11px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
  .cvm-tabs button.on { color: var(--cvc); border-bottom-color: var(--cvc); }
  .cvw-b { grid-template-columns: 1fr; }
  .cvw-pvw { display: none; } .cvw-pv { padding: 14px 10px 70px; }
  .cvw.show-pv .cvw-pvw { display: flex; } .cvw.show-pv .cvw-ed { display: none; }
  .cvw-ed { border: 0; padding: 12px; }
  .cvdd-m { width: min(330px, 92vw); }
  .cvb-big { padding: 10px 14px; font-size: .9rem; }
}
@media (max-width: 480px) { .cvf-2 { grid-template-columns: 1fr; } .cvr-r { grid-template-columns: minmax(0, 1fr) 96px auto; } .cvg-grid { grid-template-columns: 1fr 1fr; gap: 12px; } .cvg-card { padding: 8px; } .cvg-use { display: none; } }
.cvw-pvw { position: relative; min-height: 0; min-width: 0; display: flex; }
.cvw-pvw > .cvw-pv { flex: 1; min-width: 0; }
.cvw-pv.zoomed { justify-content: flex-start; }
.cvz { position: absolute; bottom: 14px; inset-inline-end: 18px; display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--surface); box-shadow: 0 6px 20px rgba(20, 22, 40, .18); z-index: 5; }
.cvz button { min-width: 36px; height: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer; }
.cvz button:hover { background: var(--surface-2); color: var(--cvc); }
.cvz-fit { font-size: .78rem !important; }
@media (max-width: 900px) { .cvt-g { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 28px); mask-image: linear-gradient(to left, transparent 0, #000 28px); padding-inline-end: 24px; } [dir="rtl"] .cvt-g { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px); mask-image: linear-gradient(to right, transparent 0, #000 28px); } }
@media (max-width: 900px) { .cvw-pvw { display: none; } .cvw.show-pv .cvw-pvw { display: flex; } .cvz { bottom: 12px; inset-inline-end: 12px; } }
