
.cvai-wrapper{max-width:980px;margin:20px auto;padding:16px;background:#fff;border:1px solid #e5e5e5;border-radius:10px;font-family:'Cairo',sans-serif}
.cvai-title{margin:0 0 12px;font-size:22px}
/* stacked form */
.cvai-form--stack{display:flex;flex-direction:column;gap:14px;margin-bottom:8px}
.cvai-field{display:flex;flex-direction:column;gap:6px}
.cvai-field label{font-weight:600}
.cvai-form textarea,#cvai-desc, .cvai-form select, .cvai-form input[type=file]{width:100%}
.cvai-btn{border:0;padding:10px 16px;border-radius:8px;cursor:pointer}
.cvai-btn.primary{background:#0d6efd;color:#fff}
.cvai-btn.success{background:#059669;color:#fff}
.cvai-loading{margin-top:4px}
.cvai-templates{margin:18px 0}
.tpl-list{display:flex;gap:10px;flex-wrap:wrap}
.tpl-card{border:1px solid #d0d7de;border-radius:10px;padding:10px 14px;background:#f7f7f7;cursor:pointer;display:flex;align-items:center;gap:8px}
.tpl-card.active{outline:3px solid #0d6efd}
.tpl-card[data-paid="1"]{position:relative}
.tpl-card .tpl-lock{margin-inline-start:4px;opacity:.85}
.tpl-card .tpl-price{font-weight:700;opacity:.9}
.tpl-hint{margin-top:8px;color:#555}

.cvai-preview{
  position:relative; z-index:1;
  margin-top:16px;background:#fff;border:1px solid #eee;min-height:200px;padding:16px;
  box-shadow:0 6px 22px rgba(0,0,0,.06);
}
/* smaller visual only */
.cv-preview-container{
  transform: scale(.86);
  transform-origin: top center;
  width: 116%;
  margin: 0 auto;
  transition: transform .2s ease;
}
@media (max-width: 480px){
  .cv-preview-container{ transform: scale(.9); width:111%; }
}

.cvai-actions{position:relative; z-index:0; margin-top:16px; text-align:center; background:transparent}

.cv-shell{background:#fff;border:1px solid #e5e5e5;border-radius:12px;overflow:hidden}
.cv-head{display:flex;gap:16px;align-items:center;padding:16px 20px;overflow:visible;flex-wrap:wrap}
.cv-head .photo{flex:0 0 110px;width:110px;height:110px;border-radius:12px;overflow:hidden}
.cv-head .photo img{width:100%;height:100%;object-fit:cover;aspect-ratio:1/1;display:block}
.cv-head .info h1{margin:0 0 4px;font-size:26px}
.cv-head .info .title{opacity:0.85}
.cv-head .info .meta{opacity:0.7}
.cv-body{padding:0 20px 20px}
.cv-sec{margin-top:14px}
.cv-sec h2{font-size:18px;margin:0 0 8px;border-bottom:2px solid #eee;padding-bottom:6px}

/* classic */
.tpl-classic .cv-head{background:#f0f7ff}
.tpl-classic .cv-sec h2{color:#0d47a1;border-color:#cfe2ff}

/* modern */
.tpl-modern .cv-head{background:#111827;color:#fff}
.tpl-modern .cv-sec h2{color:#111827;border-color:#11182722}

/* creative */
.tpl-creative .cv-head{background:linear-gradient(90deg,#0ea5e9,#6366f1);color:#fff}
.tpl-creative .cv-sec h2{color:#4338ca;border-color:#a5b4fc}

.font-cairo{font-family:'Cairo',sans-serif}
.font-roboto{font-family:'Roboto',sans-serif}

@media (max-width: 768px){
  .cv-head{gap:12px}
  .cv-head .photo{flex:0 0 96px;width:96px;height:96px}
  .cv-head .info{flex:1 1 220px;min-width:220px}
}
@media (orientation: landscape) and (max-height: 480px){
  .cv-head{flex-wrap:wrap}
  .cv-head .photo{display:block}
}


/* v1.2.10h – Thumbnail preview identical to PDF */
.cvai-preview { text-align:center; }
.cvai-preview .cv-preview-container { max-width: 420px; margin: 0 auto; }
.cv-thumb { display:block; width: 100%; height: auto; aspect-ratio: 595/842; background:#fff; box-shadow: 0 6px 18px rgba(0,0,0,.08); border-radius: 6px; }
@media (max-width: 480px){
  .cvai-preview .cv-preview-container { max-width: 92vw; }
}


/* v1.2.10j — Preview-only full-bleed & gap removal (form unaffected) */
.cvai-preview-outer{ margin:0 !important; padding:0 !important; max-width:100% !important; }
.cvai-preview{ padding:0 !important; margin:0 auto !important; max-width:100% !important; }
.cv-preview-container{ padding:0 !important; margin:0 auto !important; max-width:100% !important; }
.cv-thumb{ display:block; width:100% !important; height:auto !important; margin:0 auto !important; }

@media (max-width: 480px){
  /* full-bleed for preview ONLY (doesn't touch the form) */
  .cvai-preview-outer{
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
  }
}


/* v1.2.10l — Live HTML preview (no thumbnail), full-width, centered */
.cv-thumb{ display:none !important; } /* neutralize any old image preview */

.cvai-preview{ padding:0 !important; margin:0 auto !important; max-width:100% !important; }
.cv-preview-container{ width:100% !important; display:flex; justify-content:center; align-items:flex-start; }
.cv-preview-frame{ width:100% !important; max-width:100% !important; overflow-y:auto; overflow-x:hidden; }

/* Live CV clone fills the frame */
#cv-live.cv--live, .cv-live-box .cv-shell, .cv--live .cv-shell{
  width:100% !important;
  max-width:100% !important;
  margin:0 !important;
  border-radius:0 !important;
}
.cv--live .cv-head, .cv--live .cv-body{
  padding-left:16px; padding-right:16px;
}
@media (max-width:480px){
  .cv--live .cv-head, .cv--live .cv-body{ padding-left:10px; padding-right:10px; }
}

/* Prevent outer horizontal scroll if theme adds padding */
.cvai-wrapper{ overflow-x:hidden; }
