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


    /* ===== Capabilities Statement Generator &mdash; page-specific ===== */
    .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: 560px; 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-info i { margin-right: 6px; }

    .csg-wrap { max-width: 1500px; margin: 0 auto; padding: 24px;
      display: grid; grid-template-columns: minmax(340px, 1fr) auto; gap: 26px; align-items: start; }

    /* ---- Editor ---- */
    .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=email], .csg-field input[type=url],
    .csg-field input[type=tel], .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: 70px; 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-count { float: right; font-style: normal; font-weight: 600; }
    .csg-count.warn { color: var(--warning); }

    /* chip multi-select */
    .csg-group-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
      color: var(--accent); margin: 12px 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); }

    /* repeatable rows */
    .csg-rep-row { display: flex; gap: 7px; margin-bottom: 7px; align-items: flex-start; }
    .csg-rep-row .grow { flex: 1; display: flex; flex-direction: column; gap: 6px; }
    .csg-del { flex: 0 0 auto; width: 34px; height: 34px; border: 1.5px solid var(--border); background: #fff;
      color: #b3271e; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
    .csg-del:hover { border-color: #b3271e; background: #fef2f2; }
    .csg-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
    .csg-quick button { font-size: 0.76rem; padding: 5px 10px; border-radius: 50px; border: 1px dashed var(--accent);
      background: #fff; color: var(--accent); cursor: pointer; }
    .csg-quick button:hover { background: var(--light-bg); }
    .csg-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; }
    .csg-checks label { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; font-weight: 500;
      text-transform: none; letter-spacing: 0; color: var(--text); cursor: pointer; margin: 0; }
    .csg-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .swatches { display: flex; gap: 6px; margin-top: 7px; }
    .swatches span { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
    .seg { display: inline-flex; border: 1.5px solid var(--border); border-radius: 7px; overflow: hidden; }
    .seg button { border: none; background: #fff; padding: 8px 16px; font-size: 0.85rem; font-weight: 600; cursor: pointer; color: var(--text-muted); }
    .seg button.on { background: var(--accent); color: #fff; }
    .logo-thumb { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
    .logo-thumb img { max-height: 44px; max-width: 130px; border: 1px solid var(--border); border-radius: 4px; padding: 3px; background: #fff; }

    /* ---- 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; }
    .page-meter.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
    .page-meter.warn { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
    .page-meter.over { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

    /* ===== The statement sheet (Letter) ===== */
    .sheet { --accent: #0d2e4e; width: 8.5in; min-height: 11in; box-sizing: border-box;
      background: #fff; color: #1a2433; padding: 0.45in 0.5in; box-shadow: 0 6px 30px rgba(13,46,78,0.18);
      font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 10pt; display: flex; flex-direction: column; }
    .sheet * { box-sizing: border-box; }
    .st-fs { font-size: var(--fs, 10pt); flex: 1; display: flex; flex-direction: column; }

    .st-top { display: flex; align-items: center; gap: 18px; padding-bottom: 10px; }
    .st-top .st-logo { max-height: 0.85in; max-width: 2.4in; flex: 0 0 auto; }
    .st-top .st-id { flex: 1; }
    .st-name { font-size: 1.9em; font-weight: 800; color: var(--accent); line-height: 1.05; font-family: Georgia, "Times New Roman", serif; }
    .st-tag { font-size: 0.98em; font-style: italic; color: #4a5568; margin-top: 3px; }
    .st-web { font-size: 0.85em; color: var(--accent); font-weight: 600; margin-top: 3px; }
    .st-rule { height: 3px; background: var(--accent); margin: 0 0 12px; }
    .st-ghost { color: #b6c0cc !important; }

    .st-body { display: grid; grid-template-columns: 1.04fr 0.96fr; gap: 0.34in; flex: 1; }
    .st-h { font-size: 0.82em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.045em;
      color: var(--accent); border-bottom: 1.5px solid var(--accent); padding-bottom: 2px; margin: 0 0 5px; }
    .st-sec { margin-bottom: var(--gap, 9px); }
    .st-sec:last-child { margin-bottom: 0; }
    .st-p { font-size: 0.92em; line-height: 1.34; margin: 0; color: #2d3748; }
    .st-ul { list-style: none; margin: 0; padding: 0; }
    .st-ul li { font-size: 0.9em; line-height: 1.3; padding-left: 14px; position: relative; margin-bottom: 2px; color: #2d3748; }
    .st-ul li::before { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900;
      position: absolute; left: 0; top: 1px; color: var(--accent); font-size: 0.72em; }
    .st-ul.two { column-count: 2; column-gap: 14px; }
    .st-ul.two li { break-inside: avoid; }
    .st-pp { margin-bottom: 5px; }
    .st-pp b { font-size: 0.9em; color: var(--accent); display: block; }
    .st-pp span { font-size: 0.88em; color: #2d3748; line-height: 1.28; }
    .st-pills { display: flex; flex-wrap: wrap; gap: 4px; }
    .st-pill { font-size: 0.78em; padding: 2px 8px; border-radius: 50px; border: 1px solid var(--accent); color: var(--accent); }
    .st-pill.fill { background: var(--accent); color: #fff; border-color: var(--accent); }
    .st-naics { font-size: 0.88em; line-height: 1.32; color: #2d3748; }
    .st-naics b { color: var(--accent); }
    .st-cust { font-size: 0.88em; line-height: 1.34; color: #2d3748; }

    .st-foot { margin: 14px -0.5in -0.45in; background: var(--accent); color: #fff; padding: 11px 0.5in; }
    .st-foot .codes { font-size: 0.78em; opacity: 0.92; margin-bottom: 5px; }
    .st-foot .contact { font-size: 0.86em; font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 16px; }
    .st-foot .contact i { margin-right: 4px; opacity: 0.85; }

    /* Modern template */
    .sheet.tpl-modern .st-top { background: var(--accent); color: #fff; margin: -0.45in -0.5in 0; padding: 0.3in 0.5in; align-items: center; }
    .sheet.tpl-modern .st-name { color: #fff; }
    .sheet.tpl-modern .st-tag { color: #e2e8f0; }
    .sheet.tpl-modern .st-web { color: #fff; }
    .sheet.tpl-modern .st-logo { background: #fff; border-radius: 6px; padding: 5px; }
    .sheet.tpl-modern .st-rule { display: none; }
    .sheet.tpl-modern .st-h { background: var(--accent); color: #fff; border: none; padding: 3px 7px; border-radius: 3px; display: inline-block; }
    .sheet.tpl-modern .st-body { margin-top: 14px; }

    /* ===== Print ===== */
    @page { size: letter; margin: 0; }
    @media print {
      .nav, .csg-toolbar, .csg-info, .csg-editor, .page-meter, .page-hero, footer, .fb-band, .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; }
      .sheet { box-shadow: none !important; margin: 0 !important; width: 8.5in !important; min-height: 0 !important; }
      .st-ghost { display: none !important; }
    }

    /* ===== Responsive ===== */
    @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-checks { 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); } }
    .pdf-capturing .st-ghost { display: none !important; }
    .pdf-capturing .sheet { box-shadow: none !important; }
  

    .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/capabilities_generator.webp') right 28% / cover no-repeat; filter: saturate(0.5) brightness(0.9); }
    .ph-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,37,64,0.88) 0%, rgba(10,37,64,0.74) 50%, rgba(10,37,64,0.80) 100%); }
  