/* CV Builder UI (list page, editor, print toolbar). Uses the site's brand variables. */
.small { font-size: .85rem; } .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- My CVs list ---------- */
.cvl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.25rem; margin-bottom: 2.5rem; }
.cvl-card { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.cvl-thumb { display: block; background: #e9eeeb; padding: 14px 14px 0; border-bottom: 1px solid var(--line); }
.cvl-thumb-in { width: 100%; overflow: hidden; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18); pointer-events: none; }
.cvl-thumb-in .cv-stage .cv-page { margin: 0; box-shadow: none; }
.cvl-meta { padding: 1rem; display: grid; gap: .5rem; }
.cvl-meta h3 { margin: 0; font-size: 1.05rem; word-break: break-word; } .cvl-meta p { margin: 0; font-size: .88rem; }
.cvl-new { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem; max-width: 760px; }
.cvl-purposes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .75rem; margin: 1rem 0 1.2rem; }
.cvl-opt { display: flex; gap: .65rem; align-items: flex-start; border: 1px solid var(--line-strong); border-radius: 12px; padding: .8rem .9rem; cursor: pointer; }
.cvl-opt:has(input:checked) { border-color: var(--brand-primary-dark); box-shadow: 0 0 0 2px var(--brand-primary); }
.cvl-opt input { margin-top: .3rem; } .cvl-opt b { display: block; } .cvl-opt small { color: var(--ink-soft); display: block; line-height: 1.35; margin-top: 2px; }

/* ---------- Editor shell ---------- */
.cvx-body { margin: 0; background: #eef1ef; color: var(--brand-ink); font-family: var(--font-body, 'Inter', 'Noto Sans Bengali', sans-serif); }
.cvx { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.cvx * { box-sizing: border-box; }
.cvx-top { flex: none; display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; background: var(--brand-ink); color: #fff; }
.cvx-title { flex: 1; min-width: 0; background: transparent; border: 1px solid transparent; border-radius: 8px; color: #fff; font: 700 1rem/1.2 'Poppins', 'Inter', sans-serif; padding: .45rem .5rem; }
.cvx-title:hover, .cvx-title:focus { border-color: rgba(255,255,255,.3); outline: none; background: rgba(255,255,255,.07); }
.cvx-status { font-size: .78rem; color: #ffd28a; white-space: nowrap; } .cvx-status.ok { color: #8be9b5; } .cvx-status.bad { color: #ff9a94; }
.cvx-top .btn-secondary { color: #fff; border-color: rgba(255,255,255,.5); } .cvx-top .btn-secondary:hover { background: rgba(255,255,255,.12); color: #fff; }
.cvx-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(340px, 460px) 1fr; }
.cvx-panel { display: flex; flex-direction: column; min-height: 0; background: #f6f8f6; border-right: 1px solid var(--line); }
.cvx-tabs { flex: none; display: flex; background: #fff; border-bottom: 1px solid var(--line); }
.cvx-tabs button { flex: 1; border: 0; background: none; font: 600 .92rem/1 inherit; padding: .95rem .4rem; cursor: pointer; color: var(--ink-soft); border-bottom: 3px solid transparent; }
.cvx-tabs button.on { color: var(--brand-ink); border-bottom-color: var(--brand-primary-dark); }
.cvx-panelbody { flex: 1; overflow-y: auto; padding: .9rem; -webkit-overflow-scrolling: touch; }
.cvx-preview { min-width: 0; min-height: 0; overflow-y: auto; padding: 1rem; }
.cvx-pvbar { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; } .cvx-pvbar .sp { flex: 1; }
.cvx-stagewrap { width: 100%; max-width: 794px; margin: 0 auto; position: relative; }
.only-mobile { display: none; }
.ibtn { width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; background: transparent; color: inherit; cursor: pointer; padding: 0; text-decoration: none; }
.ibtn:hover { background: rgba(22,37,42,.09); } .ibtn.light { color: #fff; } .ibtn.light:hover { background: rgba(255,255,255,.14); }
.ibtn svg { width: 19px; height: 19px; }

/* ---------- panel pieces ---------- */
.cvx .card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin-bottom: .9rem; display: grid; gap: .7rem; }
.cvx .card.flat { background: #f6f8f6; }
.cvx .card h3, .cvx .card h4 { margin: 0; font-size: 1rem; } .cvx .card h4 { font-size: .92rem; margin-top: .4rem; } .cvx h3.lh { margin: 1.1rem 0 .6rem; font-size: .95rem; }
.cvx .card p, .cvx .card ul { margin: 0; } .cvx .card ul { padding-left: 1.1rem; display: grid; gap: .25rem; }
.fld { display: grid; gap: .3rem; } .fld > span { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.fld.inline { grid-template-columns: 1fr auto; align-items: center; }
.cvx input[type=text], .cvx input[type=email], .cvx select, .cvx textarea { width: 100%; font: inherit; font-size: .95rem; padding: .62rem .7rem; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: inherit; min-height: 44px; }
.cvx input:focus, .cvx select:focus, .cvx textarea:focus, .rte-ed:focus { outline: 2px solid var(--brand-primary-dark); outline-offset: 1px; }
.cvx input[type=color] { width: 56px; height: 40px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.chk { display: flex; gap: .55rem; align-items: flex-start; font-size: .9rem; cursor: pointer; } .chk input { margin-top: .22rem; width: 18px; height: 18px; flex: none; } .chk.big { font-weight: 600; }
.photo-row { display: flex; gap: .9rem; align-items: center; } .ph { width: 76px; height: 76px; border-radius: 50%; background: #dfe6e3; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-size: .8rem; flex: none; } .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-act { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.seg { display: flex; background: #e8ecea; border-radius: 10px; padding: 3px; } .seg button { flex: 1; border: 0; background: none; padding: .5rem .3rem; border-radius: 8px; font: 600 .82rem inherit; font-family: inherit; cursor: pointer; color: var(--ink-soft); } .seg button.on { background: #fff; color: var(--brand-ink); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.swatches { display: flex; flex-wrap: wrap; gap: .6rem; } .sw { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; padding: 0; } .sw.on { box-shadow: 0 0 0 3px var(--brand-ink); }
.tgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.tcard { text-align: left; border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: .5rem; cursor: pointer; display: grid; gap: .25rem; font: inherit; color: inherit; } .tcard.on { border-color: var(--brand-primary-dark); box-shadow: 0 0 0 2px var(--brand-primary); }
.tcard small { color: var(--ink-soft); line-height: 1.3; } .tthumb { background: #e9eeeb; padding: 6px 6px 0; overflow: hidden; border-radius: 6px; } .tthumb-in { background: #fff; overflow: hidden; width: 100%; pointer-events: none; } .tthumb-in .cv-stage .cv-page { margin: 0; box-shadow: none; }

/* sections */
.scard { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: .6rem; overflow: hidden; } .scard.off .scard-t { opacity: .5; } .scard.open { border-color: var(--line-strong); }
.scard-h { display: flex; align-items: center; gap: .15rem; padding: .35rem .5rem .35rem .85rem; cursor: pointer; min-height: 56px; }
.scard-t { flex: 1; min-width: 0; display: grid; } .scard-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .scard-t small { color: var(--ink-soft); }
.chev svg { width: 18px; height: 18px; display: block; transition: transform .15s; } .chev.up svg { transform: rotate(180deg); } .chev { padding: 0 .4rem; color: var(--ink-soft); }
.scard-b { padding: .2rem .85rem .9rem; display: grid; gap: .75rem; border-top: 1px solid var(--line); padding-top: .85rem; }
.scard-f { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; } .scard-f .btn svg, .addbig svg { width: 16px; height: 16px; }
.elist { display: grid; gap: .45rem; }
.erow { border: 1px solid var(--line); border-radius: 12px; background: #fbfcfb; } .erow.open { border-color: var(--line-strong); background: #fff; } .erow.off .erow-t { opacity: .45; text-decoration: line-through; }
.erow-h { display: flex; align-items: center; gap: .1rem; padding: .25rem .35rem .25rem .75rem; cursor: pointer; min-height: 48px; } .erow-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .93rem; }
.entry-ed { display: grid; gap: .65rem; padding: .3rem .75rem .5rem; } .erow-f { display: flex; justify-content: space-between; padding: .2rem .75rem .75rem; }
.qrow { display: grid; grid-template-columns: 1fr 120px auto auto; gap: .35rem; align-items: center; } .qrow.off input[type=text] { opacity: .45; } .qrow select { padding-left: .4rem; padding-right: .2rem; font-size: .85rem; }
.addbig { width: 100%; margin: .4rem 0 2rem; }
.sigbox { display: grid; gap: .5rem; border-top: 1px dashed var(--line-strong); padding-top: .75rem; } .sigbox img { max-width: 180px; max-height: 70px; background: #fff; border: 1px solid var(--line); }
.rte { border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fff; } .rte-bar { display: flex; gap: 2px; padding: 4px; background: #f1f4f2; border-bottom: 1px solid var(--line); }
.rte-b { border: 0; background: none; border-radius: 7px; min-width: 36px; height: 34px; padding: 0 .55rem; font: 600 .85rem inherit; font-family: inherit; cursor: pointer; color: inherit; } .rte-b:hover { background: #e2e8e5; } .rte-b.b { font-weight: 800; } .rte-b.i { font-style: italic; } .rte-b.u { text-decoration: underline; }
.rte-ed { min-height: 92px; max-height: 280px; overflow-y: auto; padding: .6rem .7rem; font-size: .95rem; line-height: 1.45; } .rte-ed ul, .rte-ed ol { margin: .2rem 0; padding-left: 1.3rem; } .rte-ed p, .rte-ed div { margin: 0; }
.qrctl { display: grid; gap: .7rem; }

/* modal */
.mback { position: fixed; inset: 0; background: rgba(10,20,24,.55); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
.mbox { background: #f6f8f6; width: 100%; max-width: 640px; max-height: 92vh; max-height: 92dvh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; overflow: hidden; }
.mhead { display: flex; align-items: center; justify-content: space-between; padding: .7rem .8rem .5rem 1.1rem; background: #fff; border-bottom: 1px solid var(--line); } .mhead h2 { margin: 0; font-size: 1.15rem; }
.mbody { overflow-y: auto; padding: 1rem; display: grid; gap: .8rem; align-content: start; } .mfoot { display: flex; justify-content: flex-end; gap: .6rem; padding: .75rem 1rem; background: #fff; border-top: 1px solid var(--line); }
.modal-open { overflow: hidden; }
.addgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; } .addopt { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .75rem; cursor: pointer; font: inherit; color: inherit; display: grid; gap: .2rem; align-content: start; } .addopt:hover { border-color: var(--brand-primary-dark); } .addopt small { color: var(--ink-soft); line-height: 1.3; }
@media (min-width: 700px) { .mback { align-items: center; } .mbox { border-radius: 18px; } }

/* ---------- mobile: preview becomes a full-screen layer ---------- */
@media (max-width: 999px) {
  .cvx-main { grid-template-columns: 1fr; } .cvx-panel { border-right: 0; }
  .cvx-preview { display: none; position: fixed; inset: 0; z-index: 500; background: #dfe5e2; padding: .6rem; } .cvx.is-preview .cvx-preview { display: block; }
  .only-mobile { display: inline-flex; } .cvx-status { display: none; }
  .cvx-pvbar { position: sticky; top: -.6rem; background: #dfe5e2; padding: .4rem 0; z-index: 2; flex-wrap: wrap; }
  .cvx-top .cvx-title { font-size: .95rem; }
}
@media (max-width: 420px) { .qrow { grid-template-columns: 1fr 96px auto auto; } .two { grid-template-columns: 1fr; } .two:has(input[placeholder^="MM"]) { grid-template-columns: 1fr 1fr; } }

/* ---------- print page ---------- */
.cvp-body { margin: 0; background: #d9dfdc; font-family: 'Inter', sans-serif; }
.cvp-bar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .6rem .9rem; background: var(--brand-ink, #16252a); color: #fff; }
.cvp-bar .sp { flex: 1; } .cvp-bar a { color: #fff; } .cvp-bar .btn-secondary { color: #fff; border-color: rgba(255,255,255,.5); }
.cvp-hint { margin: 0; font-size: .82rem; color: #cfe0dc; width: 100%; }
.cvp-wrap { padding: 1rem; } .cvp-stagewrap { max-width: 794px; margin: 0 auto; position: relative; }
@media print { .cvp-bar { display: none !important; } .cvp-body { background: #fff; } .cvp-wrap { padding: 0; } .cvp-stagewrap { max-width: none; height: auto !important; } }

/* ---------- home page demo ---------- */
.cvd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 430px); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.cvd-copy h2 { margin-bottom: .6rem; } .cvd-copy > p { font-size: 1.08rem; color: var(--ink-soft); max-width: 36rem; }
.cvd-points { margin: 1rem 0 1.4rem; padding-left: 1.15rem; display: grid; gap: .4rem; max-width: 36rem; }
.cvd-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.cvd-tabs button { border: 1px solid var(--line-strong); background: var(--surface, #fff); border-radius: 999px; padding: .45rem 1rem; font: inherit; font-weight: 600; cursor: pointer; }
.cvd-tabs button.on { background: var(--brand-ink); color: #fff; border-color: var(--brand-ink); }
.cvd-stage-wrap { width: 100%; max-width: 430px; justify-self: center; position: relative; overflow: hidden; background: #fff; border-radius: 6px; box-shadow: 0 12px 40px rgba(22,37,42,.28); border: 1px solid var(--line); }
.cvd-stage-wrap .cv-stage .cv-page { margin: 0; box-shadow: none; }
@media (max-width: 860px) { .cvd { grid-template-columns: 1fr; } .cvd-stage-wrap { max-width: 360px; } }

/* ---------- overflow fixes: long text must never widen the side panel ---------- */
.cvx-panel, .cvx-panelbody, .tabc, .scard, .scard-b, .scard-h, .scard-t, .elist, .erow, .erow-h, .entry-ed, .cvx .card, .fld, .two > *, .qrow > *, .rte, .rte-ed { min-width: 0; max-width: 100%; }
.cvx-panelbody { overflow-x: hidden; }
.tabc, .scard-b, .elist, .entry-ed, .cvx .card, .qrctl, .addgrid, .tgrid, .mbody { grid-template-columns: minmax(0, 1fr); }
.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.qrow { grid-template-columns: minmax(0, 1fr) 112px auto auto; }
.tgrid, .addgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.erow-t, .scard-t b { display: block; }
.rte-ed, .fld, .chk span, .scard-t small { overflow-wrap: anywhere; }
.rte-bar { flex-wrap: wrap; }
@media (max-width: 420px) { .qrow { grid-template-columns: minmax(0, 1fr) 92px auto auto; } .two:not(:has(input[placeholder^="MM"])) { grid-template-columns: minmax(0, 1fr); } }

/* Dark mode: --brand-ink turns light there, so the selected template chip became light-on-light. Use the brand colour with dark text, like the other buttons. */
html[data-theme="dark"] .cvd-tabs button.on { background: var(--brand-primary); color: #10191b; border-color: var(--brand-primary); }
