/* ==DKCSS-START== editor layout shared by the document tools */
.dk { --dk-ac: var(--brand); }
.dk-tabs { display: none; }
.dk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 20px; align-items: start; }
.dk-form { min-width: 0; }
.dk-view { position: sticky; top: 72px; max-height: calc(100vh - 84px); overflow: auto; background: #e8ebf2; border-radius: 16px; padding: 12px; min-width: 0; overscroll-behavior: contain; }
:root[data-theme="dark"] .dk-view { background: #0b0d13; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dk-view { background: #0b0d13; } }
.btn.sm { min-height: 36px; padding: 7px 12px; font-size: 14px; border-radius: 9px; }
.dk-toolbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.dk-tb-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dk-tb-label { font-weight: 700; font-size: 14px; margin-right: 2px; }
.dk-saved { font-size: 13px; color: var(--ok); margin-left: auto; }
.dk-sec { border: 1px solid var(--line); border-radius: 14px; margin: 0 0 10px; background: var(--card); overflow: hidden; }
.dk-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 14px; font-weight: 800; font-size: 16px; min-height: 50px; }
.dk-sec > summary::-webkit-details-marker { display: none; }
.dk-sec > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.dk-sec[open] > summary::after { transform: rotate(180deg); }
.dk-sec[open] > summary { border-bottom: 1px solid var(--line); background: var(--bg); }
.dk-sec-ic { width: 30px; height: 30px; display: grid; place-items: center; background: var(--brand-soft); border-radius: 9px; font-size: 16px; flex: none; }
.dk-sec-b { padding: 6px 14px 14px; }
.dk-badge { font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
.dk-tip { font-size: 13.5px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 8px 10px; margin: 8px 0 4px; }
.dk-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.dk-fields .full { grid-column: 1 / -1; }
.dk-fields .field { margin: 8px 0 0; min-width: 0; }
.dk-fields .field label { font-size: 13px; }
.dk-check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin: 10px 0 0; cursor: pointer; min-height: 32px; }
.dk-card { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 12px; margin: 10px 0; background: var(--bg); }
.dk-card-h { display: flex; align-items: center; gap: 4px; padding-top: 6px; }
.dk-card-t { flex: 1; font-weight: 700; font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-ib { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 9px; width: 36px; height: 36px; font-size: 15px; cursor: pointer; flex: none; }
.dk-ib:disabled { opacity: .35; cursor: default; }
.dk-ib.del { color: var(--bad); }
.dk-add { width: 100%; margin-top: 4px; }
.dk-photo { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.dk-photo-img { width: 84px; height: 84px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; font-size: 12px; color: var(--muted); }
.dk-photo-img img { width: 100%; height: 100%; object-fit: cover; }
.dk-photo-b { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.dk-photo-b small { flex-basis: 100%; font-size: 12.5px; }
.dk-photo-b .dk-check { margin: 0; flex-basis: 100%; }
.dk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.dk-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--brand-soft); color: var(--ink); border-radius: 99px; padding: 3px 4px 3px 12px; font-size: 14px; font-weight: 600; }
.dk-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; width: 28px; height: 28px; border-radius: 50%; font-size: 13px; }
.dk-chip-in { display: flex; gap: 8px; }
.dk-chip-in input { flex: 1; min-width: 0; }
.dk-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dk-sugg button { font: inherit; font-size: 13px; border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 99px; padding: 5px 10px; cursor: pointer; }
.dk-arrange { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.dk-arrange li { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; }
.dk-arrange input[type=text] { flex: 1; min-width: 0; min-height: 36px; padding: 5px 9px; font-weight: 600; font-size: 14px; }
.dk-ar-ic { width: 22px; text-align: center; flex: none; }
.dk-show { display: flex; align-items: center; gap: 4px; font-size: 12.5px; flex: none; }
.dk-design { background: var(--card); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.dk-tpls { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.dk-tpls button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 11px; padding: 6px 6px 5px; cursor: pointer; font: inherit; font-size: 12.5px; }
.dk-tpls button.on { border-color: var(--dk-ac); box-shadow: 0 0 0 2px color-mix(in srgb, var(--dk-ac) 25%, transparent); }
.dk-tpls b { font-weight: 700; }
.th { position: relative; width: 54px; height: 70px; background: #fff; border: 1px solid #d9dce5; border-radius: 4px; overflow: hidden; display: block; }
.th i { position: absolute; display: block; background: #c9ced9; height: 3px; border-radius: 2px; }
.dk-design-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 8px; }
.dk-swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dk-swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.dk-swatches button.on { box-shadow: 0 0 0 2px var(--ink); }
.dk-color-custom { position: relative; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1px dashed var(--muted); cursor: pointer; font-size: 14px; }
.dk-color-custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; padding: 0; border: 0; }
.dk-mini { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.dk-mini select { min-height: 34px; padding: 4px 8px; font-size: 14px; width: auto; }
.dk-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.dk-pagecount { font-size: 13px; color: var(--muted); margin-left: auto; }
.dk-pages { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.dk-pages.zoomed { align-items: flex-start; overflow-x: auto; }
.pv-box { position: relative; flex: none; box-shadow: 0 2px 14px rgba(15, 20, 40, .18); background: #fff; overflow: hidden; }
.pv-box > .pg { transform-origin: 0 0; position: absolute; left: 0; top: 0; }
.pv-lab { font-size: 12px; color: var(--muted); margin: 2px 0 10px; }
.dk-hint { font-size: 13.5px; color: var(--muted); background: var(--card); border-radius: 12px; padding: 10px 12px; margin-top: 12px; line-height: 1.5; }
.dk-measure { position: absolute; left: -12000px; top: 0; visibility: hidden; pointer-events: none; contain: layout style; }
#dk-print { display: none; }
.dk-modal { position: fixed; inset: 0; background: rgba(10, 12, 20, .6); z-index: 100; display: grid; place-items: center; padding: 16px; }
.dk-modal-card { background: var(--card); color: var(--ink); border-radius: 16px; padding: 16px; max-width: 360px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dk-modal-title { font-weight: 800; }
.dk-crop-cv { touch-action: none; cursor: grab; border-radius: 8px; background: #eee; max-width: 100%; }
.dk-zoom { display: flex; align-items: center; gap: 8px; width: 100%; }
@media (max-width: 900px) {
  .dk-tabs { display: flex; gap: 6px; position: sticky; top: 60px; z-index: 15; background: var(--card); padding: 8px 0; margin: -8px 0 10px; border-bottom: 1px solid var(--line); }
  .dk-tabs button { flex: 1; font: inherit; font-weight: 700; font-size: 15px; min-height: 44px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 11px; cursor: pointer; }
  .dk-tabs button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
  .dk-tabs .dk-tab-pdf { flex: .8; background: var(--ok); color: #fff; border-color: var(--ok); }
  .dk-grid { grid-template-columns: minmax(0, 1fr); }
  .dk-view { position: static; max-height: none; overflow: visible; margin: 0 -10px; padding: 10px; }
  .dk[data-view="edit"] .dk-view, .dk[data-view="preview"] .dk-form { display: none; }
}
@media (max-width: 420px) {
  .dk-sec-b { padding: 4px 10px 12px; }
  .dk-card { padding: 4px 9px 10px; }
  .dk-actions .btn.big { flex: 1; }
}
@media print {
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  body > *:not(#dk-print) { display: none !important; }
  #dk-print { display: block !important; }
  #dk-print .pg { break-after: page; page-break-after: always; transform: none !important; margin: 0 !important; box-shadow: none !important; }
  #dk-print .pg:last-child { break-after: auto; page-break-after: auto; }
}
/* ==DKCSS-END== */

@media (min-width: 901px) { .ce-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); } }
.ce-types { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.ce-types button { font: inherit; font-size: 13.5px; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 6px 12px; min-height: 38px; cursor: pointer; }
.ce-types button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.ce-img { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.ce-img-box { width: 100px; height: 50px; border: 1px solid var(--line); border-radius: 9px; background: #fff; display: grid; place-items: center; overflow: hidden; font-size: 12px; color: #777; }
.ce-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ce-bulk-out { margin-top: 10px; }
.th.th-land { width: 76px; height: 54px; }
.th[class*="ceth-"] i:nth-child(1) { left: 25%; top: 12px; width: 50%; height: 4px; background: var(--dk-ac); }
.th[class*="ceth-"] i:nth-child(2) { left: 18%; top: 24px; width: 64%; height: 5px; background: #555; }
.th[class*="ceth-"] i:nth-child(3) { left: 28%; top: 34px; width: 44%; }
.th[class*="ceth-"] i:nth-child(4) { left: 44%; top: 41px; width: 12%; height: 8px; border-radius: 50%; background: var(--dk-ac); }
.ceth-classic { background: #fffdf5; box-shadow: inset 0 0 0 3px #fffdf5, inset 0 0 0 6px var(--dk-ac); }
.ceth-royal { box-shadow: inset 0 0 0 7px var(--dk-ac); }
.ceth-modern::before { content: ""; position: absolute; left: 0; top: 0; border-style: solid; border-width: 16px 16px 0 0; border-color: var(--dk-ac) transparent transparent transparent; }
.ceth-playful { background: #fffaf0; box-shadow: inset 0 0 0 3px #fffaf0, inset 0 0 0 5px var(--dk-ac); border-style: dashed; }
.ceth-minimal { box-shadow: inset 0 0 0 5px #fff, inset 0 0 0 6px var(--dk-ac); }

/* ===== certificate page (always light paper) ===== */
.pg { position: relative; overflow: hidden; background: #fff; color: #23262e; font-size: 14px; line-height: 1.4; text-align: center;
  font-family: Georgia, 'Noto Serif', 'Times New Roman', serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; color-scheme: light; box-sizing: border-box; }
.pg *, .pg *::before, .pg *::after { box-sizing: border-box; }
.pg-in { height: 100%; display: flex; flex-direction: column; padding: 54px 92px 44px; }
.pg-cols { display: flex; flex: 1 1 0; min-height: 0; }
.pg-col { min-width: 0; flex: 1 1 0; min-height: 0; }
.ce h1, .ce p { margin: 0; }
.ce .c-wrap { height: 100%; }
.ce .c-body { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ce .c-frame { position: absolute; inset: 18px; border: 3px solid var(--ac); }
.ce .c-frame2 { position: absolute; inset: 7px; border: 1px solid var(--ac-mid); }
.ce .c-corner { position: absolute; width: 120px; height: 120px; z-index: 0; }
.ce .c-corner svg { width: 100%; height: 100%; display: block; }
.ce .c-corner.tl { left: 12px; top: 12px; } .ce .c-corner.tr { right: 12px; top: 12px; transform: scaleX(-1); }
.ce .c-corner.bl { left: 12px; bottom: 12px; transform: scaleY(-1); } .ce .c-corner.br { right: 12px; bottom: 12px; transform: scale(-1, -1); }
.ce .c-logo { max-height: 70px; max-width: 200px; object-fit: contain; margin-bottom: 8px; }
.ce .c-org { font-size: 1.15em; letter-spacing: .14em; text-transform: uppercase; color: #4a4f5c; margin-bottom: 10px; font-weight: 600; }
.ce .c-title { font-size: 3.3em; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ac-dark); line-height: 1.05; }
.ce .c-sub { font-size: 1.45em; letter-spacing: .3em; text-transform: uppercase; color: var(--ac); margin-top: 6px; }
.ce .c-pres { margin-top: 22px; font-size: 1.1em; font-style: italic; color: #4a4f5c; }
.ce .c-name { font-family: 'Segoe Script', 'Brush Script MT', 'Lucida Handwriting', 'Dancing Script', cursive; color: var(--ac-dark); line-height: 1.25; margin: 8px 0 4px; padding: 0 20px 6px; border-bottom: 1.5px solid var(--ac-mid); max-width: 100%; white-space: nowrap; overflow: hidden; }
.ce .c-desc { font-size: 1.15em; max-width: 660px; color: #33373f; margin-top: 12px; line-height: 1.45; }
.ce .c-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 0; }
.ce .c-foot { display: flex; align-items: flex-end; justify-content: center; gap: 46px; padding-top: 10px; width: 100%; }
.ce .c-sig { display: flex; flex-direction: column; align-items: center; min-width: 170px; }
.ce .c-sigimg { height: 48px; max-width: 190px; object-fit: contain; display: flex; align-items: flex-end; justify-content: center; }
.ce .c-datev { font-size: 1.05em; padding-bottom: 4px; }
.ce .c-sigl { border-top: 1px solid #555b68; padding-top: 4px; width: 100%; font-size: .95em; font-weight: 600; color: #2b2f38; }
.ce .c-sigl small { display: block; font-weight: 400; color: #5b6170; font-size: .9em; }
.ce .c-sealbox { width: 80px; flex: none; }
.ce .c-seal { width: 80px; height: 100px; display: block; }
.ce .c-seal .s1 { fill: var(--ac); }
.ce .c-seal .s2 { fill: none; stroke: #fff; stroke-width: 2; stroke-dasharray: 3 3; }
.ce .c-seal .s3 { fill: var(--ac-dark); }
.ce .c-seal .s4 { fill: #fff; }
.ce .c-seal .rb { fill: var(--ac-dark); }

/* Classic gold: cream paper, flourished corners */
.cet-classic { background: #fffdf5; }
.cet-classic .c-frame { border: 10px solid var(--ac); inset: 16px; }
.cet-classic .c-frame2 { inset: 6px; border: 2px solid var(--ac-dark); }
.cet-classic .c-corner { width: 110px; height: 110px; left: auto; }
.cet-classic .c-corner.tl, .cet-classic .c-corner.bl { left: 38px; } .cet-classic .c-corner.tr, .cet-classic .c-corner.br { right: 38px; }
.cet-classic .c-corner.tl, .cet-classic .c-corner.tr { top: 38px; } .cet-classic .c-corner.bl, .cet-classic .c-corner.br { bottom: 38px; }
.c-orn .o1 { fill: none; stroke: var(--ac); stroke-width: 3; }
.c-orn .o2 { fill: none; stroke: var(--ac-mid); stroke-width: 1.5; }
.c-orn .o3 { fill: none; stroke: var(--ac-dark); stroke-width: 2; }
.c-orn .o4 { fill: var(--ac); }

/* Royal: deep border band with gold corners */
.cet-royal .c-frame { inset: 0; border: 26px solid var(--ac-dark); }
.cet-royal .c-frame2 { inset: 8px; border: 2px solid #d4a72c; }
.cet-royal .c-corner { width: 90px; height: 90px; }
.cet-royal .c-corner.tl { left: 34px; top: 34px; } .cet-royal .c-corner.tr { right: 34px; top: 34px; } .cet-royal .c-corner.bl { left: 34px; bottom: 34px; } .cet-royal .c-corner.br { right: 34px; bottom: 34px; }
.cet-royal .c-orn .o4 { fill: #d4a72c; opacity: .9; }
.cet-royal .c-orn .o1 { stroke: #d4a72c; }
.cet-royal .c-title { color: var(--ac-dark); }
.cet-royal .c-seal .s1 { fill: #d4a72c; } .cet-royal .c-seal .s3 { fill: var(--ac-dark); }

/* Modern: big geometric corners, sans type */
.cet-modern { font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }
.cet-modern .c-frame { inset: 22px; border: 1px solid var(--ac-mid); }
.cet-modern .c-frame2 { display: none; }
.cet-modern .c-corner { width: 210px; height: 210px; }
.cet-modern .c-corner.tl { left: 0; top: 0; } .cet-modern .c-corner.br { right: 0; bottom: 0; }
.cet-modern .c-corner.tr, .cet-modern .c-corner.bl { display: none; }
.c-orn .m1 { fill: var(--ac); } .c-orn .m2 { fill: var(--ac-dark); }
.cet-modern .c-title { font-weight: 800; letter-spacing: .08em; font-size: 3.4em; color: #15171c; }
.cet-modern .c-sub { color: var(--ac); font-weight: 600; }
.cet-modern .c-pres { font-style: normal; }
.cet-modern .c-name { font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-weight: 700; color: var(--ac-dark); letter-spacing: .01em; }

/* Playful: dashed border, stars */
.cet-playful { background: #fffaf0; font-family: 'Trebuchet MS', 'Segoe UI', Roboto, sans-serif; }
.cet-playful .c-frame { inset: 20px; border: 8px dashed var(--ac); border-radius: 30px; }
.cet-playful .c-frame2 { inset: 10px; border: 2px solid var(--ac-mid); border-radius: 20px; }
.cet-playful .c-corner { width: 100px; height: 100px; }
.cet-playful .c-corner.tl { left: 40px; top: 40px; } .cet-playful .c-corner.tr { right: 40px; top: 40px; } .cet-playful .c-corner.bl { left: 40px; bottom: 40px; } .cet-playful .c-corner.br { right: 40px; bottom: 40px; }
.c-orn .p1 { fill: #f5b301; } .c-orn .p2 { fill: var(--ac); } .c-orn .p3 { fill: #3aa0d8; }
.cet-playful .c-title { font-weight: 800; letter-spacing: .06em; color: var(--ac); }
.cet-playful .c-name { font-family: 'Segoe Print', 'Comic Sans MS', 'Chalkboard SE', 'Trebuchet MS', cursive; font-weight: 700; color: #2b2f38; }

/* Minimal: clean lines */
.cet-minimal { font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }
.cet-minimal .c-frame { inset: 26px; border: 1px solid #c9ced8; }
.cet-minimal .c-frame2 { inset: auto; left: -1px; top: -1px; bottom: -1px; width: 10px; border: 0; background: var(--ac); }
.cet-minimal .c-title { font-weight: 300; letter-spacing: .3em; color: #15171c; }
.cet-minimal .c-sub { letter-spacing: .4em; font-size: 1.2em; }
.cet-minimal .c-name { font-family: Georgia, 'Noto Serif', serif; font-style: italic; color: #15171c; }
