/* Course certificates: the person's full-screen page (/tools/certificate/) and Profilers → Certificates. Colours from docs/brand/purnam-colours.json. */

/* ---------- the person's page ---------- */
:root { --pce-sheet-shadow: 0 2px 4px rgba(9,48,77,.08), 0 22px 50px -26px rgba(9,48,77,.45); }
html[data-paper="night"] { --pce-sheet-shadow: 0 2px 4px rgba(0,0,0,.3), 0 30px 80px -24px rgba(0,0,0,.7), 0 0 0 1px rgba(233,199,122,.12); }
.pce-body { margin: 0; min-height: 100vh; min-height: 100svh; background: #F6F1E8; }
html[data-paper="night"] .pce-body { background: #071C2E; }
.pce-app {
  --pce-ink: #09304D; --pce-muted: #4E5B66; --pce-blue: #005495; --pce-line: rgba(9,48,77,.16); --pce-gold: #A77A26;
  --pce-btn: rgba(255,255,255,.7); --pce-seg: rgba(255,251,240,.85); --pce-seg-line: rgba(167,122,38,.3); --pce-seg-hover: rgba(235,203,127,.18);
  --pce-primary: rgba(0,84,149,.08); --pce-primary-line: rgba(0,84,149,.32); --pce-primary-ink: #005495;
  --pce-display: "Playfair Display", "Iowan Old Style", Georgia, serif; --pce-body: Lato, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; min-height: 100svh; color: var(--pce-ink); font-family: var(--pce-body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  background: radial-gradient(120% 80% at 50% 0%, #FFFDF8 0%, #F6F1E8 55%, #EFE6D8 100%);
}
html[data-paper="night"] .pce-app {
  --pce-ink: #F6EBD2; --pce-muted: rgba(240,228,205,.72); --pce-blue: #E9C77A; --pce-line: rgba(233,199,122,.28); --pce-gold: #E9C77A;
  --pce-btn: rgba(255,255,255,.06); --pce-seg: rgba(233,199,122,.07); --pce-seg-line: rgba(233,199,122,.32); --pce-seg-hover: rgba(233,199,122,.12);
  --pce-primary: rgba(233,199,122,.12); --pce-primary-line: rgba(233,199,122,.45); --pce-primary-ink: #F3DDA6;
  background: radial-gradient(120% 80% at 50% 0%, #10456B 0%, #0A2D4A 50%, #071C2E 100%);
}
.pce, .pce * { box-sizing: border-box; }
.pce { max-width: 1320px; min-height: 100vh; min-height: 100svh; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 18px;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.pce-head { display: grid; gap: 6px; text-align: center; max-width: 720px; margin: 0 auto; }
.pce-eyebrow { margin: 0; font-size: 12px; line-height: 1.4; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: var(--pce-gold); }
.pce-head h1, .pce-message h1 { margin: 0; font-family: var(--pce-display); font-weight: 500; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; text-wrap: balance; color: var(--pce-ink); }
.pce-lede { margin: 0; color: var(--pce-muted); font-size: 16px; line-height: 1.6; text-wrap: pretty; }
/* The certificate fills the screen: as wide as the height allows, never wider than the page. */
.pce-stage { width: min(100%, calc((100svh - 330px) * 1.414)); min-width: min(100%, 640px); margin: 4px auto 0; border-radius: 4px; overflow: hidden;
  box-shadow: var(--pce-sheet-shadow); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pce-stage canvas { display: block; width: 100%; height: auto; aspect-ratio: 1414 / 1000; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.pce-hint { justify-self: center; display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin: 2px 0 0; font-size: 13px; line-height: 1.4; color: var(--pce-gold); letter-spacing: .02em; }
.pce-hint { line-height: 18px; }
.pce-tap { display: block; width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; overflow: visible; }
.pce-tap-ring { transform-origin: 12px 12px; animation: pce-tap 2.6s ease-out infinite; }
@keyframes pce-tap { 0% { transform: scale(.55); opacity: 1; } 70%, 100% { transform: scale(1.05); opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pce-tap-ring { animation: none; } }
/* First the look (golden selectors), then the ways to keep it (quiet outlined buttons). */
.pce-bar { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.pce-choices { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 28px; }
.pce-group { display: flex; align-items: center; gap: 10px; }
.pce-group > span { font-size: 11px; line-height: 1; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--pce-gold); }
.pce-chips { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--pce-seg); border: 1px solid var(--pce-seg-line); }
.pce-chip { min-height: 38px; padding: 8px 20px; border-radius: 999px; border: 0; background: transparent; color: var(--pce-ink); font: 700 14px/1.2 var(--pce-body); cursor: pointer; transition: background .25s, color .25s, box-shadow .25s; }
.pce-chip:hover { background: var(--pce-seg-hover); }
.pce-chip[aria-checked="true"] { background: linear-gradient(180deg, #F8E7B8 0%, #EBCB7F 100%); color: #4A350B; box-shadow: inset 0 0 0 1px rgba(167,122,38,.35), 0 4px 12px -6px rgba(167,122,38,.6); }
.pce-divider { width: min(420px, 70%); height: 1px; margin: 6px 0 2px; border: 0; background: linear-gradient(90deg, transparent, var(--pce-seg-line), transparent); }
.pce-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pce-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--pce-line); background: transparent; color: var(--pce-ink); font: 600 14px/1.2 var(--pce-body); cursor: pointer; transition: background .2s, border-color .2s; }
.pce-btn:hover { background: var(--pce-btn); border-color: var(--pce-seg-line); }
.pce-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: .85; }
.pce-btn.pce-primary { background: var(--pce-primary); border-color: var(--pce-primary-line); color: var(--pce-primary-ink); }
.pce-chip:focus-visible, .pce-btn:focus-visible, .pce-link:focus-visible, .pce-share input:focus-visible { outline: 3px solid #FFBD59; outline-offset: 2px; }
.pce-share { display: grid; gap: 10px; justify-items: center; max-width: 620px; width: 100%; margin: 0 auto; padding: 16px 18px; border: 1px solid var(--pce-line); border-radius: 16px; background: var(--pce-btn); text-align: center; }
.pce-share[hidden] { display: none; }
.pce-share p { margin: 0; color: var(--pce-muted); font-size: 14px; line-height: 1.5; }
.pce-share-row { display: flex; gap: 8px; width: 100%; }
.pce-share input { flex: 1; min-width: 0; min-height: 46px; padding: 10px 14px; border: 1px solid var(--pce-line); border-radius: 10px; font: 400 14px/1.3 var(--pce-body); color: var(--pce-ink); background: transparent; }
.pce-link { border: 0; background: none; padding: 6px; color: var(--pce-blue); font: 700 14px/1.4 var(--pce-body); text-decoration: underline; cursor: pointer; }
.pce-status { margin: 0; min-height: 1.5em; text-align: center; color: var(--pce-ink); font-size: 15px; line-height: 1.5; }
.pce-status:empty { display: none; }
.pce-note { margin: 0; text-align: center; color: var(--pce-muted); font-size: 13px; line-height: 1.5; letter-spacing: .02em; }
/* the course's next step, at the foot of the owner's page */
.pce-next { display: flex; gap: 20px; align-items: flex-start; width: 100%; max-width: 640px; margin: 18px auto 8px; padding: 24px 26px; border: 1px solid var(--pce-seg-line); border-radius: 20px; background: var(--pce-btn); text-align: left; }
.pce-next-mark { flex: none; width: 34px; height: 26px; margin-top: 2px; background: var(--pce-gold); -webkit-mask: url('img/lotus-mark.svg') center / contain no-repeat; mask: url('img/lotus-mark.svg') center / contain no-repeat; }
.pce-next h2 { margin: 6px 0 8px; font-family: var(--pce-display); font-weight: 500; font-size: 22px; line-height: 1.3; color: var(--pce-ink); text-wrap: balance; }
.pce-next p:not(.pce-eyebrow) { margin: 0; color: var(--pce-ink); font-size: 16px; line-height: 1.65; text-wrap: pretty; }
.pce-next p.pce-next-more { margin-top: 10px; color: var(--pce-muted); font-size: 14px; line-height: 1.65; }
.pce-next strong { font-weight: 700; color: var(--pce-ink); }
.pce-next-go { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.pce-next-go .pce-btn { text-decoration: none; }
.pce-next-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pce-next-go small { color: var(--pce-muted); font-size: 13px; line-height: 1.4; }
@media (max-width: 639px) { .pce-next { flex-direction: column; gap: 10px; padding: 20px; } }
.pce-message { max-width: 620px; margin: auto; text-align: center; display: grid; gap: 14px; }
.pce-message p { margin: 0; color: var(--pce-muted); font-size: 17px; line-height: 1.6; }
.pce-message a { color: var(--pce-blue); }
@media (max-width: 639px) {
  .pce { justify-content: flex-start; gap: 16px; padding-top: max(28px, env(safe-area-inset-top)); }
  .pce-stage { width: 100%; min-width: 0; }
  .pce-stage canvas { aspect-ratio: 1000 / 1414; }
  /* On phones the ways to keep it are round icons; their names stay for screen readers. */
  .pce-actions { gap: 14px; flex-wrap: nowrap; }
  .pce-actions .pce-btn { width: 52px; height: 52px; min-height: 0; padding: 0; border-radius: 50%; }
  .pce-actions .pce-btn svg { width: 21px; height: 21px; opacity: 1; }
  .pce-btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pce-group { flex-direction: column; gap: 5px; }
  /* Mandala and Paper side by side, compact */
  .pce-choices { flex-wrap: nowrap; gap: 10px; }
  .pce-group > span { font-size: 10px; letter-spacing: .12em; }
  .pce-chips { padding: 3px; gap: 2px; }
  .pce-chip { min-height: 34px; padding: 6px 11px; font-size: 13px; }
  .pce-share-row { flex-direction: column; }
}

/* ---------- admin: the same look as the Purnam Bookings admin ---------- */
.pce-admin-page #wpcontent { padding-left: 0; }
.pce-admin-page #wpbody-content { padding-bottom: 0; }
.pce-admin-page #wpfooter, .pce-admin-page #wpbody-content > .notice, .pce-admin-page #wpbody-content > .updated, .pce-admin-page #wpbody-content > .error, .pce-admin-page .update-nag, .pce-admin-page #screen-meta-links { display: none !important; }
.pce-admin-page { background: #f5f7fb; }
#pce-admin {
  --toolbar: 0px; --p: #005494; --p-hover: #00467c; --p-container: #dbe8f5; --on-p-container: #002a4c; --tonal: #eaf2fa;
  --surface: #fff; --dim: #f5f7fb; --line: #e3e8ef; --line-strong: #c9d2dd; --ink: #1a2330; --muted: #5d6877; --subtle: #8b95a3;
  --ok: #1b7a43; --ok-bg: #e3f4ea; --warn: #9a5b00; --warn-bg: #fff3dc; --err: #b3261e; --err-bg: #fbe9e7; --gold: #8a6416; --gold-bg: #fbf1dc;
  --r-lg: 16px; --sh-1: 0 1px 2px rgba(16,32,48,.05), 0 1px 3px rgba(16,32,48,.06); --sh-2: 0 8px 28px rgba(16,32,48,.12);
  --font: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  font: 400 14px/1.5 var(--font); color: var(--ink); -webkit-font-smoothing: antialiased;
}
body:has(#wpadminbar) #pce-admin { --toolbar: 32px; }
@media (max-width: 782px) { body:has(#wpadminbar) #pce-admin { --toolbar: 46px; } }
#pce-admin *, #pce-admin *::before, #pce-admin *::after { box-sizing: border-box; }
#pce-admin h1, #pce-admin h2, #pce-admin h3, #pce-admin p { margin: 0; padding: 0; font-family: var(--font); color: inherit; }
#pce-admin button, #pce-admin input, #pce-admin select, #pce-admin textarea { font-family: var(--font); }
#pce-admin a { color: var(--p); text-decoration: none; }
#pce-admin a:focus, #pce-admin button:focus { box-shadow: none; outline: none; }
#pce-admin :focus-visible { outline: 3px solid rgba(0,84,148,.35) !important; outline-offset: 1px; }
#pce-admin .ca-i { width: 18px; height: 18px; flex: none; }
#pce-admin .ca-muted { color: var(--muted); }
#pce-admin .ca-boot, #pce-admin .ca-loading { display: grid; place-items: center; padding: 60px; color: var(--muted); }

/* shell */
#pce-admin .ca-app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - var(--toolbar)); }
#pce-admin .ca-side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: var(--toolbar); height: calc(100vh - var(--toolbar)); }
#pce-admin .ca-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 16px; }
#pce-admin .ca-brand img { height: 30px; width: 30px; }
#pce-admin .ca-new { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; margin: 0 2px 14px; border: 0; border-radius: 12px; background: var(--p); color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--sh-1); cursor: pointer; transition: background .15s; }
#pce-admin .ca-new:hover { background: var(--p-hover); }
#pce-admin .ca-nav { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-weight: 500; transition: background .15s, color .15s; }
#pce-admin .ca-nav:hover { background: var(--dim); color: var(--ink); }
#pce-admin .ca-nav.is-active { background: var(--p-container); color: var(--on-p-container); font-weight: 600; }
#pce-admin .ca-nav span:first-of-type { flex: 1; }
#pce-admin .ca-count { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--p); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
#pce-admin .ca-side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); }
#pce-admin .ca-side-foot a { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
#pce-admin .ca-main { padding: 28px clamp(20px, 3vw, 40px) 48px; min-width: 0; }

/* header */
#pce-admin .ca-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
#pce-admin .ca-head h1, #pce-admin .ca-editor-top h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
#pce-admin .ca-head p { color: var(--muted); margin-top: 4px; max-width: 720px; }
#pce-admin .ca-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* buttons, inputs, toggles */
#pce-admin .ca-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; background: none; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; color: var(--ink); transition: background .15s, border-color .15s; }
#pce-admin .ca-btn--filled { background: var(--p); color: #fff; }
#pce-admin .ca-btn:disabled, #pce-admin .ca-btn[aria-busy="true"] { opacity: .75; cursor: progress; }
#pce-admin .ca-btn .ca-spin { width: 14px; height: 14px; border-width: 2px; }
#pce-admin .ca-preview { position: relative; }
#pce-admin .ca-preview.is-loading { min-height: 200px; aspect-ratio: 1414 / 1000; }
#pce-admin .ca-preview.is-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 3px solid var(--p); border-right-color: transparent; animation: ca-spin .7s linear infinite; }
#pce-admin .ca-btn--filled:hover { background: var(--p-hover); }
#pce-admin .ca-btn--tonal { background: var(--tonal); color: var(--p); }
#pce-admin .ca-btn--tonal:hover { background: var(--p-container); }
#pce-admin .ca-btn--outlined { border-color: var(--line-strong); background: var(--surface); }
#pce-admin .ca-btn--outlined:hover { background: var(--dim); }
#pce-admin .ca-btn--text { color: var(--p); padding: 0 12px; }
#pce-admin .ca-btn--text:hover { background: var(--tonal); }
#pce-admin .ca-btn--danger { background: var(--err); color: #fff; }
#pce-admin .ca-icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); flex: none; }
#pce-admin .ca-icon-btn:hover { background: var(--dim); color: var(--ink); }
#pce-admin .ca-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 0; color: var(--p); font-weight: 600; cursor: pointer; font-size: 13px; }
#pce-admin .ca-danger { color: var(--err) !important; }
#pce-admin .ca-input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px; box-shadow: none; max-width: none; min-height: 0; line-height: normal; transition: border-color .15s, box-shadow .15s; }
#pce-admin textarea.ca-input { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
#pce-admin .ca-input:focus { border-color: var(--p); box-shadow: 0 0 0 3px rgba(0,84,148,.14); outline: none; }
#pce-admin .ca-input[readonly] { background: var(--dim); color: var(--muted); }
#pce-admin .ca-file { height: auto; padding: 8px; }
#pce-admin .ca-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
#pce-admin .ca-field > span, #pce-admin .ca-label { font-weight: 600; font-size: 13px; color: var(--ink); }
#pce-admin .ca-label { display: block; margin-bottom: 6px; }
#pce-admin .ca-field small { color: var(--subtle); font-size: 12px; line-height: 1.5; }
#pce-admin .ca-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
#pce-admin .ca-note { margin-bottom: 10px; }
#pce-admin .ca-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; user-select: none; position: relative; }
#pce-admin .ca-toggle input { position: absolute; opacity: 0; pointer-events: none; }
#pce-admin .ca-toggle > span { width: 36px; height: 20px; border-radius: 10px; background: var(--line-strong); position: relative; flex: none; transition: background .15s; }
#pce-admin .ca-toggle > span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .18s; }
#pce-admin .ca-toggle input:checked + span { background: var(--p); }
#pce-admin .ca-toggle input:checked + span::after { transform: translateX(16px); }
#pce-admin .ca-toggle input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0,84,148,.3); }
#pce-admin .ca-toggle--row { display: flex; align-items: flex-start; padding: 12px 0 0; border-top: 1px solid var(--line); }
#pce-admin .ca-toggle--row > span { margin-top: 2px; }
#pce-admin .ca-toggle--row strong { display: block; font-weight: 600; }
#pce-admin .ca-toggle--row small { color: var(--muted); font-size: 13px; }
#pce-admin .ca-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
#pce-admin .ca-check { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); }
#pce-admin .ca-check:hover { background: var(--dim); }
#pce-admin .ca-check:has(input:checked) { border-color: var(--p); background: var(--tonal); color: var(--on-p-container); }
#pce-admin .ca-check input { margin: 0; accent-color: var(--p); }
#pce-admin .ca-seg { display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: 10px; background: #e8edf3; gap: 2px; }
#pce-admin .ca-seg button { border: 0; background: none; height: 30px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
#pce-admin .ca-seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
#pce-admin .ca-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* chips and avatars */
#pce-admin .ca-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#pce-admin .ca-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 600; background: var(--dim); color: var(--muted); white-space: nowrap; }
#pce-admin .ca-chip--blue { background: var(--tonal); color: var(--p); }
#pce-admin .ca-chip--ok { background: var(--ok-bg); color: var(--ok); }
#pce-admin .ca-chip--gold { background: var(--gold-bg); color: var(--gold); }
#pce-admin .ca-chip--warn { background: var(--warn-bg); color: var(--warn); height: 20px; font-size: 11px; }
#pce-admin .ca-chip--err { background: var(--err-bg); color: var(--err); }
#pce-admin .ca-chip--off { background: #eef1f5; color: var(--subtle); font-weight: 500; }
#pce-admin .ca-av { width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; background: hsl(var(--h) 55% 91%); color: hsl(var(--h) 45% 28%); font-weight: 700; font-size: 12px; }
#pce-admin .ca-av--md { width: 44px; height: 44px; font-size: 15px; }

/* stats, toolbar, table */
#pce-admin .ca-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
#pce-admin .ca-stat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-1); }
#pce-admin .ca-stat .ca-i { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--tonal); color: var(--p); }
#pce-admin .ca-stat b { display: block; font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
#pce-admin .ca-stat span { color: var(--muted); font-size: 12px; }
#pce-admin .ca-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
#pce-admin .ca-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
#pce-admin .ca-tab { border: 0; background: none; height: 32px; padding: 0 14px; border-radius: 8px; font-weight: 600; color: var(--muted); cursor: pointer; font-size: 13px; }
#pce-admin .ca-tab:hover { color: var(--ink); }
#pce-admin .ca-tab.is-on { background: var(--p-container); color: var(--on-p-container); }
#pce-admin .ca-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--subtle); }
#pce-admin .ca-search input { border: 0; outline: 0; box-shadow: none; min-width: 240px; font-size: 13px; background: transparent; padding: 0; height: 34px; }
#pce-admin .ca-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
#pce-admin .ca-thead, #pce-admin .ca-trow { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(130px, .9fr) 110px minmax(200px, 1.2fr) 24px; gap: 14px; align-items: center; padding: 12px 18px; }
#pce-admin .ca-thead { background: #fafbfd; border-bottom: 1px solid var(--line); color: var(--subtle); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
#pce-admin .ca-trow { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--ink); cursor: pointer; font: inherit; transition: background .12s; }
#pce-admin .ca-thead + .ca-trow { border-top: 0; }
#pce-admin .ca-trow:hover { background: #f7f9fc; }
#pce-admin .ca-trow.is-off { opacity: .55; }
#pce-admin .ca-cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
#pce-admin .ca-cell-main > span:last-child, #pce-admin .ca-num { min-width: 0; }
#pce-admin .ca-cell-main strong, #pce-admin .ca-num strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pce-admin .ca-num strong { font-variant-numeric: tabular-nums; }
#pce-admin .ca-cell-main small, #pce-admin .ca-num small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pce-admin .ca-date { color: var(--muted); font-variant-numeric: tabular-nums; }
#pce-admin .ca-cell-end { color: var(--subtle); display: flex; justify-content: flex-end; }
#pce-admin .ca-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 56px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
#pce-admin .ca-empty .ca-i { width: 36px; height: 36px; color: var(--subtle); margin-bottom: 4px; }
#pce-admin .ca-empty strong { color: var(--ink); font-size: 15px; }

/* cards */
#pce-admin .ca-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--sh-1); }
#pce-admin .ca-card h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin-bottom: 16px; }
#pce-admin .ca-card h2 .ca-i { color: var(--p); }
#pce-admin .ca-card--inset { box-shadow: none; background: #fafbfd; margin-top: 4px; }
#pce-admin .ca-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
#pce-admin .ca-course { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-1); cursor: pointer; font: inherit; color: var(--ink); transition: box-shadow .2s, transform .2s, border-color .2s; }
#pce-admin .ca-course:hover { box-shadow: var(--sh-2); transform: translateY(-2px); border-color: var(--line-strong); }
#pce-admin .ca-course.is-off { opacity: .6; }
#pce-admin .ca-course-art { display: block; aspect-ratio: 1414 / 1000; background: #FFFCF7; border-bottom: 1px solid var(--line); }
#pce-admin .ca-course-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
#pce-admin .ca-course-art img:not([src]) { visibility: hidden; }
#pce-admin .ca-course-body { display: grid; gap: 8px; padding: 16px 18px 18px; }
#pce-admin .ca-course-body strong { font-size: 17px; font-weight: 600; }
#pce-admin .ca-course-body em { font-style: normal; font-weight: 400; color: var(--gold); margin-left: 6px; }
#pce-admin .ca-course-meta { display: flex; gap: 6px; flex-wrap: wrap; }
#pce-admin .ca-course-body small { color: var(--muted); font-size: 12.5px; }
#pce-admin .ca-signers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
#pce-admin .ca-signer { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-1); cursor: pointer; font: inherit; color: var(--ink); transition: box-shadow .2s, transform .2s; }
#pce-admin .ca-signer:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
#pce-admin .ca-signer strong { font-size: 16px; font-weight: 600; margin-top: 10px; }
#pce-admin .ca-signer small { color: var(--muted); font-size: 13px; }
#pce-admin .ca-sig { width: 100%; height: 110px; display: grid; place-items: center; background: #FFFCF7; border: 1px solid #f0e8da; border-radius: 12px; }
#pce-admin .ca-sig img { max-height: 92px; max-width: 90%; }
#pce-admin .ca-sig--lg { height: 150px; margin-bottom: 18px; }
#pce-admin .ca-sig--lg img { max-height: 130px; }
#pce-admin .ca-docs { max-width: 900px; }
#pce-admin .ca-docs p { color: var(--muted); line-height: 1.6; margin-bottom: 10px; }
#pce-admin .ca-docs pre { background: #0f1b2a; color: #dbe8f5; padding: 14px 16px; border-radius: 12px; overflow-x: auto; font-size: 12.5px; line-height: 1.6; margin: 0 0 12px; }
#pce-admin .ca-docs code { font-size: 12px; background: var(--dim); padding: 1px 5px; border-radius: 4px; }

/* course editor */
#pce-admin .ca-editor-top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
#pce-admin .ca-editor-top > div:not(.ca-head-actions) { flex: 1; min-width: 200px; }
#pce-admin .ca-editor-top p { color: var(--muted); }
#pce-admin .ca-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
#pce-admin .ca-editor-preview { position: sticky; top: calc(var(--toolbar) + 20px); display: grid; gap: 12px; justify-items: start; }
#pce-admin .ca-preview { width: 100%; border-radius: 6px; overflow: hidden; box-shadow: 0 2px 4px rgba(9,48,77,.06), 0 18px 40px -18px rgba(9,48,77,.45); cursor: pointer; background: #FFFCF7; }
#pce-admin .ca-preview canvas { display: block; width: 100%; height: auto; aspect-ratio: 1414 / 1000; }

/* drawer */
#pce-admin .ca-drawer-wrap { position: fixed; inset: var(--toolbar) 0 0 0; z-index: 99990; }
#pce-admin .ca-scrim { position: absolute; inset: 0; background: rgba(16,24,40,.28); opacity: 0; transition: opacity .2s; }
#pce-admin .ca-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); box-shadow: var(--sh-2); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s cubic-bezier(.2, 0, 0, 1); }
#pce-admin .ca-drawer--wide { width: min(760px, 100vw); }
#pce-admin .ca-drawer-wrap.is-open .ca-scrim { opacity: 1; }
#pce-admin .ca-drawer-wrap.is-open .ca-drawer { transform: none; }
#pce-admin .ca-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
#pce-admin .ca-drawer-head h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 12px; }
#pce-admin .ca-drawer-head h2 small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
#pce-admin .ca-drawer-head p { color: var(--muted); margin-top: 4px; font-size: 13px; }
#pce-admin .ca-drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 28px; }
#pce-admin .ca-drawer-body .ca-preview { margin-bottom: 18px; }
#pce-admin .ca-drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: #fafbfd; }
#pce-admin .ca-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
#pce-admin .ca-banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; }
#pce-admin .ca-banner--err { background: var(--err-bg); color: var(--err); }
#pce-admin .ca-facts { list-style: none; margin: 0 0 14px; padding: 4px 16px; border: 1px solid var(--line); border-radius: 14px; }
#pce-admin .ca-facts li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; margin: 0; border-top: 1px solid var(--line); }
#pce-admin .ca-facts li:first-child { border-top: 0; }
#pce-admin .ca-facts .ca-i { color: var(--subtle); margin-top: 2px; }
#pce-admin .ca-facts span { display: block; font-size: 12px; color: var(--muted); }
#pce-admin .ca-facts strong { display: block; font-weight: 500; }

/* modal and toasts */
#pce-admin .ca-modal { position: fixed; inset: 0; z-index: 99999; background: rgba(16,24,40,.35); display: grid; place-items: center; padding: 20px; }
#pce-admin .ca-modal-box { width: min(420px, 100%); background: var(--surface); border-radius: 20px; padding: 24px; box-shadow: var(--sh-2); animation: ca-pop .2s cubic-bezier(.2, 0, 0, 1); }
#pce-admin .ca-modal-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
#pce-admin .ca-modal-box p { color: var(--muted); margin-bottom: 20px; }
#pce-admin .ca-mail-box { width: min(680px, 100%); display: grid; gap: 12px; padding: 18px; }
#pce-admin .ca-mail-box header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
#pce-admin .ca-mail-box header span { display: block; font-size: 12px; }
#pce-admin .ca-mail-box header strong { font-size: 15px; }
#pce-admin .ca-mail-box iframe { width: 100%; height: min(70vh, 760px); border: 1px solid var(--line); border-radius: 12px; background: #F4EFE6; }
#pce-admin .ca-mail-box p { margin: 0; font-size: 12px; }
#pce-admin .ca-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
#pce-admin .ca-toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
#pce-admin .ca-toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px; background: #1f2937; color: #fff; box-shadow: var(--sh-2); font-weight: 500; animation: ca-pop .2s; transition: opacity .3s, transform .3s; }
#pce-admin .ca-toast .ca-i { color: #86efac; }
#pce-admin .ca-toast--error { background: #7f1d1d; }
#pce-admin .ca-toast--error .ca-i { color: #fecaca; }
#pce-admin .ca-toast.is-out { opacity: 0; transform: translateY(8px); }
@keyframes ca-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
#pce-admin .ca-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: ca-spin .7s linear infinite; display: inline-block; }
#pce-admin .ca-spin--lg { width: 28px; height: 28px; border-width: 3px; color: var(--p); }
@keyframes ca-spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  #pce-admin .ca-editor { grid-template-columns: 1fr; }
  #pce-admin .ca-editor-preview { position: static; order: -1; }
  #pce-admin .ca-thead, #pce-admin .ca-trow { grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 1fr) minmax(160px, 1.2fr) 20px; }
  #pce-admin .ca-thead span:nth-child(3), #pce-admin .ca-trow .ca-date { display: none; }
}
@media (max-width: 782px) {
  #pce-admin .ca-app { grid-template-columns: 1fr; }
  #pce-admin .ca-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  #pce-admin .ca-brand { padding: 4px 10px; }
  #pce-admin .ca-new { margin: 0; padding: 0 14px; }
  #pce-admin .ca-side-foot { display: none; }
  #pce-admin .ca-grid2 { grid-template-columns: 1fr; }
  #pce-admin .ca-search input { min-width: 0; }
  #pce-admin .ca-thead { display: none; }
  #pce-admin .ca-trow { grid-template-columns: 1fr; gap: 6px; }
  #pce-admin .ca-cell-end { display: none; }
}
@media (prefers-reduced-motion: reduce) { #pce-admin *, .pce-app * { transition: none !important; animation: none !important; } }

/* ---------- delivery: the certificate arrives in a golden paper envelope tied with silk ---------- */
.pce-tools { display: inline-flex; gap: 6px; margin-left: 12px; vertical-align: middle; }
.pce-tool { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(167,122,38,.45); background: rgba(255,248,230,.9); color: #8A6416; display: inline-grid; place-items: center; cursor: pointer; padding: 0; box-shadow: 0 2px 6px -3px rgba(138,100,22,.4); transition: background .2s; }
.pce-tool:hover { background: #F8E7B8; }
html[data-paper="night"] .pce-tool { background: rgba(233,199,122,.12); border-color: rgba(233,199,122,.45); color: #E9C77A; }
.pce-tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pce-tool .x, .pce-tool.is-off .w1, .pce-tool.is-off .w2 { display: none; }
.pce-tool.is-off .x { display: inline; }
.pce-tool:focus-visible { outline: 3px solid #FFBD59; outline-offset: 2px; }
.pce-stage { position: relative; background: #FFFCF7; }
.pce-stage .rule1, .pce-stage .rule2 { position: absolute; pointer-events: none; }
.pce-stage .rule1 { inset: 3.4% 2.4%; border: 1px solid rgba(176,130,50,.7); }
.pce-stage .rule2 { inset: 4.2% 2.97%; border: 1px solid rgba(176,130,50,.42); }
/* Keep the same CSS frame through the flip and the finished presentation. */
@media (max-width: 639px) { .pce-stage .rule1 { inset: 1.98% 2.8%; } .pce-stage .rule2 { inset: 2.55% 3.6%; } }
/* sealed: only the envelope shows; the page waits behind it */
.pce.sealed .pce-head, .pce.sealed .pce-bar, .pce.sealed .pce-note, .pce.sealed .pce-status, .pce.sealed .pce-share, .pce.sealed .pce-next { opacity: 0; }
.pce.sealed .pce-stage { visibility: hidden; }
.pce .pce-head > * { transition: opacity 1.4s ease, transform 1.4s cubic-bezier(.25, .1, .25, 1); }
.pce.sealed .pce-head > *, .pce.revealing .pce-head > * { transform: none; }
.pce.revealing .pce-head > * { animation: pce-up 1.5s cubic-bezier(.25, .1, .25, 1) both; }
.pce.revealing .pce-head > :nth-child(1) { animation-delay: .35s; }
.pce.revealing .pce-head > :nth-child(3) { animation-delay: .9s; }
.pce.revealing .pce-head > :nth-child(4) { animation-delay: 4.2s; }
.pce.revealing .pce-bar, .pce.revealing .pce-note { animation: pce-fade 1.4s ease 3.6s both; }
.pce.revealing .pce-next { animation: pce-fade 1.6s ease 4.6s both; }
@keyframes pce-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pce-fade { from { opacity: 0; } to { opacity: 1; } }
.pce-envroom { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; pointer-events: none;
  --silk: #8E1C4B; --silk-hi: #C9628E; }
.pce-envroom > * { pointer-events: auto; }
.pce-env { position: relative; width: min(88vw, 620px); aspect-ratio: 1.45; perspective: 1400px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  animation: pce-float 6s ease-in-out infinite; outline: none; container-type: inline-size; }
.port .pce-env { width: min(80vw, 360px); aspect-ratio: .68; }
.pce-env:focus-visible { outline: 3px solid #E3BC67; outline-offset: 4px; }
@keyframes pce-float { 0%, 100% { transform: translateY(0) rotate(-.4deg); } 50% { transform: translateY(-6px) rotate(.4deg); } }
.pce-env .env-back { position: absolute; inset: 0; border-radius: 6px; background-color: #B98A35; background-image: var(--fibre), linear-gradient(160deg, #C49237, #9C7020);
  box-shadow: 0 2px 3px rgba(80,56,10,.25), 0 30px 60px -24px rgba(80,56,10,.55); }
.pce-env .sheet { position: absolute; left: 5%; top: 5%; width: 90%; aspect-ratio: 1414 / 1000; z-index: 2; transform-style: preserve-3d; transition: transform 2.1s cubic-bezier(.33, .1, .2, 1); }
.port .pce-env .sheet { aspect-ratio: 1000 / 1414; top: 6%; }
.pce-env .sheet.out { transform: translateY(-92%); }
.pce-env .sheet.turn { transition: transform 2.2s cubic-bezier(.55, .02, .3, 1); transform: translateY(-92%) rotateY(180deg); }
.pce-env .face { position: absolute; inset: 0; background: #FFFCF7; border-radius: 3px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--pce-sheet-shadow); transition: box-shadow 2.3s cubic-bezier(.45, .05, .2, 1); will-change: transform; }
.pce-env .front { transform: rotateY(180deg); }
.pce-env .front .rule1, .pce-env .front .rule2 { position: absolute; pointer-events: none; }
.pce-env .front .rule1 { inset: 3.4% 2.4%; border: 1px solid rgba(176,130,50,.7); }
.pce-env .front .rule2 { inset: 4.2% 2.97%; border: 1px solid rgba(176,130,50,.42); }
.port .pce-env .front .rule1 { inset: 1.98% 2.8%; }
.port .pce-env .front .rule2 { inset: 2.55% 3.6%; }
.pce-env .emboss, .pce-env .emblem-sym { position: absolute; background: #B08636; -webkit-mask: var(--sym) center / contain no-repeat; mask: var(--sym) center / contain no-repeat; }
.pce-env .emboss { left: 50%; top: 50%; width: 17%; aspect-ratio: 1; transform: translate(-50%, -50%); filter: drop-shadow(0 1px 0 rgba(255,255,255,.9)); }
.port .pce-env .emboss { width: 24%; }
.pce-env .pocket, .pce-env .flap { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.pce-env .pocket svg, .pce-env .flap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.pce-env .flap { transform-origin: 50% 0; transition: transform 1.3s cubic-bezier(.45, .05, .25, 1); z-index: 4; }
.pce-env .flap.open { transform: rotateX(180deg); }
.pce-env .flap.behind { z-index: 1; }
.pce-env .thin { vector-effect: non-scaling-stroke; }
.pce-envroom .port-only { display: none; }
.pce-envroom.port .port-only { display: inline; }
.pce-envroom.port .land-only { display: none; }
.pce-env .cords { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.pce-env .cord-v, .pce-env .cord-h { position: absolute; border-radius: 4px; box-shadow: 0 1px 2px rgba(60,10,30,.35); transition: transform 1.1s cubic-bezier(.6, 0, .35, 1) .3s, opacity .5s ease 1s; }
.pce-env .cord-v { left: 27.4%; top: -3.5%; bottom: -3.5%; width: 7px; margin-left: -3.5px; background: linear-gradient(90deg, #6E1238, var(--silk) 30%, var(--silk-hi) 50%, var(--silk) 70%, #6E1238); transform-origin: 50% 57.7%; }
.pce-env .cord-h { top: 57.7%; left: -2.5%; right: -2.5%; height: 7px; margin-top: -3.5px; background: linear-gradient(180deg, #6E1238, var(--silk) 30%, var(--silk-hi) 50%, var(--silk) 70%, #6E1238); transform-origin: 28.6% 50%; }
.port .pce-env .cord-v { display: none; }
.port .pce-env .cord-h { top: 46%; transform-origin: 50% 50%; }
.pce-env.untie .cord-v { transform: scaleY(0); opacity: 0; }
.pce-env.untie .cord-h { transform: scaleX(0); opacity: 0; }
.pce-env .knot { position: absolute; left: 27.4%; top: 57.7%; width: 31%; transform: translate(-50%, -38%); z-index: 6; pointer-events: none; }
.port .pce-env .knot { left: 50%; top: 46%; width: 56%; }
.pce-env .knot svg { width: 100%; display: block; overflow: visible; }
.pce-env .cord { fill: none; stroke: var(--silk); stroke-width: 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pce-env .cord-hi { fill: none; stroke: var(--silk-hi); stroke-width: 1.6; stroke-linecap: round; opacity: .75; vector-effect: non-scaling-stroke; }
.pce-env .knot .bow, .pce-env .knot .emblem { transform-origin: 100px 60px; transition: transform .9s cubic-bezier(.5, 0, .3, 1), opacity .7s ease .2s; }
.pce-env .emblem-sym { left: 50%; top: 42.9%; width: 15%; aspect-ratio: 1; transform: translate(-50%, -50%); background: #7A5512; transition: opacity .5s ease; }
.pce-env.untie .knot .bow { transform: scale(.2) rotate(40deg); opacity: 0; }
.pce-env.untie .knot .emblem { transform: scale(.6); opacity: 0; transition-delay: 0s; }
.pce-env.untie .emblem-sym { opacity: 0; }
.pce-env .words { position: absolute; left: 36%; right: 4%; bottom: 11%; text-align: center; z-index: 4; pointer-events: none; transition: opacity .6s ease; white-space: nowrap; }
.port .pce-env .words { left: 8%; right: 8%; bottom: 13%; white-space: normal; }
.pce-env .words .for { display: block; margin-bottom: .9em; font: 600 max(8px, 1.9cqw)/1.4 Lato, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: rgba(92,62,10,.78); }
.pce-env .words .love { display: block; font: 400 4.9cqw/1.2 "Pinyon Script", cursive; color: #6B4A12; text-shadow: 0 1px 0 rgba(255,240,200,.6); }
.port .pce-env .words .for { font-size: max(9px, 3.2cqw); }
.port .pce-env .words .love { font-size: 8.6cqw; line-height: 1.2; }
.pce-env.untie .words { opacity: 0; }
.pce-env.opened { animation: none; cursor: default; outline: none !important; }
.pce-env.pan .env-back, .pce-env.pan .pocket, .pce-env.pan .flap, .pce-env.pan .cords, .pce-env.pan .knot { opacity: 0; transition: opacity 1.5s ease .5s; }
.pce-open-hint { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 400 16px/1.4 Lato, "Helvetica Neue", Arial, sans-serif; letter-spacing: .02em; color: #8A6416; transition: opacity .5s ease; -webkit-font-smoothing: antialiased; }
.pce-open-hint .pce-tap { width: 18px; height: 18px; color: #8A6416; }
@media (prefers-reduced-motion: reduce) { .pce-env { animation: none; } }

/* The envelope arrives gently when the mandala loader finishes. */
.pce-envroom { opacity: 0; transition: opacity .9s ease-out; }
.pce-envroom.arrived { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .pce-envroom { opacity: 1; transition: none; } }

/* Keep the compositor scale too: fractional zoomed strokes must not snap back to CSS border pixels. */
.pce-retained-frame { position: absolute; left: 0; top: 0; width: calc(100% / var(--pce-frame-scale, 1)); height: calc(100% / var(--pce-frame-scale, 1)); transform: scale(var(--pce-frame-scale, 1)); transform-origin: 0 0; pointer-events: none; }

/* ---------- guided tour ---------- */
.pce-tour { position: fixed; inset: 0; z-index: 40; opacity: 0; transition: opacity .3s ease; font-family: Lato, "Helvetica Neue", Arial, sans-serif; }
.pce-tour.on { opacity: 1; }
.pce-tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(9,30,48,.62), 0 0 0 2px #E9C77A, 0 0 24px 4px rgba(233,199,122,.45); transition: left .45s cubic-bezier(.4, 0, .2, 1), top .45s cubic-bezier(.4, 0, .2, 1), width .45s cubic-bezier(.4, 0, .2, 1), height .45s cubic-bezier(.4, 0, .2, 1); pointer-events: none; }
.pce-tour-card { position: fixed; box-sizing: border-box; padding: 18px 20px 14px; border-radius: 16px; background: #FFFCF7; color: #09304D; box-shadow: 0 20px 50px -18px rgba(0,0,0,.55); transition: left .45s cubic-bezier(.4, 0, .2, 1), top .45s cubic-bezier(.4, 0, .2, 1); }
.pce-tour-count { margin: 0 0 4px; font-size: 11px; line-height: 1.4; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: #A77A26; }
.pce-tour-card h2 { margin: 0 0 6px; font: 500 21px/1.25 "Playfair Display", Georgia, serif; color: #09304D; }
.pce-tour-text { margin: 0 0 14px; font-size: 15px; line-height: 1.55; color: #4E5B66; }
.pce-tour-nav { display: flex; align-items: center; gap: 8px; }
.pce-tour-nav span { flex: 1; }
.pce-tour-nav button { min-height: 38px; padding: 8px 16px; border-radius: 999px; font: 700 14px/1.2 Lato, sans-serif; cursor: pointer; border: 1px solid rgba(9,48,77,.18); background: transparent; color: #09304D; }
.pce-tour-nav .pce-tour-skip { border: 0; padding: 8px 6px; color: #6B7682; font-weight: 400; }
.pce-tour-nav .pce-tour-next { border: 0; background: linear-gradient(180deg, #F8E7B8 0%, #EBCB7F 100%); color: #4A350B; box-shadow: inset 0 0 0 1px rgba(167,122,38,.35); }
.pce-tour-nav button[hidden] { display: none; }
.pce-tour-nav button:focus-visible { outline: 3px solid #FFBD59; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .pce-tour, .pce-tour-spot, .pce-tour-card { transition: none; } }

/* Taps and double-taps never select text: no blue highlight on buttons, artwork or labels. Fields stay selectable. */
.pce-app, .pce-app *, .pce-envroom, .pce-envroom *, .pce-tour, .pce-tour *, .ptl-loader, .ptl-loader * { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
.pce-app input, .pce-app textarea, .pce-app select, .pce-app [contenteditable], .pce-envroom input, .pce-envroom textarea, .pce-envroom select, .pce-envroom [contenteditable], .pce-tour input, .pce-tour textarea, .pce-tour select, .pce-tour [contenteditable], .ptl-loader input, .ptl-loader textarea, .ptl-loader select, .ptl-loader [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.pce-app button, .pce-envroom button, .pce-tour button, .ptl-loader button { cursor: pointer; }
.pce-app button:disabled { cursor: default; }

/* Staff help panel (staff-help.js), shared by the Certificates and Sankalpa admins. */
#pce-admin .ph-body { display: grid; gap: 14px; }
#pce-admin .ph-toc { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 4px; }
#pce-admin .ph-toc a { padding: 6px 12px; border-radius: 999px; background: var(--p-container); color: var(--on-p-container); font-size: 13px; line-height: 20px; font-weight: 600; text-decoration: none; }
#pce-admin .ph-toc a:hover { filter: brightness(0.96); }
#pce-admin .ph-sec { scroll-margin-top: 12px; }
#pce-admin .ph-sec h2 { margin: 0 0 10px; font-size: 16px; line-height: 24px; }
#pce-admin .ph-sec p, #pce-admin .ph-sec li { font-size: 14px; line-height: 22px; color: var(--ink); }
#pce-admin .ph-sec p { margin: 0 0 10px; }
#pce-admin .ph-sec p:last-child { margin-bottom: 0; }
#pce-admin .ph-sec ol, #pce-admin .ph-sec ul { margin: 0 0 10px; padding-left: 22px; display: grid; gap: 8px; }
#pce-admin .ph-share { font-size: 13px; line-height: 20px; margin: 0; }
#pce-admin .sk-next { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 14px; line-height: 22px; }
#pce-admin .sk-next > span { flex: 1 1 320px; }
#pce-admin .sk-next .ca-i { flex: none; margin-top: 2px; color: var(--p); }
#pce-admin .sk-next a { font-weight: 600; color: var(--p); text-decoration: none; white-space: nowrap; }
