/* iipp-generator — style blocks lifted from the testrightacademy.com original.
   Externalised because style-src-elem is 'self' on this vhost. */


    .csg-toolbar { position: sticky; top: 70px; z-index: 50; background: var(--primary); color: #fff;
      display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 24px; flex-wrap: wrap; }
    .csg-toolbar .tb-label { font-size: 0.85rem; color: #cbd5e1; max-width: 540px; line-height: 1.4; }
    .csg-toolbar .tb-label strong { color: #fff; }
    .csg-toolbar .tb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
    .csg-btn { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-family: inherit; font-size: 0.85rem;
      font-weight: 600; padding: 9px 15px; border-radius: 5px; border: 1.5px solid rgba(255,255,255,0.35); background: transparent; color: #fff; transition: 0.2s; }
    .csg-btn:hover { background: rgba(255,255,255,0.12); }
    .csg-btn.primary { background: #b3271e; border-color: #b3271e; }
    .csg-btn.primary:hover { background: #d94d3f; }
    .csg-info { background: #ecfdf5; border-bottom: 1px solid #a7f3d0; color: #065f46; font-size: 0.85rem; padding: 10px 24px; text-align: center; line-height: 1.5; }
    .csg-disclaim { background: #fffbeb; border-bottom: 1px solid #fcd34d; color: #92400e; font-size: 0.82rem; padding: 10px 24px; text-align: center; line-height: 1.5; }
    .csg-disclaim strong { color: #78350f; }

    .csg-wrap { max-width: 1500px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: minmax(340px, 1fr) auto; gap: 26px; align-items: start; }
    .csg-editor { min-width: 0; }
    .csg-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
    .csg-card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 11px; padding: 14px 18px; font-weight: 700; color: var(--primary); font-size: 0.98rem; user-select: none; }
    .csg-card > summary::-webkit-details-marker { display: none; }
    .csg-card > summary .ci { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 6px; background: var(--light-bg); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 0.9rem; }
    .csg-card > summary .chev { margin-left: auto; color: var(--text-muted); transition: 0.2s; }
    .csg-card[open] > summary .chev { transform: rotate(90deg); }
    .csg-card .body { padding: 4px 18px 18px; }
    .csg-field { margin-bottom: 13px; }
    .csg-field:last-child { margin-bottom: 0; }
    .csg-field label { display: block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 5px; }
    .csg-field input[type=text], .csg-field input[type=date], .csg-field input[type=number], .csg-field textarea, .csg-field select {
      width: 100%; box-sizing: border-box; border: 1.5px solid var(--border); border-radius: 6px; padding: 9px 12px; font-family: inherit; font-size: 0.92rem; color: var(--text); background: #fff; }
    .csg-field input:focus, .csg-field textarea:focus, .csg-field select:focus { outline: none; border-color: var(--accent); }
    .csg-field textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
    .csg-hint { font-size: 0.76rem; color: var(--text-muted); margin-top: 5px; line-height: 1.45; font-style: italic; }
    .csg-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .csg-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
    .csg-group-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin: 14px 0 7px; }
    .csg-chips { display: flex; flex-wrap: wrap; gap: 7px; }
    .csg-chip { cursor: pointer; font-size: 0.8rem; padding: 6px 11px; border-radius: 50px; border: 1.5px solid var(--border); background: #fff; color: var(--text); transition: 0.15s; user-select: none; }
    .csg-chip:hover { border-color: var(--accent); }
    .csg-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
    .csg-chip.on::before { content: "\2713  "; font-weight: 700; }
    .csg-addrow { display: flex; gap: 7px; margin-top: 9px; }
    .csg-addrow input { flex: 1; }
    .csg-mini { padding: 8px 13px; font-size: 0.82rem; border: 1.5px solid var(--accent); background: var(--accent); color: #fff; border-radius: 6px; cursor: pointer; font-weight: 600; white-space: nowrap; }
    .csg-mini.ghost { background: #fff; color: var(--accent); }
    .csg-rep { border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; background: #fbfcfe; position: relative; }
    .csg-rep .csg-del { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 1.5px solid var(--border); background: #fff; color: #b3271e; border-radius: 6px; cursor: pointer; font-size: 0.82rem; }
    .csg-rep .csg-del:hover { border-color: #b3271e; background: #fef2f2; }
    .el-block { border-left: 3px solid var(--accent); padding-left: 12px; margin-bottom: 16px; }
    .el-block .el-h { font-size: 0.85rem; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
    .el-block .el-reg { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }

    /* ---- Preview ---- */
    .csg-preview { position: sticky; top: 132px; width: 816px; }
    .csg-scaler { transform-origin: top left; }
    .page-meter { margin-top: 12px; padding: 9px 14px; border-radius: 7px; font-size: 0.82rem; font-weight: 600; text-align: center; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

    /* ===== The IIPP document pages ===== */
    #doc { --accent: #0d2e4e; }
    .ipage { width: 8.5in; min-height: 11in; box-sizing: border-box; background: #fff; color: #1a2433;
      padding: 0.85in 0.85in 0.7in; margin: 0 auto 22px; box-shadow: 0 6px 30px rgba(13,46,78,0.18);
      font: 11pt/1.5 "Segoe UI", system-ui, -apple-system, sans-serif; position: relative; }
    .ipage * { box-sizing: border-box; }
    .ipage .pg-num { position: absolute; bottom: 0.4in; left: 0; right: 0; text-align: center; font-size: 8pt; color: #94a3b8; }
    .ipage .run-head { position: absolute; top: 0.4in; left: 0.85in; right: 0.85in; display: flex; justify-content: space-between; font-size: 7.5pt; color: #b6c0cc; border-bottom: 1px solid #eef1f5; padding-bottom: 3px; }
    .doc-cover { text-align: center; margin-top: 1.4in; }
    .doc-cover .ct { font-family: Georgia, "Times New Roman", serif; font-size: 25pt; font-weight: 800; color: var(--accent); line-height: 1.12; }
    .doc-cover .cs { font-size: 11pt; color: #475569; margin-top: 8px; }
    .doc-cover .cn { font-size: 17pt; font-weight: 700; color: #1a2433; margin-top: 28px; }
    .doc-cover .ca { font-size: 10.5pt; color: #334155; margin-top: 4px; line-height: 1.5; }
    .doc-factbox { max-width: 4.6in; margin: 30px auto 0; border: 1.5px solid var(--accent); border-radius: 6px; text-align: left; font-size: 10pt; }
    .doc-factbox div { padding: 6px 12px; border-bottom: 1px solid #e2e8f0; }
    .doc-factbox div:last-child { border-bottom: none; }
    .doc-factbox b { color: var(--accent); }
    .doc-h2 { font-size: 12.5pt; font-weight: 800; color: var(--accent); border-bottom: 2px solid var(--accent); padding-bottom: 3px; margin: 4px 0 8px; break-after: avoid; }
    .doc-h3 { font-size: 9.5pt; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: #334155; margin: 10px 0 3px; }
    .doc-p { font-size: 10.5pt; line-height: 1.5; margin: 0 0 8px; color: #2d3748; }
    .doc-block { margin-bottom: 14px; }
    .doc-table { width: 100%; border-collapse: collapse; font-size: 9pt; margin: 4px 0 6px; }
    .doc-table th { background: var(--accent); color: #fff; text-align: left; padding: 5px 7px; font-size: 8.5pt; }
    .doc-table td { border: 1px solid #cbd5e1; padding: 4px 7px; vertical-align: top; color: #2d3748; }
    .doc-table tr:nth-child(even) td { background: #f8fafc; }
    .doc-note { font-size: 8.5pt; color: #64748b; font-style: italic; margin: 2px 0 8px; }
    .doc-sign { margin-top: 12px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 12px; }
    .doc-sign .sl { border-bottom: 1px solid #475569; height: 26px; margin: 14px 0 3px; }
    .st-ghost { color: #b6c0cc !important; }

    @page { size: letter; margin: 0; }
    @media print {
      .nav, .csg-toolbar, .csg-info, .csg-disclaim, .csg-editor, .page-meter, .page-hero, footer, .fb-band, .csg-mobile-bar, .csg-foot-note { display: none !important; }
      body { padding: 0 !important; background: #fff !important; }
      .csg-wrap { display: block !important; padding: 0 !important; max-width: none !important; }
      .csg-preview { position: static !important; width: auto !important; top: 0 !important; }
      .csg-scaler { transform: none !important; }
      .ipage { box-shadow: none !important; margin: 0 !important; page-break-after: always; break-after: page; min-height: 11in; }
      .ipage:last-child { page-break-after: auto; break-after: auto; }
      .st-ghost { display: none !important; }
    }
    .pdf-capturing .st-ghost { display: none !important; }
    .pdf-capturing .ipage { box-shadow: none !important; }

    @media (max-width: 1180px) { .csg-wrap { grid-template-columns: 1fr; } .csg-preview { position: static; width: 100%; overflow: hidden; } }
    @media (max-width: 700px) { .csg-toolbar { top: 60px; } .csg-preview { top: 0; } .csg-grid2, .csg-grid3 { grid-template-columns: 1fr; } .csg-mobile-bar { display: flex !important; } }
    .csg-mobile-bar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: var(--primary); padding: 10px 14px; gap: 10px; box-shadow: 0 -4px 18px rgba(0,0,0,0.25); }
    .csg-mobile-bar .csg-btn { flex: 1; justify-content: center; }
    .toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #0d2e4e; color: #fff; padding: 11px 20px; border-radius: 8px; font-size: 0.9rem; z-index: 200; opacity: 0; transition: 0.3s; pointer-events: none; }
    .toast.show { opacity: 1; }
    #pdfOverlay { position: fixed; inset: 0; z-index: 300; background: rgba(13,46,78,0.9); color: #fff; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; font-size: 1rem; font-weight: 600; }
    #pdfOverlay.show { display: flex; }
    .pdf-spin { width: 44px; height: 44px; border: 4px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: pdfspin 0.8s linear infinite; }
    @keyframes pdfspin { to { transform: rotate(360deg); } }
  

    .page-hero { position: relative; overflow: hidden; background: #0a2540 !important; }
    .page-hero .container { position: relative; z-index: 2; }
    .ph-photo { position: absolute; inset: 0; z-index: 0; background: url('images/iipp.webp') right center / cover no-repeat; filter: brightness(1.8) contrast(1.08) saturate(1.12); }
    .ph-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,37,64,0.90) 0%, rgba(10,37,64,0.66) 44%, rgba(10,37,64,0.30) 100%); }
  