/* L7S HERO — "THE LEAGUE OF 7" P.A.C.T.S™ Document Shell stylesheet (shared, print-optimized)
   Brand: heroic comic — red #cf1124/#e0182b · gold #9a6f12/#c79a3a · ink #15110b · cream paper #fffdf8
   Same legal entity: L7S, INC. · The League of 7
   FONTS via Google Fonts <link> in the HTML: Bebas Neue (display) · Fraunces italic (accent) · Hanken Grotesk (body)
   Use these classes only, so every doc shell stays consistent. */

:root{
  --red:#cf1124; --red-dk:#e0182b; --ink:#15110b; --ink-soft:#3a322470; --mut:#7a6f5c;
  --gold:#9a6f12; --gold-hi:#c79a3a; --line:#ddd3c0; --paper:#fffdf8; --wash:#fbf6ec;
  --serif:"Fraunces",Georgia,"Times New Roman",serif;
  --display:"Bebas Neue",sans-serif;
  --sans:"Hanken Grotesk",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
}
/* keep ink-soft a real readable tone (override the alpha placeholder above) */
:root{ --ink-soft:#3a3224; }
*{box-sizing:border-box}
html,body{margin:0;padding:0;color:var(--ink);font-family:var(--sans);-webkit-font-smoothing:antialiased}
/* SURROUND — cream by default with a subtle comic HALFTONE dot texture; only the body background changes (the .page surfaces stay cream paper) */
body{
  background:
    radial-gradient(circle at 1px 1px, rgba(21,17,11,.05) 1px, transparent 1.6px) 0 0 / 9px 9px,
    radial-gradient(circle at 1px 1px, rgba(207,17,36,.035) 1px, transparent 1.6px) 4px 4px / 9px 9px,
    #f4efe6;
}
html[data-theme="dark"] body{
  background:
    radial-gradient(circle at 1px 1px, rgba(230,196,99,.05) 1px, transparent 1.6px) 0 0 / 9px 9px,
    radial-gradient(circle at 1px 1px, rgba(255,47,68,.045) 1px, transparent 1.6px) 4px 4px / 9px 9px,
    #0b0907;
}
/* COMMAND CONSOLE (dark) theme tokens */
html[data-theme="dark"]{
  --paper:#16110b; --ink:#f6f1e6; --ink-soft:#d9d0bf; --mut:#a59a85;
  --red:#ff2f44; --red-dk:#ff2f44; --gold:#e6c463; --gold-hi:#e6c463; --line:#2b2317; --wash:#1d1610;
}

.toolbar{position:sticky;top:0;z-index:50;background:#15110b;color:#f6f1e6;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:800;letter-spacing:.02em}
.toolbar .btn{font-family:var(--sans);font-weight:800;font-size:13px;border:1px solid #3a3020;color:#f6f1e6;background:#241c12;border-radius:8px;padding:8px 14px;cursor:pointer;text-decoration:none}
.toolbar .btn.print{background:linear-gradient(135deg,#e0182b,#cf1124);border-color:transparent;color:#fff}
.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 #3a3020;color:#f6f1e6;background:#241c12;border-radius:8px;padding:0;cursor:pointer;vertical-align:middle}
.toolbar .theme-toggle:hover{background:#3a3020}

/* 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(21,17,11,.40);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:3px solid var(--ink);padding-bottom:10px;margin-bottom:26px}
.doc-header .lhh{display:flex;align-items:center;gap:10px}
.doc-header .logo{width:32px;height:32px;border-radius:7px;display:block}
.doc-header .org{font-family:var(--display);font-weight:400;font-size:22px;letter-spacing:.02em;line-height:.9}
.doc-header .org small{display:block;font-family:var(--sans);font-weight:700;color:var(--red);font-size:9.5px;letter-spacing:.14em;margin-top:3px;text-transform:uppercase}
.doc-header .tag{font-family:var(--sans);font-size:10px;font-weight:800;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 — bold heroic command panel */
.cover{justify-content:center;text-align:center;background:radial-gradient(120% 90% at 50% 0%,#1c130b 0%,#120c06 55%,#0b0907 100%);color:#fff7e9}
.cover::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 1px 1px, rgba(230,196,99,.07) 1px, transparent 1.6px) 0 0 / 11px 11px;pointer-events:none}
.cover > *{position:relative;z-index:1}
.cover .emblem{width:150px;height:auto;margin:0 auto 26px;filter:drop-shadow(0 12px 34px rgba(207,17,36,.45)) drop-shadow(0 0 18px rgba(230,196,99,.35))}
.cover .kicker{font-family:var(--sans);font-size:12px;font-weight:800;letter-spacing:.24em;text-transform:uppercase;color:var(--gold-hi)}
.cover h1{font-family:var(--display);font-weight:400;font-size:74px;line-height:.92;letter-spacing:.015em;margin:18px 0 12px;color:#fff;text-shadow:0 2px 0 rgba(207,17,36,.55),0 0 26px rgba(0,0,0,.5)}
.cover .sub{font-family:var(--serif);font-style:italic;color:#e9dcc6;font-size:16px;max-width:80%;margin:0 auto;line-height:1.5}
.cover .rule{width:84px;height:4px;background:linear-gradient(90deg,var(--red-dk),var(--gold-hi),var(--gold));margin:28px auto;border-radius:2px}
.cover .parties{font-family:var(--sans);font-size:13.5px;color:#f0e7d6;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:#a59a85;font-size:11px;letter-spacing:.06em;z-index:1}

/* Document title (interior) */
.h-doc{font-family:var(--display);font-weight:400;font-size:38px;letter-spacing:.012em;line-height:.95;margin:0 0 6px;color:var(--ink)}
.doc-lead{font-family:var(--serif);font-style:italic;color:var(--mut);font-size:13px;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.65;font-size:13px;color:var(--ink-soft);font-family:var(--sans);break-inside:avoid;page-break-inside:avoid}
.section > h2{font-family:var(--display);font-weight:400;font-size:21px;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:800;color:var(--ink);font-size:10.5px;letter-spacing:.06em;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;color:var(--ink)}
.field input:focus{border-color:var(--red)}

/* Party / notice boxes */
.party{background:var(--wash);border:1px solid var(--line);border-left:4px 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:var(--paper);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:.06em;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:800;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:#15110b; --ink-soft:#3a3224; --mut:#7a6f5c; --line:#ddd3c0; --paper:#fffdf8; --wash:#fbf6ec; }
  html[data-theme="dark"] body{ color:#15110b !important; }
  html[data-theme="dark"] .page:not(.cover){ background:#fffdf8 !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}}
