/* CV Maker page. Prefix cvm- (page UI) and cv- (paper). All fonts local (css/google-fonts.css). */
.cvm { --g: var(--fz-g-700, #1E7B4F); max-width: 1240px; margin: 0 auto; padding: 22px 16px 48px; font-family: var(--fz-font, 'Noto Sans Bengali', 'Hind Siliguri', sans-serif); color: var(--fz-ink, #17201B); box-sizing: border-box; }
.cvm *, .cvm *::before, .cvm *::after { box-sizing: border-box; }
.cvm h1.cvm-title { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 6px 0 4px; text-align: center; font-weight: 800; }
.cvm .cvm-lead { text-align: center; color: var(--fz-ink-2, #4A5650); margin: 0 0 18px; font-size: .95rem; }
.cvm-grid { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 20px; align-items: start; }
.cvm-editor { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cvm-card { background: #fff; border: 1px solid var(--fz-nav-line, #E6EBE8); border-radius: 14px; padding: 14px; min-width: 0; }
html.dark .cvm-card { background: #151D19; border-color: #24302A; }
html.dark .cvm, html.dark .cvm .cvm-lead, html.dark .cvm-card > summary { color: #E2EAE6; }
html.dark .cvm-f, html.dark .cvm-note { color: #B5C2BB; }
html.dark .cvm .cvm-btn:not(.pri) { background: #1B2621; color: #8FE0B5; border-color: #3C7A58; }
html.dark .cvm .cvm-btn.del { color: #ff9a9a; border-color: #7a3a3a; }
html.dark .cvm-seg button { background: #1B2621; color: #8FE0B5; }
html.dark .cvm-seg button[aria-pressed=true] { background: var(--g); color: #fff; }
html.dark .cvm-msg { background: #1B2621; color: #E2EAE6; }
html.dark .cvm-msg.err { background: #3a1f1f; color: #ffb4b4; }
html.dark .cvm-prev-box { background: #0d1310; }
.cvm-card > summary, .cvm-card > h2 { font-size: 1rem; font-weight: 700; margin: 0 0 10px; cursor: default; list-style: none; }
details.cvm-card > summary { cursor: pointer; margin: 0; }
details.cvm-card[open] > summary { margin-bottom: 10px; }
.cvm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cvm-f { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--fz-ink-2, #4A5650); min-width: 0; }
.cvm-f.wide { grid-column: 1 / -1; }
.cvm input[type=text], .cvm input[type=email], .cvm input[type=tel], .cvm textarea, .cvm select { width: 100%; min-width: 0; font: inherit; font-size: .92rem; padding: 8px 10px; border: 1px solid #cfd8d3; border-radius: 9px; background: #fff; color: #17201B; }
.cvm textarea { resize: vertical; min-height: 64px; }
.cvm input:focus, .cvm textarea:focus, .cvm select:focus { outline: 2px solid var(--fz-g-200, #BFE6D2); border-color: var(--g); }
.cvm-btn { font: inherit; font-weight: 600; font-size: .9rem; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--g); background: #fff; color: var(--g); cursor: pointer; }
.cvm-btn.pri { background: var(--g); color: #fff; }
.cvm-btn.sm { padding: 5px 10px; font-size: .8rem; }
.cvm-btn.del { border-color: #e5b4b4; color: #b02a2a; }
.cvm-btn:disabled { opacity: .55; cursor: wait; }
.cvm-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cvm-seg { display: inline-flex; border: 1px solid var(--g); border-radius: 10px; overflow: hidden; }
.cvm-seg button { font: inherit; font-size: .85rem; border: 0; background: #fff; color: var(--g); padding: 7px 12px; cursor: pointer; }
.cvm-seg button[aria-pressed=true] { background: var(--g); color: #fff; }
.cvm-note { font-size: .8rem; color: var(--fz-ink-3, #5F6B65); margin: 6px 0 0; }
.cvm-msg { margin-top: 8px; font-size: .85rem; padding: 8px 10px; border-radius: 9px; background: var(--fz-g-50, #F2FAF6); }
.cvm-msg.err { background: #fdecec; color: #8a1f1f; }
.cvm-rep { border: 1px dashed #cfd8d3; border-radius: 10px; padding: 10px; margin-bottom: 8px; display: grid; gap: 8px; }
.cvm-rep .cvm-row { grid-template-columns: 1fr 1fr; }
.cvm-crop { display: grid; gap: 8px; justify-items: start; }
.cvm-crop canvas { width: 200px; height: 200px; max-width: 100%; border: 1px solid #cfd8d3; border-radius: 10px; touch-action: none; cursor: grab; background: #eee; }
.cvm-prev-col { min-width: 0; position: sticky; top: calc(var(--fz-nav-h, 64px) + 8px); }
.cvm-prev-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cvm-prev-box { width: 100%; overflow: hidden; background: #e9eeeb; border-radius: 12px; padding: 0; position: relative; }
#cvScaler { transform-origin: top left; width: 210mm; }

/* ===== Paper (A4) ===== */
.cv-paper { width: 210mm; min-height: 297mm; padding: 12mm 14mm; background: #fff; color: #111; font-size: 10.5pt; line-height: 1.42; font-family: 'Noto Sans Bengali', 'Hind Siliguri', 'Segoe UI', Arial, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; position: relative; }
.cv-paper h1 { font-size: 24pt; line-height: 1.2; margin: 0 0 4px; font-weight: 800; color: var(--cv-accent, #14523A); }
.cv-paper h2 { font-size: 11pt; margin: 0 0 5px; padding-bottom: 2px; border-bottom: 1.5px solid var(--cv-accent, #1E7B4F); color: var(--cv-accent, #1E7B4F); text-transform: uppercase; letter-spacing: .5px; break-after: avoid; }
.cv-lang-bn h2 { text-transform: none; letter-spacing: 0; }
.cv-paper p { margin: 0 0 4px; }
.cv-sec { margin-top: 10px; break-inside: avoid; }
.cv-headline { font-size: 10.5pt; font-weight: 600; color: var(--cv-accent, #1E7B4F); margin: 0 0 4px; }
.cv-social { display: flex; flex-wrap: wrap; gap: 5px 12px; font-size: 9pt; margin: 3px 0 4px; color: #555; }
.cv-social a, .cv-link { color: var(--cv-accent, #1E7B4F); text-decoration: none; word-break: break-all; }
.cv-social a:hover, .cv-link:hover { text-decoration: underline; }
.cvm-swatches { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.cvm-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #cfd8d3; cursor: pointer; transition: transform .15s, box-shadow .15s; background: #555; padding: 0; }
.cvm-swatch:hover { transform: scale(1.15); }
.cvm-swatch[aria-pressed=true] { box-shadow: 0 0 0 2.5px var(--g, #1E7B4F); transform: scale(1.15); }
.cv-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.cv-contact { color: #444; font-size: 10pt; }
.cv-photo { width: 32mm; height: 38mm; object-fit: cover; border-radius: 3px; border: 1px solid #999; flex: none; box-sizing: border-box; }
.cv-photo-ph { display: flex !important; align-items: center; justify-content: center; text-align: center; font-size: 8.5pt; line-height: 1.25; color: #555; background: #fafafa; border: 1px dashed #888; }
.cv-item { margin-bottom: 6px; break-inside: avoid; }
.cv-item-h { display: flex; justify-content: space-between; gap: 10px; }
.cv-item-h span { color: #666; font-size: 9.5pt; white-space: nowrap; }
.cv-sub { color: #444; font-style: italic; font-size: 9.5pt; }
.cv-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.cv-tags li { background: #E3F4EB; border-radius: 4px; padding: 2px 8px; font-size: 9.5pt; }
.cv-kv { width: 100%; border-collapse: collapse; }
.cv-kv th { text-align: left; width: 38%; font-weight: 600; padding: 2px 8px 2px 0; vertical-align: top; }
.cv-kv td { padding: 2px 0; }
.cv-refs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; break-inside: avoid; }
.cv-ref div { font-size: 9.5pt; color: #444; }
/* modern */
.cv-modern { display: grid; grid-template-columns: 62mm 1fr; padding: 0; }
.cv-modern .cv-side { background: #1E7B4F; color: #fff; padding: 12mm 7mm; }
.cv-modern .cv-main { padding: 12mm 10mm; }
.cv-modern .cv-photo { width: 36mm; height: 36mm; border-radius: 50%; border: 3px solid #BFE6D2; margin: 0 auto 8px; display: block; }
.cv-modern .cv-photo-ph { display: flex !important; border-style: dashed; color: #BFE6D2; background: rgba(255,255,255,0.08); }
.cv-side h3 { font-size: 10.5pt; margin: 12px 0 4px; padding-bottom: 2px; border-bottom: 1px solid #BFE6D2; color: #BFE6D2; }
.cv-sd { font-size: 9.5pt; margin-bottom: 5px; overflow-wrap: anywhere; }
.cv-sd small { display: block; font-size: 8.5pt; color: #BFE6D2; }
/* biodata */
.cv-biodata { border: 2px double #14523A; margin: 0; }
.cv-biodata h1 { text-align: center; font-size: 22pt; }
.cv-bio-head > div { flex: 1; }
.cv-biodata .cv-kv { border-collapse: collapse; }
.cv-biodata .cv-kv th, .cv-biodata .cv-kv td, .cv-grid th, .cv-grid td { border: 1px solid #666; padding: 3px 6px; font-size: 10pt; }
.cv-biodata .cv-kv th { background: #f2f2f2; }
.cv-grid { width: 100%; border-collapse: collapse; }
.cv-grid th { background: #f2f2f2; text-align: left; }
.cv-biodata h2 { text-align: center; }
.cv-sign { display: flex; justify-content: space-between; margin-top: 18px; font-size: 10pt; break-inside: avoid; }
.cv-sign i { display: inline-block; width: 40mm; border-bottom: 1px solid #111; }
.cv-sign span:last-child { text-align: center; }
.cv-decl { margin-top: 10px; break-inside: avoid; }
.cv-decl h2 { font-size: 11pt; margin-bottom: 4px; }
.cv-decl p, .cv-decl-text { font-size: 10pt; line-height: 1.4; margin: 0; color: inherit; }
.cv-paper > .cv-sign, .cv-paper > .cv-decl { clear: both; }
/* নমুনা-ভিত্তিক টেমপ্লেটের নিচে সাধারণ শেষ-অংশ: পাতার নিজস্ব মার্জিনে ও থিম রঙে */
.cv-tail-x { clear: both; width: 100%; box-sizing: border-box; }
.cv-tail-x .cv-sec { margin-top: 8px; }
.cv-tail-x .cv-sec h2 { color: var(--cv-accent, currentColor); border-bottom: 1.5px solid var(--cv-accent, #555); font-size: 11pt; margin-bottom: 4px; }
.mkt { padding-top: 20pt !important; padding-bottom: 20pt !important; min-height: auto !important; }

/* twocol / bilingual band */
.cv-band { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: #14523A; color: #fff; margin: -10mm -12mm 3mm; padding: 7mm 12mm; }
.cv-band h1 { color: #fff; margin: 0 0 3px; font-size: 20pt; }
.cv-band .cv-contact { color: #DFF3E8; }
.cv-band .cv-photo { border: 2px solid #BFE6D2; width: 28mm; height: 32mm; }
.cv-bilingual .cv-band { background: #1E7B4F; }
.cv-cols { display: grid; grid-template-columns: 1fr 60mm; gap: 6mm; }
.cv-colR { background: #F2F7F4; padding: 2mm 3mm 3mm; border-radius: 4px; align-self: start; }
.cv-colR .cv-refs { grid-template-columns: 1fr; }
.cv-twocol .cv-sec:first-child, .cv-colL .cv-sec:first-child { margin-top: 0; }
/* minimal */
.cv-minimal { font-family: 'Noto Sans Bengali', 'Segoe UI', Arial, sans-serif; }
.cv-minimal h1 { color: #111; font-size: 22pt; font-weight: 700; text-align: center; }
.cv-minimal .cv-head { justify-content: center; text-align: center; }
.cv-minimal h2 { color: #222; border-bottom: 1px solid #999; font-size: 10.5pt; }
.cv-minimal .cv-tags li { background: none; padding: 0; }
.cv-minimal .cv-tags li:not(:last-child)::after { content: ' ·'; }
/* bilingual tables */
.cv-bilingual .cv-kv th { width: 44%; }
.cv-bilingual .cv-grid th, .cv-bilingual .cv-grid td { border: 1px solid #aab; padding: 3px 7px; }

/* ===== template gallery, needs list, tabs ===== */
.cvm-h2 { font-size: 1.1rem; margin: 0 0 10px; font-weight: 800; }
.cvm-tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.cvm-tcard { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 2px solid var(--fz-nav-line, #E6EBE8); border-radius: 12px; padding: 8px; min-width: 0; position: relative; }
.cvm-tcard[hidden] { display: none; }
.cvm-tcard:hover { border-color: var(--fz-g-200, #BFE6D2); }
.cvm-tcard[aria-pressed=true] { border-color: var(--g); box-shadow: 0 0 0 3px rgba(30,123,79,.22); }
.cvm-tcard[aria-pressed=true]::after { content: '✓'; position: absolute; top: 14px; left: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--g); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.cvm-tcard b { font-size: .9rem; line-height: 1.35; margin-top: 4px; }
.cvw-tdesc { font-size: .75rem; color: var(--fz-ink-2, #4A5650); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cvw-tags { font-size: .72rem; color: var(--g); font-weight: 600; }
.cvw-pick { margin-top: auto; align-self: stretch; }
.cvm-tthumb { display: block; width: 100%; overflow: hidden; background: #e9eeeb; border-radius: 6px; position: relative; padding: 0; border: 1px solid var(--fz-nav-line, #E6EBE8); cursor: zoom-in; font: inherit; }
.cvm-tthumb > .cvm-tscale, .cvw-sthumb > .cvm-tscale { pointer-events: none; content-visibility: auto; contain-intrinsic-size: 794px 1123px; }
.cvm-tthumb, .cvw-sthumb { contain: layout paint; }
.cvm-tscale { transform-origin: top left; width: 210mm; }
.cvw-zoomic { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 50%; background: rgba(20,82,58,.88); color: #fff; display: grid; place-items: center; font-size: 17px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.cvm-tthumb:hover .cvw-zoomic, .cvm-tthumb:focus-visible .cvw-zoomic { background: var(--g); transform: scale(1.08); }
html.dark .cvm-tcard { background: #151D19; border-color: #24302A; color: #E2EAE6; }
html.dark .cvw-tdesc { color: #B5C2BB; }
html.dark .cvw-tags { color: #8FE0B5; }
html.dark .cvm-tthumb { border-color: #24302A; }

/* ===== wizard: stepper, steps, bottom bar ===== */
.cvw-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 18px; counter-reset: s; }
.cvw-steps button { font: inherit; display: flex; align-items: center; gap: 8px; justify-content: center; padding: 9px 8px; border: 1px solid var(--fz-nav-line, #E6EBE8); background: #fff; color: var(--fz-ink-2, #4A5650); border-radius: 12px; cursor: pointer; font-size: .88rem; font-weight: 600; min-width: 0; }
.cvw-steps button i { font-style: normal; flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #EEF2F0; color: var(--fz-ink-2, #4A5650); font-weight: 800; font-size: .85rem; }
.cvw-steps button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cvw-steps button.done i { background: var(--fz-g-100, #E3F4EB); color: var(--g); }
.cvw-steps button.done i::before { content: '✓'; } .cvw-steps button.done i { font-size: 0; } .cvw-steps button.done i::before { font-size: .85rem; }
.cvw-steps button[aria-current=step] { border-color: var(--g); background: var(--fz-g-50, #F2FAF6); color: var(--fz-g-900, #14523A); box-shadow: 0 0 0 2px rgba(30,123,79,.15); }
.cvw-steps button[aria-current=step] i { background: var(--g); color: #fff; }
.cvw-step[hidden] { display: none !important; }
.cvw-head { margin-bottom: 12px; }
.cvw-head .cvm-note { margin-top: 2px; }
.cvw-h3 { font-size: 1rem; font-weight: 700; margin: 0 0 10px; }
.cvw-nav { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--fz-nav-bg, rgba(255,255,255,.97)); border-top: 1px solid var(--fz-nav-line, #E6EBE8); backdrop-filter: blur(6px); }
.cvw-nav .cvm-btn { min-width: 128px; }
.cvw-nav .cvm-btn:disabled { visibility: hidden; }
.cvw-nav-t { font-size: .82rem; color: var(--fz-ink-3, #5F6B65); font-weight: 600; }
.cvm[data-step="4"] .cvw-nav #cvNext { display: none; }
.cvw-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cvw-edit { grid-template-columns: minmax(0, 1fr) 300px; }
.cvw-mini { position: sticky; top: calc(var(--fz-nav-h, 64px) + 12px); }
.cvw-mini-box { width: 100%; overflow: hidden; background: #e9eeeb; border-radius: 10px; box-shadow: 0 1px 8px rgba(0,0,0,.08); }
.cvw-mini-sc { transform-origin: top left; width: 210mm; }
html.dark .cvw-steps button { background: #151D19; border-color: #24302A; color: #B5C2BB; }
html.dark .cvw-steps button i { background: #24302A; color: #B5C2BB; }
html.dark .cvw-steps button[aria-current=step] { background: #14201A; color: #E2EAE6; border-color: #52C78C; }
html.dark .cvw-steps button[aria-current=step] i { background: #2E8B5E; color: #fff; }
html.dark .cvw-steps button.done i { background: #1B3327; color: #8FE0B5; }
html.dark .cvw-mini-box { background: #0d1310; }

/* step 1: filters */
.cvw-filters { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; background: var(--fz-g-50, #F2FAF6); border: 1px solid var(--fz-nav-line, #E6EBE8); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.cvw-fg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.cvw-fg-t { font-size: .78rem; font-weight: 700; color: var(--fz-ink-3, #5F6B65); margin-right: 2px; }
.cvw-fc { font: inherit; font-size: .82rem; padding: 5px 11px; border-radius: 999px; border: 1px solid #cfd8d3; background: #fff; color: var(--fz-ink, #17201B); cursor: pointer; line-height: 1.3; }
.cvw-fc small { font-size: .72rem; color: var(--fz-ink-3, #5F6B65); }
.cvw-fc:hover:not(:disabled) { border-color: var(--g); }
.cvw-fc[aria-pressed=true] { background: var(--g); border-color: var(--g); color: #fff; }
.cvw-fc[aria-pressed=true] small { color: #DFF3E8; }
.cvw-fc:disabled { opacity: .45; cursor: default; }
.cvw-fsum { margin-left: auto; }
.cvw-count { font-size: .82rem; font-weight: 700; color: var(--fz-g-900, #14523A); }
.cvw-filters.sm { padding: 8px; gap: 6px 12px; margin-bottom: 10px; }
.cvw-filters.sm .cvw-fc { font-size: .75rem; padding: 3px 9px; }
.cvw-filters.sm .cvw-fsum { margin-left: 0; }
.cvw-empty { text-align: center; padding: 30px 10px; color: var(--fz-ink-3, #5F6B65); }
html.dark .cvw-filters { background: #14201A; border-color: #24302A; }
html.dark .cvw-fc { background: #1B2621; border-color: #3C4A43; color: #E2EAE6; }
html.dark .cvw-fc small { color: #A9B7B0; }
html.dark .cvw-fc[aria-pressed=true] { background: #2E8B5E; border-color: #52C78C; }
html.dark .cvw-count { color: #8FE0B5; }

/* step 2: files */
.cvw-files { display: grid; gap: 12px; }
.cvw-drop { display: grid; gap: 6px; padding: 14px; border: 2px dashed #b9cbc1; border-radius: 12px; background: var(--fz-g-50, #F2FAF6); font-size: .85rem; }
.cvw-drop b { font-size: .92rem; }
.cvw-drop input { max-width: 100%; font: inherit; font-size: .8rem; }
.cvw-skip { justify-self: start; }
html.dark .cvw-drop { background: #14201A; border-color: #3C4A43; color: #E2EAE6; }

/* step 3: missing + extracted marks */
.cvm-needs { position: sticky; top: calc(var(--fz-nav-h, 64px) + 4px); z-index: 6; }
.cvw-more > summary { cursor: pointer; font-size: .78rem; color: var(--fz-ink-3, #5F6B65); margin-top: 6px; }
.cvw-exnote { margin: 6px 0 0; font-size: .78rem; color: #7a5a00; }
.cvm-f.cvw-miss input, .cvm-f.cvw-miss textarea { border-color: #e08b8b; background: #fff7f7; box-shadow: 0 0 0 2px rgba(229,56,59,.12); }
.cvm-f.cvw-miss > span:first-child::after, .cvm-card.cvw-miss > .cvw-h3::after { content: ' *'; color: #c62828; font-weight: 800; }
.cvm-card.cvw-miss { border-color: #e5b4b4; box-shadow: 0 0 0 2px rgba(229,56,59,.08); }
.cvm-f.cvw-ex input, .cvm-f.cvw-ex textarea { background: #fffbe6; border-color: #e6cf7a; }
.cvm-f.cvw-ex::after, .cvm-card.cvw-ex > .cvw-h3::after { content: attr(data-exl); font-size: .68rem; color: #8a6d00; }
.cvm-card.cvw-ex { border-left: 4px solid #e6cf7a; }
html.dark .cvm-f.cvw-miss input, html.dark .cvm-f.cvw-miss textarea { background: #2a1717; border-color: #a35050; color: #fbeaea; }
html.dark .cvm-f.cvw-ex input, html.dark .cvm-f.cvw-ex textarea { background: #2a2610; border-color: #8a7a30; color: #f4efd8; }
html.dark .cvm-f.cvw-ex::after, html.dark .cvw-exnote { color: #e6cf7a; }
html.dark .cvm input[type=text], html.dark .cvm input[type=email], html.dark .cvm input[type=tel], html.dark .cvm textarea { background: #0f1613; color: #E2EAE6; border-color: #3C4A43; }

/* step 4: final */
.cvw-final { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: 'prev side' 'prev switch'; gap: 14px 20px; align-items: start; }
.cvw-final > .cvm-prev-col { grid-area: prev; position: static; }
.cvw-side { grid-area: side; display: grid; gap: 10px; align-content: start; }
.cvw-switch { grid-area: switch; min-width: 0; background: #fff; border: 1px solid var(--fz-nav-line, #E6EBE8); border-radius: 12px; padding: 10px; }
.cvw-switch-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 8px; }
.cvw-switch-h .cvm-note { margin: 0; }
.cvw-dl { display: grid; gap: 8px; }
.cvm-btn.big { font-size: 1.05rem; padding: 13px 16px; }
.cvw-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.cvw-lbl { font-size: .85rem; font-weight: 600; }
.cvm-seg button:disabled { opacity: .5; cursor: not-allowed; }
.cvw-warn { background: #fff6e5; border: 1px solid #f0d08a; border-radius: 10px; padding: 10px; font-size: .84rem; color: #6b4a00; }
.cvw-warn small { display: block; margin-top: 6px; color: #7a5a00; }
.cvw-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 112px; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 8px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.cvw-final .cvw-strip { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); grid-auto-columns: auto; max-height: 52vh; overflow-y: auto; overflow-x: hidden; }
.cvw-scard { position: relative; display: grid; gap: 3px; scroll-snap-align: start; min-width: 0; }
.cvw-scard[hidden] { display: none; }
.cvw-sthumb { display: block; width: 100%; padding: 0; overflow: hidden; border: 2px solid var(--fz-nav-line, #E6EBE8); border-radius: 8px; background: #e9eeeb; cursor: pointer; }
.cvw-scard[aria-pressed=true] .cvw-sthumb { border-color: var(--g); box-shadow: 0 0 0 2px rgba(30,123,79,.25); }
.cvw-sname { font-size: .68rem; line-height: 1.3; color: var(--fz-ink-2, #4A5650); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cvw-scard[aria-pressed=true] .cvw-sname { color: var(--fz-g-900, #14523A); font-weight: 700; }
.cvw-sview { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(20,82,58,.85); color: #fff; font-size: 13px; cursor: zoom-in; display: grid; place-items: center; padding: 0; }
html.dark .cvw-switch { background: #151D19; border-color: #24302A; }
html.dark .cvw-sthumb { border-color: #24302A; }
html.dark .cvw-sname { color: #B5C2BB; }
html.dark .cvw-scard[aria-pressed=true] .cvw-sname { color: #8FE0B5; }
html.dark .cvw-warn { background: #2a2210; border-color: #6b5520; color: #f0d890; }
html.dark .cvw-warn small { color: #d9c27a; }
.cvw-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60; max-width: min(92vw, 520px); background: var(--fz-g-900, #14523A); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .9rem; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.cvw-toast.err { background: #8a1f1f; }
.cvw-toast[hidden] { display: none; }

/* ===== large template viewer ===== */
html.cvv-open, html.cvv-open body { overflow: hidden; }
.cvv { position: fixed; inset: 0; z-index: 1000; background: rgba(10,16,13,.92); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: #fff; font-family: var(--fz-font, 'Noto Sans Bengali', sans-serif); }
.cvv[hidden] { display: none; }
.cvv-top, .cvv-bot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(0,0,0,.35); flex-wrap: wrap; }
.cvv-bot { justify-content: space-between; }
.cvv-ttl { flex: 1; min-width: 0; text-align: center; display: grid; }
.cvv-ttl b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cvv-ttl small { font-size: .75rem; color: #BFE6D2; }
.cvv-ic { font: inherit; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; flex: none; }
.cvv-ic:hover:not(:disabled) { background: rgba(255,255,255,.22); }
.cvv-ic:disabled { opacity: .35; }
.cvv-x { font-size: 18px; }
.cvv-stage { overflow: auto; touch-action: none; cursor: grab; padding: 12px; overscroll-behavior: contain; }
.cvv-stage.drag { cursor: grabbing; }
.cvv-sizer { position: relative; margin: 0 auto; }
.cvv-sc { position: absolute; left: 0; top: 0; transform-origin: top left; width: 210mm; box-shadow: 0 6px 30px rgba(0,0,0,.5); background: #fff; }
.cvv-pb { position: absolute; left: -6px; right: -6px; height: 0; border-top: 3px dashed #E5383B; pointer-events: none; }
.cvv-pb::after { content: attr(data-label); position: absolute; right: 6px; top: 2px; background: #E5383B; color: #fff; font: 700 13px/1.6 var(--fz-font, sans-serif); padding: 0 8px; border-radius: 0 0 6px 6px; }
.cvv-zoom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cvv-zoom span { min-width: 3.4em; text-align: center; font-size: .85rem; font-variant-numeric: tabular-nums; }
.cvv .cvm-btn:not(.pri) { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.35); }
.cvv .cvm-seg { border-color: rgba(255,255,255,.4); }
.cvv .cvm-seg button { background: transparent; color: #fff; }
.cvv .cvm-seg button[aria-pressed=true] { background: #2E8B5E; }
.cvv .cvm-btn.pri { background: #2E8B5E; border-color: #52C78C; }
.cvm-needs { background: var(--fz-g-50, #F2FAF6); border: 1px solid var(--fz-g-200, #BFE6D2); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; font-size: .88rem; }
.cvm-needs-h { margin-bottom: 6px; }
.cvm-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.cvm-chips-t { font-size: .76rem; color: var(--fz-ink-3, #5F6B65); min-width: 3.4em; }
.cvm-chip { font: inherit; font-size: .76rem; padding: 2px 9px; border-radius: 999px; border: 1px solid #cfd8d3; background: #fff; color: #333; cursor: pointer; }
.cvm-chip.ok { background: #E3F4EB; border-color: #9fd3b8; color: #14523A; }
.cvm-chip.miss { background: #fdecec; border-color: #e5b4b4; color: #8a1f1f; font-weight: 600; }
.cvm-chip.opt { color: #666; border-style: dashed; }
html.dark .cvm-needs { background: #14201A; border-color: #24402F; color: #E2EAE6; }
html.dark .cvm-chip { background: #1B2621; color: #cfe; }
html.dark .cvm-chip.miss { background: #3a1f1f; color: #ffb4b4; }
a.cvm-btn { text-decoration: none; display: inline-block; }

@media (max-width: 1000px) {
  .cvw-edit { grid-template-columns: minmax(0, 1fr); }
  .cvw-mini { display: none; }
  .cvw-final { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'side' 'prev' 'switch'; }
  .cvw-final .cvw-strip { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 104px; max-height: none; overflow-x: auto; overflow-y: hidden; }
  .cvw-dl { grid-template-columns: 1fr auto; }
}
@media (max-width: 760px) {
  .cvw-cols { grid-template-columns: minmax(0, 1fr); }
  .cvw-steps { gap: 4px; }
  .cvw-steps button { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: .7rem; border-radius: 10px; }
  .cvw-steps button span { white-space: normal; text-align: center; line-height: 1.25; }
  .cvm-tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cvw-tdesc { display: none; }
  .cvw-fsum { margin-left: 0; width: 100%; }
  .cvm-needs { position: static; }
}
@media (max-width: 480px) {
  .cvm { padding: 14px 16px 0; }
  .cvm-row { grid-template-columns: 1fr; }
  .cvm-rep .cvm-row { grid-template-columns: 1fr; }
  .cvm-tcard { padding: 6px; }
  .cvm-tcard b { font-size: .8rem; }
  .cvw-zoomic { width: 28px; height: 28px; font-size: 15px; }
  .cvw-nav .cvm-btn { min-width: 0; flex: 1; }
  .cvw-nav-t { display: none; }
  .cvw-dl { grid-template-columns: 1fr; }
  .cvv-top, .cvv-bot { padding: 6px 8px; gap: 6px; }
  .cvv-bot { justify-content: center; }
  .cvv-bot .cvm-btn.pri { width: 100%; }
  .cvv-stage { padding: 6px; }
}
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff !important; }
  .fz-nav, .fz-foot, .fz-toast, .cvw-toast, .cvv, .cvw-steps, .cvw-nav, .cvw-side, .cvw-switch, .cvm .cvm-title, .cvm .cvm-lead { display: none !important; }
  .cvw-step { display: none !important; }
  .cvw-step[data-step="4"] { display: block !important; }
  .cvm, .cvw-final, .cvm-prev-col, .cvm-prev-box { display: block !important; padding: 0 !important; margin: 0 !important; background: none !important; overflow: visible !important; position: static !important; max-width: none !important; }
  #cvScaler { transform: none !important; width: 210mm !important; height: auto !important; }
  .cv-paper { box-shadow: none !important; }
  .cv-paper.cv-fit-1p { transform-origin: top center !important; }
  .cv-sec, .cv-item, .cv-sign, .cv-decl, tr { break-inside: avoid !important; }
  .cv-paper h2 { break-after: avoid !important; }
}
