/* Shared “detailed worksheet” layout (browser print sheet + controls) — all worksheet keys. */
.cnt-trace-wrap {
    --cnt-paper: #fff;
    --cnt-guide-mid: rgba(0, 0, 0, 0.42);
    --cnt-guide-soft: rgba(0, 0, 0, 0.14);
    --cnt-ink: rgba(0, 0, 0, 0.5);
    /* Match cnt-worksheet-variants + WorksheetPdfService handwriting bands */
    --cnt-hw-asc-y: 24%;
    --cnt-hw-mid-y: 50%;
    --cnt-hw-desc-y: 76%;
    --cnt-hw-dot-strong: rgba(15, 23, 42, 0.44);
    --cnt-hw-dot-soft: rgba(15, 23, 42, 0.26);
}

.cnt-trace-shell {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 991.98px) {
    .cnt-trace-shell {
        grid-template-columns: 1fr;
    }
}

.cnt-trace-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.cnt-trace-control {
    border-radius: 12px;
    border: 1px solid rgba(88, 28, 135, 0.12);
    background: #fff;
    padding: 0.75rem 0.9rem;
}

.cnt-preview-sheet {
    /* Paper guides: darker on capture sheet so rules read on screen + html2canvas + print. */
    --cnt-guide-mid: rgba(15, 23, 42, 0.38);
    --cnt-guide-soft: rgba(15, 23, 42, 0.24);
    --cnt-hw-dot-strong: rgba(15, 23, 42, 0.48);
    --cnt-hw-dot-soft: rgba(15, 23, 42, 0.3);
    background: var(--cnt-paper);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
    border-radius: 6px;
    padding: 1rem 0.95rem 0.8rem;
    width: min(100%, 92%);
    margin-inline: auto;
    min-height: 1080px;
    aspect-ratio: 210 / 297;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.cnt-preview-header {
    display: grid;
    gap: 0.1rem;
    justify-items: center;
    text-align: center;
    padding-bottom: 0.35rem;
    margin-bottom: 0.4rem;
    flex: 0 0 auto;
}

.cnt-sheet-title {
    font-family: "Nunito", system-ui, sans-serif;
    font-size: clamp(0.95rem, 3.2vw, 3.4rem);
    margin: 0;
    color: transparent;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 0.03em;
    -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.88);
    line-height: 1;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

.cnt-sheet-subtitle {
    color: rgba(0, 0, 0, 0.62);
    margin: 0;
    font-size: 0.92rem;
    min-height: 1.2rem;
    width: 100%;
    text-align: center;
}

.cnt-name-line {
    color: rgba(0, 0, 0, 0.68);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.cnt-trace-lines {
    display: grid;
    gap: 0.55rem;
    flex: 1 1 0;
    min-height: 0;
    grid-template-rows: repeat(6, minmax(72px, 1fr));
}

.cnt-trace-lines--seven {
    grid-template-rows: repeat(7, minmax(68px, 1fr));
}

/* min track height avoids flex+min-height:0 collapsing rows to 0px (empty “ghost” worksheet). */
.cnt-trace-lines--four {
    grid-template-rows: repeat(4, minmax(92px, 1fr));
}

.cnt-trace-lines--five {
    grid-template-rows: repeat(5, minmax(88px, 1fr));
}

/*
 * Primary handwriting paper: solid top & bottom rules + dashed waist
 * (matches common classroom masters / your reference sheets).
 */
.cnt-trace-row.cnt-trace-row--primary-paper::before {
    top: var(--cnt-hw-asc-y);
    height: 0;
    margin-top: 0;
    background: none;
    background-image: none;
    border-top: 2px solid rgba(15, 23, 42, 0.88);
}

.cnt-trace-row.cnt-trace-row--primary-paper::after {
    top: var(--cnt-hw-desc-y);
    height: 0;
    margin-top: 0;
    background: none;
    background-image: none;
    border-top: 2px solid rgba(15, 23, 42, 0.88);
}

.cnt-trace-row.cnt-trace-row--primary-paper > .cnt-trace-band {
    top: var(--cnt-hw-mid-y);
    height: 0;
    margin-top: 0;
    background: none;
    background-image: none;
    border-top: 2px dashed rgba(15, 23, 42, 0.42);
}

/* Descenders may dip below the bottom rule like classroom masters. */
.cnt-trace-row.cnt-trace-row--primary-paper {
    overflow-x: hidden;
    overflow-y: visible;
}

/* mocks/customname6.html — flex-end + tight line-height on dotted rows */
.cnt-trace-row--primary-paper > .cnt-trace-name {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
}

/* mocks/customname6.html — plain text + 0.97 lh + 2px tracking (avoid per-letter inline-block misalignment) */
.cnt-wv-sheet--ntp .cnt-trace-row--primary-paper > .cnt-trace-name.js-cnt-trace-name {
    line-height: 0.97;
    letter-spacing: 2px;
}

.cnt-wv-sheet--ntp .cnt-trace-row--primary-paper > .cnt-trace-name.cnt-trace-name--model {
    line-height: 0.97;
    letter-spacing: 2px;
}

/* Three rules only: solid / dashed / solid — full bleed like mocks/customname6.html */
.cnt-wv-sheet--ntp.cnt-wv-sheet--trace-grid .cnt-trace-row--primary-paper::before,
.cnt-wv-sheet--ntp.cnt-wv-sheet--trace-grid .cnt-trace-row--primary-paper::after,
.cnt-wv-sheet--ntp.cnt-wv-sheet--trace-grid .cnt-trace-row--primary-paper > .cnt-trace-band {
    left: 0;
    right: 0;
    background: none;
    background-image: none;
}

/*
 * mocks/customname6.html — .guide-row is full height; .tracing-text is flex-end to row bottom.
 * Do NOT clip the name to 20%–90% (that pins flex-end to the baseline line and sits text high).
 */
.cnt-wv-sheet--ntp.cnt-wv-sheet--trace-grid .cnt-trace-row--primary-paper > .cnt-trace-name {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    overflow: hidden;
}

.cnt-trace-name.cnt-trace-name--model {
    font-family: "Inter", system-ui, sans-serif;
    font-weight: 600;
    color: #000000;
    letter-spacing: 0.02em;
    /* Let JS font-size match dotted rows; keep clamp from fighting the model line */
    font-size: unset;
}

.cnt-wv-sheet--ntp.cnt-wv-sheet--trace-grid .cnt-trace-name.js-cnt-trace-name {
    color: #334155;
}

/* Name-tracing inner “paper” — flat like mocks/customname6.html (no tinted card frame) */
.cnt-preview-sheet .cnt-wv-sheet.cnt-wv-sheet--ntp {
    border: none;
    border-radius: 0;
    padding: 0;
    background: #fff;
    box-sizing: border-box;
    box-shadow: none;
}

.cnt-preview-sheet .cnt-wv-sheet.cnt-wv-sheet--hello {
    border: 3px solid #9b59b6;
    border-radius: 18px;
    padding: 1rem 1.15rem 0.85rem;
    background: #fff;
    box-sizing: border-box;
}

/* Guarantee trace grid keeps height inside flex preview (ntp / hello). */
.cnt-preview-sheet .cnt-wv-sheet.cnt-wv-sheet--ntp .cnt-trace-lines,
.cnt-preview-sheet .cnt-wv-sheet.cnt-wv-sheet--hello .cnt-trace-lines {
    flex: 1 1 auto;
    min-height: 280px;
}

.cnt-preview-sheet[data-worksheet-key="name-tracing-practice"] .cnt-wv-sheet.cnt-wv-sheet--ntp.cnt-wv-sheet--trace-grid {
    gap: 0;
}

.cnt-preview-sheet[data-worksheet-key="hello-my-name"] .cnt-wv-sheet.cnt-wv-sheet--hello.cnt-wv-sheet--trace-grid {
    gap: 0.45rem;
}

.cnt-preview-sheet[data-worksheet-key="name-tracing-practice"] .cnt-wv-sheet--ntp {
    padding: 0;
}

.cnt-preview-sheet[data-worksheet-key="hello-my-name"] .cnt-wv-sheet--hello {
    padding: 0.85rem 1rem 0.95rem;
}

.cnt-preview-sheet[data-worksheet-key="name-tracing-practice"] .cnt-trace-row--ntp-mock {
    border-radius: 0;
    box-shadow: none;
}

.cnt-preview-sheet[data-worksheet-key="hello-my-name"] .cnt-trace-row {
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.055);
}

/* mocks/customname6.html — .sheet-header */
.cnt-ntp-mock-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 2rem;
    padding-bottom: 5px;
    border-bottom: 2px solid #000000;
}

.cnt-ntp-mock-title {
    font-family: "Inter", system-ui, sans-serif;
    font-size: clamp(1rem, 2.4vw, 1.25rem);
    font-weight: 700;
    color: #000000;
    margin: 0;
    line-height: 1.2;
}

.cnt-ntp-mock-name-field {
    font-family: "Inter", system-ui, sans-serif;
    font-size: clamp(0.8rem, 1.8vw, 0.875rem);
    font-weight: 400;
    color: #334155;
    margin: 0;
    white-space: nowrap;
}

/* NTP sheet: mock guide geometry (20% / 55% / 90% of 100px row) + slate line colors */
.cnt-wv-sheet.cnt-wv-sheet--ntp.cnt-wv-sheet--trace-grid {
    --cnt-hw-asc-y: 20%;
    --cnt-hw-mid-y: 55%;
    --cnt-hw-desc-y: 90%;
}

/* Rows stretch with grid tracks (minmax…1fr); do not lock to 100px or the page stays empty below. */
.cnt-wv-sheet--ntp .cnt-trace-row.cnt-trace-row--primary-paper {
    min-height: 0;
    height: auto;
    max-height: none;
}

.cnt-trace-row.cnt-trace-row--primary-paper::before {
    border-top-width: 1.5px;
    border-top-color: #475569;
}

.cnt-trace-row.cnt-trace-row--primary-paper::after {
    border-top-width: 1.5px;
    border-top-color: #475569;
}

.cnt-trace-row.cnt-trace-row--primary-paper > .cnt-trace-band {
    border-top-width: 1.5px;
    border-top-color: #94a3b8;
    border-top-style: dashed;
}

/*
 * mocks/customname6.html — real line divs + flex row (no .cnt-trace-row::before dot stripes / cascade fights).
 */
.cnt-trace-row.cnt-trace-row--ntp-mock::before,
.cnt-trace-row.cnt-trace-row--ntp-mock::after {
    content: none !important;
    display: none !important;
}

.cnt-trace-row.cnt-trace-row--ntp-mock {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    width: 100%;
    min-height: 0;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    /* mock .guide-row — sole flex item is the tracing span */
    box-sizing: border-box;
}

.cnt-ntp-mock-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.cnt-ntp-mock-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.cnt-ntp-mock-line--top {
    top: 20%;
    border-top: 1.5px solid #475569;
}

.cnt-ntp-mock-line--mid {
    top: 55%;
    border-top: 1.5px dashed #94a3b8;
}

.cnt-ntp-mock-line--base {
    top: 90%;
    border-top: 1.5px solid #475569;
}

/* mocks/customname6.html .tracing-text — inline-level flex item + lh 0.97 (not full-width block) */
.cnt-trace-row--ntp-mock > .cnt-ntp-mock-type.cnt-trace-name {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 5;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    max-width: 100%;
    width: auto;
    display: inline-block !important;
    white-space: nowrap;
    overflow: visible;
    text-align: center;
    line-height: 0.97 !important;
    letter-spacing: 2px !important;
    font-size: unset;
    font-weight: 400;
    vertical-align: bottom;
}

.cnt-trace-row--ntp-mock > .cnt-ntp-mock-type.cnt-trace-name.js-cnt-trace-name {
    color: #334155;
}

.cnt-trace-row--ntp-mock > .cnt-ntp-mock-type.cnt-trace-name.cnt-trace-name--model {
    font-family: "Inter", system-ui, sans-serif;
    font-weight: 600;
    color: #000000;
}

.cnt-hello-title {
    font-family: "Nunito", system-ui, sans-serif;
    font-size: clamp(1.25rem, 3.2vw, 1.85rem);
    font-weight: 900;
    color: #485a8c;
    text-align: center;
    margin: 0 0 0.75rem;
    letter-spacing: 0.02em;
}

.cnt-hello-footer {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    padding-top: 0.35rem;
}

.cnt-hello-unicorn {
    max-width: min(200px, 55%);
    height: auto;
}

.cnt-trace-row {
    position: relative;
    min-height: 132px;
    background: #fff;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

/* Triple handwriting line — round dots (stable in capture + print) */
.cnt-trace-row::before {
    content: "";
    position: absolute;
    left: clamp(0.45rem, 1.2vw, 0.85rem);
    right: clamp(0.45rem, 1.2vw, 0.85rem);
    top: var(--cnt-hw-asc-y);
    height: 3px;
    margin-top: -1px;
    pointer-events: none;
    border: none;
    background-image: radial-gradient(circle at 50% 50%, var(--cnt-hw-dot-strong) 0.72px, transparent 1.08px);
    background-repeat: repeat-x;
    background-size: 5px 3px;
    background-position: 0 50%;
}

.cnt-trace-row::after {
    content: "";
    position: absolute;
    left: clamp(0.45rem, 1.2vw, 0.85rem);
    right: clamp(0.45rem, 1.2vw, 0.85rem);
    top: var(--cnt-hw-desc-y);
    height: 3px;
    margin-top: -1px;
    pointer-events: none;
    border: none;
    background-image: radial-gradient(circle at 50% 50%, var(--cnt-hw-dot-strong) 0.72px, transparent 1.08px);
    background-repeat: repeat-x;
    background-size: 5px 3px;
    background-position: 0 50%;
}

.cnt-trace-row > .cnt-trace-band {
    position: absolute;
    left: clamp(0.45rem, 1.2vw, 0.85rem);
    right: clamp(0.45rem, 1.2vw, 0.85rem);
    top: var(--cnt-hw-mid-y);
    height: 3px;
    margin-top: -1px;
    pointer-events: none;
    border: none;
    background-image: radial-gradient(circle at 50% 50%, var(--cnt-hw-dot-soft) 0.65px, transparent 1px);
    background-repeat: repeat-x;
    background-size: 5px 3px;
    background-position: 0 50%;
}

.cnt-trace-name {
    position: absolute;
    /* Writing band: top at ascender line, bottom inset = distance from bottom edge to descender line (same as New project top:24% + bottom:24% when guides are 24%/76%). */
    top: var(--cnt-hw-asc-y);
    right: clamp(10px, 2vw, 18px);
    bottom: calc(100% - var(--cnt-hw-desc-y));
    left: clamp(10px, 2vw, 18px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: clamp(1.85rem, 3.6vw, 2.75rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.015em;
    color: rgba(0, 0, 0, 0.78);
    white-space: nowrap;
    overflow: hidden;
}

.cnt-trace-name.is-uppercase {
    text-transform: uppercase;
}

.cnt-trace-name.is-lowercase {
    text-transform: lowercase;
}

/* Raleway Dots only ships at 400 — heavier weight breaks the dotted outline in preview + capture */
.cnt-trace-name.cnt-font-raleway-dots {
    font-family: "Raleway Dots", cursive;
    font-weight: 400;
}

.cnt-trace-name .cnt-trace-letter {
    font-family: inherit;
    font-weight: inherit;
}

.cnt-font-raleway-dots {
    font-family: "Raleway Dots", cursive;
    letter-spacing: 0.04em;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    font-feature-settings: "liga" 0, "clig" 0;
}

.cnt-font-edu-hand {
    font-family: "Edu AU VIC WA NT Hand", cursive;
    letter-spacing: 0.03em;
    font-weight: 500;
    color: rgba(31, 41, 55, 0.58);
    -webkit-text-stroke: 0.45px rgba(31, 41, 55, 0.6);
}

.cnt-font-cursive {
    font-family: "Caveat", cursive;
    letter-spacing: 0.01em;
    font-weight: 500;
    color: rgba(31, 41, 55, 0.58);
    -webkit-text-stroke: 0.45px rgba(31, 41, 55, 0.6);
}

.cnt-font-andika {
    font-family: "Andika", sans-serif;
    letter-spacing: 0.02em;
    font-weight: 400;
    color: rgba(31, 41, 55, 0.58);
    -webkit-text-stroke: 0.42px rgba(31, 41, 55, 0.6);
}

.cnt-font-patrick-hand {
    font-family: "Patrick Hand", cursive;
    letter-spacing: 0.02em;
    font-weight: 400;
    color: rgba(31, 41, 55, 0.58);
    -webkit-text-stroke: 0.42px rgba(31, 41, 55, 0.6);
}

.cnt-font-schoolbell {
    font-family: "Schoolbell", cursive;
    letter-spacing: 0.015em;
    font-weight: 400;
    color: rgba(31, 41, 55, 0.58);
    -webkit-text-stroke: 0.42px rgba(31, 41, 55, 0.6);
}

.cnt-font-coming-soon {
    font-family: "Coming Soon", cursive;
    letter-spacing: 0.015em;
    font-weight: 400;
    color: rgba(31, 41, 55, 0.58);
    -webkit-text-stroke: 0.42px rgba(31, 41, 55, 0.6);
}

.cnt-font-short-stack {
    font-family: "Short Stack", cursive;
    letter-spacing: 0.01em;
    font-weight: 400;
    color: rgba(31, 41, 55, 0.58);
    -webkit-text-stroke: 0.42px rgba(31, 41, 55, 0.6);
}

.cnt-font-comic-neue {
    font-family: "Comic Neue", cursive;
    letter-spacing: 0.015em;
    font-weight: 700;
    color: rgba(31, 41, 55, 0.58);
    -webkit-text-stroke: 0.38px rgba(31, 41, 55, 0.6);
}

.cnt-font-comfortaa {
    font-family: "Comfortaa", sans-serif;
    letter-spacing: 0.01em;
    font-weight: 700;
    color: rgba(31, 41, 55, 0.58);
    -webkit-text-stroke: 0.38px rgba(31, 41, 55, 0.6);
}

.cnt-font-fredoka {
    font-family: "Fredoka", sans-serif;
    letter-spacing: 0.01em;
    font-weight: 600;
    color: rgba(31, 41, 55, 0.58);
    -webkit-text-stroke: 0.38px rgba(31, 41, 55, 0.6);
}

.cnt-font-quicksand {
    font-family: "Quicksand", sans-serif;
    letter-spacing: 0.015em;
    font-weight: 700;
    color: rgba(31, 41, 55, 0.58);
    -webkit-text-stroke: 0.38px rgba(31, 41, 55, 0.6);
}

.cnt-trace-letter {
    display: inline-block;
}

.cnt-trace-letter:first-child {
    opacity: 0.82;
}

.cnt-tracing-footer {
    margin-top: auto;
    padding-top: 0.65rem;
    text-align: center;
    font-size: 0.76rem;
    color: #94a3b8;
}

.cnt-preview-sheet .cnt-preview-body {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Fills the A4 preview body so worksheet content can grow with the paper (html2canvas). */
.cnt-wv-print-fill {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    container-type: size;
    container-name: wv-print;
}

.cnt-wv-print-fill > .cnt-trace-lines {
    flex: 1 1 auto;
    min-height: 0;
}

.cnt-wv-print-fill > .cnt-wv-heart-band {
    flex: 0 0 auto;
    align-self: center;
    width: 100%;
}

/* Big-name + repeat-the-name: sheet wraps header + full-page trace grid (same flex contract). */
.cnt-wv-print-fill > .cnt-wv-sheet.cnt-wv-sheet--trace-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(0.35rem, 1.1cqh, 0.75rem);
}

.cnt-wv-print-fill > .cnt-wv-sheet.cnt-wv-sheet--trace-grid > .cnt-wv-sheet-head {
    flex: 0 0 auto;
}

.cnt-wv-print-fill > .cnt-wv-sheet.cnt-wv-sheet--trace-grid > .cnt-trace-lines {
    flex: 1 1 auto;
    min-height: 0;
}

/*
 * NTP / hello capture: match New project `name_tracing.php` — fraction rows fill the A4 body (minmax(…, 1fr) + flex: 1 1 0).
 * Placed after .cnt-wv-print-fill > … > .cnt-trace-lines; #cntTracingWorksheet raises specificity.
 */
#cntTracingWorksheet[data-worksheet-key="name-tracing-practice"] .cnt-wv-print-fill .cnt-wv-sheet.cnt-wv-sheet--ntp .cnt-trace-lines.cnt-trace-lines--ntp-mock,
#cntTracingWorksheet[data-worksheet-key="hello-my-name"] .cnt-wv-print-fill .cnt-wv-sheet.cnt-wv-sheet--hello .cnt-trace-lines.cnt-trace-lines--five {
    flex: 1 1 0;
    min-height: 0;
    gap: 0.62rem;
}

#cntTracingWorksheet[data-worksheet-key="name-tracing-practice"] .cnt-wv-print-fill .cnt-wv-sheet.cnt-wv-sheet--ntp .cnt-trace-lines.cnt-trace-lines--ntp-mock {
    flex: 1 1 auto;
    align-self: stretch;
    gap: 15px;
    /* Fill sheet under header like mocks/customname6.html — equal growing bands */
    grid-template-rows: repeat(6, minmax(72px, 1fr));
}

/* Let 1fr rows shrink to the track */
#cntTracingWorksheet[data-worksheet-key="name-tracing-practice"] .cnt-trace-lines--ntp-mock > .cnt-trace-row--ntp-mock {
    min-height: 0;
}

#cntTracingWorksheet[data-worksheet-key="hello-my-name"] .cnt-wv-print-fill .cnt-wv-sheet.cnt-wv-sheet--hello .cnt-trace-lines.cnt-trace-lines--five {
    grid-template-rows: repeat(5, minmax(0, 1fr));
}

#cntTracingWorksheet[data-worksheet-key="hello-my-name"] .cnt-wv-sheet--hello .cnt-hello-footer {
    margin-top: auto;
}

.cnt-wv-print-fill > .cnt-wv-sheet {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(0.45rem, 1.4cqh, 1rem);
}

/* Sentence starter / similar: grow the first “card” block so practice bands use more of the page. */
.cnt-wv-print-fill > .cnt-wv-sheet > .rounded-3.border.bg-white.mb-3,
.cnt-wv-print-fill > .cnt-wv-sheet > .rounded-3.border.bg-white {
    flex: 1 1 auto;
    min-height: max(11rem, 26cqh);
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: clamp(0.35rem, 1cqh, 0.75rem);
}

.cnt-wv-print-fill > .cnt-wv-sheet > .cnt-wv-trace-row {
    flex: 1 1 7rem;
    min-height: max(6.5rem, 12cqh);
}

.cnt-wv-print-fill > .cnt-wv-sheet > .cnt-wv-trace-row:last-child {
    flex: 2 1 9rem;
    min-height: max(7.5rem, 18cqh);
}

/* Nested trace rows (cards, phonics blocks) still get taller bands on the capture sheet. */
.cnt-wv-print-fill .cnt-wv-sheet .cnt-wv-trace-row {
    min-height: max(5.5rem, min(10rem, 10cqh));
}

.cnt-wv-print-fill > .cnt-wv-sheet > .rounded-3.border.bg-white .cnt-wv-trace-row {
    flex: 1 1 4.25rem;
    min-height: max(5.25rem, 11cqh);
    margin-bottom: 0.35rem;
}

.cnt-wv-print-fill > .cnt-wv-sheet > .cnt-wv-lead,
.cnt-wv-print-fill > .cnt-wv-sheet > .cnt-wv-box-grid {
    flex: 0 0 auto;
}

.cnt-preview-sheet .cnt-wv-sheet {
    max-width: none;
    margin: 0;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0.35rem 0 0;
}

@media (max-width: 575.98px) {
    .cnt-preview-sheet {
        min-height: 920px;
        padding: 0.85rem 0.65rem 0.75rem;
    }

    .cnt-trace-row {
        min-height: 100px;
    }
}
