/* ============================================================
   Biodata maker (/biodata-maker) - editor extras and the four
   paper templates (royal, floral, modern, minimal).
   Paper rules are scoped under .dst-paper so they also apply in
   the print frame (this file is linked with data-dst-print).
   ============================================================ */

/* ---------------- page theme ---------------- */
.dst[data-tool="biodata"] {
    --dst-hero-1: #22060f;
    --dst-hero-2: #4a0f2a;
    --dst-hero-3: #3a1a08;
}
.dst[data-tool="biodata"] .dst-hero::before,
.dst[data-tool="biodata"] .dst-hero::after {
    content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none;
    background: repeating-conic-gradient(from 0deg, rgba(232, 184, 92, .22) 0deg 3deg, transparent 3deg 15deg);
    -webkit-mask: radial-gradient(circle, transparent 38%, #000 39%, #000 49%, transparent 50%, transparent 58%, #000 59%, #000 70%, transparent 71%);
    mask: radial-gradient(circle, transparent 38%, #000 39%, #000 49%, transparent 50%, transparent 58%, #000 59%, #000 70%, transparent 71%);
    animation: bd-spin 120s linear infinite;
}
.dst[data-tool="biodata"] .dst-hero::before { width: 560px; height: 560px; right: -170px; top: -190px; }
.dst[data-tool="biodata"] .dst-hero::after { width: 380px; height: 380px; left: -150px; bottom: -170px; animation-direction: reverse; }
.dst[data-tool="biodata"] .dst-eyebrow { color: #fde7c2; background: rgba(232, 184, 92, .14); border-color: rgba(232, 184, 92, .32); }
.dst[data-tool="biodata"] .dst-lede, .dst[data-tool="biodata"] .dst-trust { color: #f1d9e1; }
.dst[data-tool="biodata"] .dst-trust li::before { content: ""; width: 7px; height: 7px; transform: rotate(45deg); background: #e8b85c; border-radius: 1px; }

/* template picker thumbnails in the template's own mood */
.dst[data-tool="biodata"] .dst-tpl[data-dst-template="royal"] .dst-tpl-thumb { background: #fffbf3; }
.dst[data-tool="biodata"] .dst-tpl[data-dst-template="royal"] .dst-tpl-thumb::before { box-shadow: inset 0 0 0 3px #fffbf3, inset 0 0 0 4px #c9a24e; }
.dst[data-tool="biodata"] .dst-tpl[data-dst-template="floral"] .dst-tpl-thumb { background: #fff6f9; }
.dst[data-tool="biodata"] .dst-tpl[data-dst-template="floral"] .dst-tpl-thumb::before { left: 17px; right: 17px; top: 6px; height: 22px; border-radius: 50%; border: 2px solid #c9a24e; }
.dst[data-tool="biodata"] .dst-tpl[data-dst-template="floral"] .dst-tpl-thumb::after { top: 36px; }

/* ---------------- editor extras ---------------- */
.bd-msg { margin: 0; padding: 10px 14px; border-radius: 12px; background: #fff1f3; border: 1px solid #fecdd6; color: #9f1239; font-size: 13.5px; font-weight: 600; animation: dst-rise .2s ease both; }
.bd-msg:empty { display: none; }
.bd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.bd-chip {
    max-width: 100%; padding: 5px 10px; border: 1px solid #f1d3dd; border-radius: 999px; background: #fff8fa; color: #7a1f3d;
    font-size: 12.5px; font-weight: 600; line-height: 1.3; cursor: pointer; overflow-wrap: anywhere; text-align: left;
    font-family: "Noto Sans", "Noto Sans Devanagari", "Segoe UI", sans-serif; transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.bd-chip:hover, .bd-chip:focus-visible { background: #fdeef3; border-color: var(--dst-accent); transform: translateY(-1px); }
.bd-chip:focus-visible { outline: 3px solid color-mix(in srgb, var(--dst-accent) 35%, transparent); outline-offset: 1px; }
.bd-chip.is-clear { background: #fff; color: var(--dst-ink-3); border-style: dashed; border-color: #d6dae6; }
.bd-note { margin: 2px 0 0; padding: 7px 10px; border-radius: 10px; background: #effaf3; color: #166534; font-size: 12.5px; font-weight: 600; }
.bd-note.is-off { background: #fff7e6; color: #8a5300; }
.bd-note:empty { display: none; }
.bd-subhead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--dst-line); }
.bd-gap { margin-top: 14px; }
.dst[data-tool="biodata"] .dst-sec[open] > summary .dst-sec-icon { background: linear-gradient(135deg, #fde7ef, #fdf1dc); }
.dst[data-tool="biodata"] .dst-image-thumb.is-round { width: 72px; height: 72px; box-shadow: 0 0 0 3px #fff, 0 0 0 4px #e8c27a; }

/* arrange sections */
.bd-layout { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: bdsec; }
.bd-layout-item {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px;
    border-radius: 12px; background: var(--dst-soft); border: 1px solid var(--dst-line); transition: opacity .2s ease, background-color .2s ease;
}
.bd-layout-item .dst-input { height: 36px; background: #fff; }
.bd-layout-item.is-off { opacity: .62; background: #fff; border-style: dashed; }
.bd-layout-note { grid-column: 2 / -1; margin-top: -4px; font-size: 12px; font-weight: 600; color: #8a5300; }
.bd-layout-note:empty { display: none; }
.bd-switch { position: relative; display: inline-flex; width: 38px; height: 22px; margin: 0; cursor: pointer; }
.bd-switch input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bd-switch-ui { width: 100%; height: 100%; border-radius: 999px; background: #cfd4e2; transition: background-color .2s ease; }
.bd-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s ease; }
.bd-switch input:checked + .bd-switch-ui { background: var(--dst-accent); }
.bd-switch input:checked + .bd-switch-ui::after { transform: translateX(16px); }
.bd-switch input:focus-visible + .bd-switch-ui { outline: 3px solid color-mix(in srgb, var(--dst-accent) 35%, transparent); outline-offset: 2px; }

@keyframes bd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .dst[data-tool="biodata"] .dst-hero::before, .dst[data-tool="biodata"] .dst-hero::after, .bd-msg { animation: none !important; }
    .bd-chip, .bd-switch-ui, .bd-switch-ui::after { transition: none; }
}

/* ============================================================
   paper
   ============================================================ */
.dst-paper .bd-sheet {
    --bd-gold: #b8903c;
    --bd-serif: "Noto Serif", "Noto Serif Devanagari", "Noto Sans Devanagari", "Noto Sans Gujarati", "Noto Sans Gurmukhi", "Noto Sans Bengali", "Noto Sans Tamil", "Noto Sans Telugu", "Noto Sans Kannada", "Noto Sans Malayalam", "Noto Naskh Arabic", "Nirmala UI", Georgia, "Times New Roman", serif;
    --bd-sans: "Noto Sans", "Noto Sans Devanagari", "Noto Sans Gujarati", "Noto Sans Gurmukhi", "Noto Sans Bengali", "Noto Sans Tamil", "Noto Sans Telugu", "Noto Sans Kannada", "Noto Sans Malayalam", "Noto Naskh Arabic", "Nirmala UI", "Segoe UI", Arial, sans-serif;
    position: relative; width: 794px; height: 1123px; overflow: hidden; background: #fff; color: #2a1f24;
    font-family: var(--bd-sans); font-size: 14px; line-height: 1.5;
}
.dst-paper .bd-sheet *, .dst-paper .bd-sheet *::before, .dst-paper .bd-sheet *::after { box-sizing: border-box; }
.dst-paper .bd-decor { position: absolute; inset: 0; pointer-events: none; }
.dst-paper .bd-body { position: absolute; inset: 0; overflow: hidden; }
.dst-paper .bd-flow { display: flow-root; }
.dst-paper .bd-name { overflow-wrap: anywhere; }
.dst-paper .bd-name.is-placeholder { opacity: .38; }
.dst-paper .bd-invocation, .dst-paper .bd-doctitle, .dst-paper .bd-meta { overflow-wrap: anywhere; }
.dst-paper .bd-orn { display: block; width: 250px; height: 21px; margin: 8px auto; color: var(--doc-accent); }
.dst-paper .bd-orn.is-flip { transform: scaleY(-1); }
.dst-paper .bd-sec { display: flow-root; }
.dst-paper .bd-sec-title { display: flex; align-items: center; gap: 12px; }
.dst-paper .bd-sec-title-text { overflow-wrap: anywhere; }
.dst-paper .bd-row { display: grid; grid-template-columns: 196px 16px minmax(0, 1fr); padding: 3px 0; }
.dst-paper .bd-label { font-weight: 700; overflow-wrap: anywhere; padding-right: 8px; }
.dst-paper .bd-value { overflow-wrap: anywhere; }
.dst-paper .bd-text { margin: 0 0 7px; line-height: 1.6; overflow-wrap: anywhere; }
.dst-paper .bd-empty { margin: 60px 0 0; text-align: center; color: #8a8190; font-size: 15px; font-style: italic; }
.dst-paper .bd-foot { position: absolute; left: 0; right: 0; bottom: 42px; text-align: center; font-family: var(--bd-sans); font-size: 11px; color: #8a8190; }
.dst-paper .bd-photo { overflow: hidden; background: #f4eef0; }
.dst-paper .bd-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dst-paper .bd-mono { display: grid; place-items: center; width: 100%; height: 100%; font-family: var(--bd-serif); font-weight: 700; color: var(--doc-accent); background: color-mix(in srgb, var(--doc-accent) 14%, #fff); }
.dst-paper .bd-corner { position: absolute; color: var(--doc-accent); }
.dst-paper .bd-corner-tr { transform: scaleX(-1); }
.dst-paper .bd-corner-bl { transform: scaleY(-1); }
.dst-paper .bd-corner-br { transform: scale(-1, -1); }

/* ---------------- Royal ---------------- */
.dst-paper[data-template="royal"] .bd-sheet { background: #fffbf3; font-family: var(--bd-serif); color: #2a1d17; }
.dst-paper[data-template="royal"] .bd-frame-outer { position: absolute; inset: 24px; border: 3px solid var(--doc-accent); }
.dst-paper[data-template="royal"] .bd-frame-inner { position: absolute; inset: 33px; border: 1px solid var(--bd-gold); }
.dst-paper[data-template="royal"] .bd-corner { width: 64px; height: 64px; }
.dst-paper[data-template="royal"] .bd-corner-tl { left: 33px; top: 33px; }
.dst-paper[data-template="royal"] .bd-corner-tr { right: 33px; top: 33px; }
.dst-paper[data-template="royal"] .bd-corner-bl { left: 33px; bottom: 33px; }
.dst-paper[data-template="royal"] .bd-corner-br { right: 33px; bottom: 33px; }
.dst-paper[data-template="royal"] .bd-body { padding: 78px 84px 90px; }
.dst-paper[data-template="royal"] .bd-head { text-align: center; margin-bottom: 18px; }
.dst-paper[data-template="royal"] .bd-invocation { font-size: 15px; color: var(--doc-accent); letter-spacing: .02em; }
.dst-paper[data-template="royal"] .bd-name { margin: 6px 0 2px; font-size: 34px; line-height: 1.2; font-weight: 700; color: var(--doc-accent); }
.dst-paper[data-template="royal"] .bd-doctitle { font-family: var(--bd-sans); font-size: 12.5px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: #9a7431; }
.dst-paper[data-template="royal"] .bd-photo { float: right; width: 139px; height: 173px; margin: 12px 9px 14px 26px; padding: 3px; background: #fff; border: 1px solid var(--bd-gold); outline: 2px solid var(--doc-accent); outline-offset: 5px; }
.dst-paper[data-template="royal"] .bd-photo .bd-mono { font-size: 44px; }
.dst-paper[data-template="royal"] .bd-sec { margin-bottom: 12px; }
.dst-paper[data-template="royal"] .bd-sec.is-cont { margin-top: 0; }
.dst-paper[data-template="royal"] .bd-sec-title { margin: 6px 0 8px; font-size: 16.5px; font-weight: 700; letter-spacing: .05em; color: var(--doc-accent); }
.dst-paper[data-template="royal"] .bd-sec-title::before,
.dst-paper[data-template="royal"] .bd-sec-title::after { content: ""; flex: 1; height: 7px; background: linear-gradient(var(--bd-gold), var(--bd-gold)) center / 100% 1px no-repeat; }
.dst-paper[data-template="royal"] .bd-sec-title::before { -webkit-mask: linear-gradient(90deg, transparent, #000 30%); mask: linear-gradient(90deg, transparent, #000 30%); }
.dst-paper[data-template="royal"] .bd-sec-title::after { -webkit-mask: linear-gradient(270deg, transparent, #000 30%); mask: linear-gradient(270deg, transparent, #000 30%); }
.dst-paper[data-template="royal"] .bd-sec-title-text::before,
.dst-paper[data-template="royal"] .bd-sec-title-text::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 10px 3px; transform: rotate(45deg); background: var(--bd-gold); }
.dst-paper[data-template="royal"] .bd-label { color: #5b3a29; }
.dst-paper[data-template="royal"] .bd-colon { color: var(--bd-gold); font-weight: 700; }
.dst-paper[data-template="royal"] .bd-foot { bottom: 50px; }

/* ---------------- Floral ---------------- */
.dst-paper[data-template="floral"] .bd-sheet { background: color-mix(in srgb, var(--doc-accent) 3.5%, #fff); }
.dst-paper[data-template="floral"] .bd-frame-inner { position: absolute; inset: 40px; border: 1px solid color-mix(in srgb, var(--doc-accent) 55%, #fff); border-radius: 13px; }
.dst-paper[data-template="floral"] .bd-corner { width: 134px; height: 134px; }
.dst-paper[data-template="floral"] .bd-corner-tl { left: 22px; top: 22px; }
.dst-paper[data-template="floral"] .bd-corner-tr { right: 22px; top: 22px; }
.dst-paper[data-template="floral"] .bd-corner-bl { left: 22px; bottom: 22px; }
.dst-paper[data-template="floral"] .bd-corner-br { right: 22px; bottom: 22px; }
.dst-paper[data-template="floral"] .bd-body { padding: 86px 90px 96px; }
.dst-paper[data-template="floral"] .bd-head { text-align: center; margin-bottom: 14px; }
.dst-paper[data-template="floral"] .bd-invocation { font-family: var(--bd-serif); font-size: 15px; color: var(--doc-accent); }
.dst-paper[data-template="floral"] .bd-photo.is-round { width: 144px; height: 144px; margin: 18px auto 24px; border-radius: 50%; border: 3px solid var(--doc-accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--doc-accent) 3.5%, #fff), 0 0 0 7px var(--bd-gold); }
.dst-paper[data-template="floral"] .bd-photo .bd-mono { font-size: 46px; }
.dst-paper[data-template="floral"] .bd-name { font-family: var(--bd-serif); font-size: 32px; line-height: 1.2; font-weight: 700; color: var(--doc-accent); }
.dst-paper[data-template="floral"] .bd-doctitle { margin-top: 4px; font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: #7b6a72; }
.dst-paper[data-template="floral"] .bd-sec { margin-bottom: 12px; }
.dst-paper[data-template="floral"] .bd-sec-title { justify-content: center; margin: 6px 0 10px; font-family: var(--bd-serif); font-size: 17px; font-weight: 700; color: var(--doc-accent); }
.dst-paper[data-template="floral"] .bd-sec-title::before,
.dst-paper[data-template="floral"] .bd-sec-title::after { content: ""; width: 16px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--doc-accent) 55%, #fff); box-shadow: -12px 0 0 -2px var(--bd-gold); }
.dst-paper[data-template="floral"] .bd-sec-title::after { box-shadow: 12px 0 0 -2px var(--bd-gold); }
.dst-paper[data-template="floral"] .bd-label { color: var(--doc-accent); }
.dst-paper[data-template="floral"] .bd-colon { color: var(--doc-accent); font-weight: 700; }
.dst-paper[data-template="floral"] .bd-foot { bottom: 54px; }

/* ---------------- Modern ---------------- */
.dst-paper[data-template="modern"] .bd-sheet { font-family: var(--bd-sans); color: #1f2433; }
.dst-paper[data-template="modern"] .bd-body { padding: 64px 67px 80px; }
.dst-paper[data-template="modern"] .bd-sheet.is-cont .bd-topbar { position: absolute; left: 0; right: 0; top: 0; height: 11px; background: var(--doc-accent); }
.dst-paper[data-template="modern"] .bd-bottombar { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; background: color-mix(in srgb, var(--doc-accent) 70%, #fff); }
.dst-paper[data-template="modern"] .bd-band {
    position: relative; display: flex; align-items: center; gap: 36px; min-height: 224px; margin: -64px -67px 34px; padding: 30px 67px; color: #fff; overflow: hidden;
    background: radial-gradient(circle at calc(100% - 53px) 27px, color-mix(in srgb, var(--doc-accent) 82%, #fff) 0 82px, color-mix(in srgb, var(--doc-accent) 88%, #fff) 82px 120px, transparent 120px), var(--doc-accent);
}
.dst-paper[data-template="modern"] .bd-band .bd-photo { flex: none; width: 147px; height: 147px; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 10px 26px rgba(0,0,0,.18); }
.dst-paper[data-template="modern"] .bd-band .bd-photo .bd-mono { font-size: 48px; }
.dst-paper[data-template="modern"] .bd-band-text { position: relative; min-width: 0; }
.dst-paper[data-template="modern"] .bd-invocation { font-size: 12.5px; opacity: .82; margin-bottom: 4px; }
.dst-paper[data-template="modern"] .bd-doctitle { font-size: 11.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; opacity: .78; }
.dst-paper[data-template="modern"] .bd-name { margin: 2px 0 6px; font-size: 32px; line-height: 1.15; font-weight: 700; color: #fff; }
.dst-paper[data-template="modern"] .bd-meta { font-size: 13.5px; opacity: .95; }
.dst-paper[data-template="modern"] .bd-sec { margin-bottom: 14px; }
.dst-paper[data-template="modern"] .bd-sec-title { margin: 4px 0 12px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #1f2433; }
.dst-paper[data-template="modern"] .bd-sec-title::before { content: ""; flex: none; width: 5px; height: 20px; border-radius: 2px; background: var(--doc-accent); margin-right: -2px; }
.dst-paper[data-template="modern"] .bd-sec-title::after { content: ""; flex: 1; height: 1px; background: #e5e7eb; }
.dst-paper[data-template="modern"] .bd-cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.dst-paper[data-template="modern"] .bd-cell { min-width: 0; padding: 0 0 7px; margin: 0 0 9px; border-bottom: 1px solid #eceef3; }
.dst-paper[data-template="modern"] .bd-cell .bd-label { padding: 0; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #8a8f9c; }
.dst-paper[data-template="modern"] .bd-cell .bd-value { font-size: 14px; color: #1f2433; }

/* ---------------- Minimal ---------------- */
.dst-paper[data-template="minimal"] .bd-sheet { font-family: var(--bd-sans); color: #1f2433; }
.dst-paper[data-template="minimal"] .bd-topbar { position: absolute; left: 0; right: 0; top: 0; height: 7px; background: var(--doc-accent); }
.dst-paper[data-template="minimal"] .bd-body { padding: 72px 77px 82px; }
.dst-paper[data-template="minimal"] .bd-head { margin-bottom: 26px; }
.dst-paper[data-template="minimal"] .bd-invocation { margin-bottom: 14px; text-align: center; font-size: 12.5px; color: #6b7280; }
.dst-paper[data-template="minimal"] .bd-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; padding-bottom: 18px; border-bottom: 1.5px solid #111827; }
.dst-paper[data-template="minimal"] .bd-head-text { min-width: 0; flex: 1; }
.dst-paper[data-template="minimal"] .bd-doctitle { font-size: 11.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--doc-accent); }
.dst-paper[data-template="minimal"] .bd-name { margin: 6px 0 6px; font-size: 35px; line-height: 1.15; font-weight: 700; color: #111827; }
.dst-paper[data-template="minimal"] .bd-meta { font-size: 14px; color: #4b5563; }
.dst-paper[data-template="minimal"] .bd-photo { flex: none; width: 123px; height: 152px; margin: 0 7px 7px 0; box-shadow: 7px 7px 0 -1px #fff, 7px 7px 0 0 color-mix(in srgb, var(--doc-accent) 50%, #fff); overflow: visible; }
.dst-paper[data-template="minimal"] .bd-photo img, .dst-paper[data-template="minimal"] .bd-photo .bd-mono { outline: 1px solid #d1d5db; outline-offset: -1px; }
.dst-paper[data-template="minimal"] .bd-photo .bd-mono { font-size: 40px; }
.dst-paper[data-template="minimal"] .bd-sec { margin-bottom: 14px; }
.dst-paper[data-template="minimal"] .bd-sec-title { margin: 4px 0 8px; padding-bottom: 7px; border-bottom: 1px solid #e5e7eb; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--doc-accent); }
.dst-paper[data-template="minimal"] .bd-row { grid-template-columns: 200px minmax(0, 1fr); padding: 5px 0; border-bottom: 1px solid #f1f2f5; }
.dst-paper[data-template="minimal"] .bd-colon { display: none; }
.dst-paper[data-template="minimal"] .bd-label { color: #6b7280; font-weight: 600; }

/* ---------------- print ---------------- */
.dst-paper.is-print { min-height: 0 !important; }
.dst-paper.is-print .bd-sheet { height: 1122px; break-after: page; page-break-after: always; }
.dst-paper.is-print .bd-sheet:last-child { break-after: auto; page-break-after: auto; }
