/* L7 SOLUTIONS — P.A.C.T.S™ Document Shell stylesheet (shared, print-optimized)
   Brand: red #dc2626 · black #000 · white · gold #c79a3a/#e6c463
   Use these classes only, so every doc shell stays consistent. */

:root{
  --red:#dc2626; --red-dk:#b3121d; --ink:#111; --ink-soft:#3a3a3a; --mut:#6b6b6b;
  --gold:#c79a3a; --gold-hi:#e6c463; --line:#d8d8d8; --paper:#fff; --wash:#faf8f3;
  --serif:"Iowan Old Style","Palatino Linotype",Georgia,"Times New Roman",serif;
  --sans:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;color:var(--ink);font-family:var(--serif);-webkit-font-smoothing:antialiased}
/* SURROUND — light by default (the .page surfaces stay white; only the body background changes) */
body{background:#e9e9ec}
html[data-theme="dark"] body{background:#3a3a40}
.toolbar{position:sticky;top:0;z-index:50;background:#18181b;color:#f4f4f6;display:flex;gap:12px;align-items:center;justify-content:space-between;padding:12px 20px;font-family:var(--sans);font-size:13.5px}
.toolbar b{font-weight:700}
.toolbar .btn{font-family:var(--sans);font-weight:700;font-size:13px;border:1px solid #3f3f46;color:#f4f4f6;background:#27272a;border-radius:8px;padding:8px 14px;cursor:pointer;text-decoration:none}
.toolbar .btn.print{background:linear-gradient(135deg,#ff3b46,var(--red-dk));border-color:transparent}
.toolbar .theme-toggle{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;font-size:15px;line-height:1;border:1px solid #3f3f46;color:#f4f4f6;background:#27272a;border-radius:8px;padding:0;cursor:pointer;vertical-align:middle}
.toolbar .theme-toggle:hover{background:#3f3f46}

/* PAGE — US Letter */
.page{width:8.5in;min-height:11in;background:var(--paper);margin:22px auto;padding:0.9in 0.85in 0.8in;position:relative;box-shadow:0 10px 40px rgba(0,0,0,.45);display:flex;flex-direction:column}
.page + .page{margin-top:0}

/* Running header / footer */
.doc-header{display:flex;align-items:center;justify-content:space-between;border-bottom:2px solid var(--ink);padding-bottom:10px;margin-bottom:26px}
.doc-header .lhh{display:flex;align-items:center;gap:10px}
.doc-header .logo{width:30px;height:30px;border-radius:7px;display:block}
.doc-header .org{font-family:var(--sans);font-weight:800;font-size:14px;letter-spacing:-.01em;line-height:1}
.doc-header .org small{display:block;font-weight:600;color:var(--mut);font-size:10px;letter-spacing:.04em;margin-top:2px}
.doc-header .tag{font-family:var(--sans);font-size:10px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--red)}
.doc-footer{margin-top:auto;border-top:1px solid var(--line);padding-top:10px;display:flex;justify-content:space-between;align-items:center;font-family:var(--sans);font-size:9.5px;color:var(--mut);letter-spacing:.02em}
.doc-footer .c{color:var(--ink)}

/* COVER page */
.cover{justify-content:center;text-align:center;background:linear-gradient(180deg,#000 0%,#0c0c0e 60%,#161616 100%);color:#f5f5f7}
.cover .emblem{width:130px;height:auto;margin:0 auto 26px;filter:drop-shadow(0 10px 30px rgba(230,196,99,.4))}
.cover .kicker{font-family:var(--sans);font-size:12px;font-weight:700;letter-spacing:.22em;text-transform:uppercase;color:var(--gold-hi)}
.cover h1{font-size:46px;line-height:1.05;letter-spacing:-.02em;margin:16px 0 10px;font-weight:700}
.cover .sub{font-family:var(--sans);color:#b9b9c2;font-size:15px;max-width:80%;margin:0 auto}
.cover .rule{width:64px;height:3px;background:linear-gradient(90deg,var(--gold-hi),var(--gold));margin:28px auto;border-radius:2px}
.cover .parties{font-family:var(--sans);font-size:13.5px;color:#e8e8ee;line-height:1.9;margin-top:8px}
.cover .parties b{color:#fff}
.cover .meta{font-family:var(--sans);position:absolute;bottom:0.9in;left:0;right:0;color:#8a8a95;font-size:11px;letter-spacing:.04em}

/* Document title (interior) */
.h-doc{font-size:26px;letter-spacing:-.01em;margin:0 0 4px;font-weight:700}
.doc-lead{font-family:var(--sans);color:var(--mut);font-size:12.5px;margin:0 0 22px}

/* Sections — each section is an atomic block that never splits across a page */
.section{margin:0 0 18px;line-height:1.6;font-size:13px;color:var(--ink-soft);break-inside:avoid;page-break-inside:avoid}
.section > h2{font-family:var(--sans);font-size:13px;font-weight:800;letter-spacing:.02em;color:var(--ink);margin:0 0 8px;text-transform:uppercase;break-after:avoid;page-break-after:avoid}
.section > h2 .n{color:var(--red);margin-right:8px}
.section p{margin:0 0 9px;orphans:3;widows:3}
.section ul,.section ol{margin:0 0 9px;padding-left:20px;break-inside:avoid;page-break-inside:avoid}
.section li{margin:0 0 5px}
/* A top-level section that must begin on a fresh page (apply alongside .section) */
.section.break{break-before:page;page-break-before:always}

/* Fillable fields + placeholders */
.placeholder{color:var(--mut);font-style:italic;background:var(--wash);border:1px dashed var(--gold);border-radius:4px;padding:1px 6px;font-family:var(--sans);font-size:12px}
.fill{display:inline-block;min-width:160px;border-bottom:1px solid var(--ink);height:1.1em}
.fieldgrid{display:grid;grid-template-columns:1fr 1fr;gap:14px 26px;font-family:var(--sans);font-size:12px;margin:6px 0 14px}
.field{display:flex;flex-direction:column;gap:4px}
.field label{font-weight:700;color:var(--ink);font-size:10.5px;letter-spacing:.04em;text-transform:uppercase}
.field .line{border-bottom:1px solid var(--ink);height:1.5em}
.field input{font:inherit;border:0;border-bottom:1px solid var(--ink);padding:2px 0;background:transparent;outline:none}
.field input:focus{border-color:var(--red)}

/* Party / notice boxes */
.party{background:var(--wash);border:1px solid var(--line);border-left:3px solid var(--red);border-radius:6px;padding:14px 16px;font-family:var(--sans);font-size:12px;line-height:1.7;margin:0 0 16px}
.party b{color:var(--ink)}
.notice{background:#fff;border:1px solid var(--line);border-radius:6px;padding:12px 14px;font-family:var(--sans);font-size:10.5px;color:var(--mut);line-height:1.6;margin:14px 0}

/* Signature / e-sign block */
.sigblock{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin-top:30px;page-break-inside:avoid}
.sig{font-family:var(--sans);font-size:11px}
.sig .who{font-weight:800;color:var(--ink);text-transform:uppercase;letter-spacing:.04em;font-size:10.5px;margin-bottom:26px}
.sig .sline{border-top:1px solid var(--ink);padding-top:5px;color:var(--mut)}
.sig .row{margin-top:16px}
.sig .row .line{border-bottom:1px solid var(--ink);height:1.4em;margin-top:2px}
.esign{font-family:var(--sans);font-size:10px;color:var(--mut);margin-top:18px;display:flex;align-items:center;gap:8px}
.esign .pill{border:1px solid var(--gold);color:var(--gold);font-weight:700;border-radius:999px;padding:2px 9px;letter-spacing:.06em}

@media print{
  /* Force backgrounds + colors to render (browsers strip them by default — this keeps the dark cover, logo, emblem and washes intact). */
  *{ -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; color-adjust:exact !important; }
  html,body,html[data-theme="dark"] body{ background:#fff !important; }
  /* Dark mode must NEVER print dark — force interior pages to light + readable. */
  html[data-theme="dark"]{ --ink:#111; --ink-soft:#3a3a3a; --mut:#6b6b6b; --line:#d8d8d8; --paper:#fff; --wash:#faf8f3; }
  html[data-theme="dark"] body{ color:#111 !important; }
  html[data-theme="dark"] .page:not(.cover){ background:#fff !important; }
  .toolbar{ display:none !important; }

  /* US Letter with sane margins. The page-number counter increments per printed sheet
     and is surfaced through the .doc-footer (see counter below). */
  @page{
    size:letter;
    margin:0.75in;
    counter-increment:page;
    /* Progressive enhancement: print engines that support @page margin boxes
       (Chrome/Edge, print-to-PDF) render an automatic "Page N" bottom-right.
       Engines that ignore it fall back to the explicit per-sheet number baked
       into each .doc-footer, so a page number is ALWAYS present. */
    @bottom-right{
      content:"Page " counter(page);
      font-family:"Inter",system-ui,sans-serif;
      font-size:8pt;
      color:#6b6b6b;
    }
  }

  /* The .page sets its own interior padding for screen; in print the @page margin owns the
     whitespace, so we zero the .page padding and let each section flow on the printed sheet. */
  .page{
    box-shadow:none !important; margin:0; width:auto; min-height:auto;
    padding:0;
    page-break-after:always; break-after:page;
  }
  .page:last-child{ page-break-after:auto; break-after:auto; }
  /* The cover fills its whole sheet and is centered. */
  .page.cover{ min-height:9in; padding:0; }   /* slack vs 9.5in printable so the cover never spills to a blank sheet */
  .cover .meta{ position:static; margin-top:40px; }

  /* HARD RULE — no section/clause/table/sig/notice block may ever split across a page break. */
  .section, .party, .fieldgrid, .sigblock, .sig, .notice, .field, .docitem,
  .cover, table, tr, .field .line, .row{
    page-break-inside:avoid !important; break-inside:avoid !important;
  }
  /* Headings never get orphaned from the content that follows them. */
  .doc-header, h1, h2, h3, .h-doc, .section > h2{
    break-after:avoid !important; page-break-after:avoid !important;
  }
  /* Body copy keeps at least 3 lines together at a page boundary. */
  p,li{ orphans:3; widows:3; }
  /* A section explicitly marked .break starts on the next sheet if it won't fit. */
  .section.break{ break-before:page; page-break-before:always; }

  a{ color:inherit; text-decoration:none; }
}
@media(max-width:900px){.page{width:auto;max-width:96vw;padding:6vw 6vw 5vw}.cover h1{font-size:34px}.fieldgrid,.sigblock{grid-template-columns:1fr}}
