/* Digital form editor */
#editor { position: fixed; inset: 0; z-index: 30; background: var(--surface-2); overflow: auto; }
.edbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); padding: 10px 16px; }
.edbar strong { font-size: 16px; margin-right: 6px; }
.edbar label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); flex: 1 1 260px; }
.edbar input[type=text] { flex: 1; min-width: 120px; min-height: 40px; font: inherit; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.edbar button { font: inherit; font-weight: 650; min-height: 40px; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.edbar button:hover { border-color: var(--brand); }
.edbar button.primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.edbar label.langpick { flex: 0 0 auto; }
.edbar select { font: inherit; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.edbar .seg { display: inline-flex; }
.edbar .seg button { border-radius: 0; }
.edbar .seg button:first-child { border-radius: 999px 0 0 999px; }
.edbar .seg button:last-child { border-radius: 0 999px 999px 0; border-left: 0; }
.edbar .seg button[aria-pressed="true"] { background: var(--soft); color: var(--brand); font-weight: 600; }
#edState { font-size: 14px; color: var(--muted); }
#edPages { padding: 18px 12px 40px; }

.fpage { position: relative; container-type: inline-size; width: 100%; max-width: 900px; margin: 0 auto 18px;
  background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
.fpage.wide { max-width: 1240px; }
.fpage img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.fpage input, .fpage textarea { position: absolute; margin: 0; border: 0; border-radius: 1px; padding: 0 .35em;
  background: rgba(11, 92, 90, .09); color: #0b2a6f; font-family: Arial, Helvetica, sans-serif; line-height: 1.15; }
.fpage input.cell { padding: 0; text-align: center; text-transform: uppercase; }
.fpage textarea { resize: none; padding-top: .15em; overflow: hidden; }
.fpage input[type=checkbox] { padding: 0; accent-color: #0b2a6f; cursor: pointer; }
.fpage input:hover, .fpage textarea:hover { background: rgba(11, 92, 90, .16); }
.fpage input:focus, .fpage textarea:focus { outline: 2px solid #f2b705; outline-offset: 0; background: #fffbe6; }

/* ---- LabourOne.Plus documents ---- */
.doc { background: #fff; max-width: 860px; margin: 0 auto 18px; padding: 34px 44px 30px; box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
  color: #111; font: 15px/1.5 Georgia, "Times New Roman", serif; }
.doc.wide { max-width: 1240px; }
.dochead { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #0d6b68;
  padding-bottom: 6px; font: 600 12px/1.2 "Plus Jakarta Sans", system-ui, "Segoe UI", sans-serif; letter-spacing: .04em; color: #444; }
.brandmark { font-size: 15px; font-weight: 800; color: #0d6b68; letter-spacing: -.01em; }
.brandmark span { color: #b88100; }
.cologo { max-height: 46px; max-width: 220px; display: block; }
.coname { font: 800 16px/1.2 "Plus Jakarta Sans", system-ui, sans-serif; color: #111; letter-spacing: -.01em; }
.dochead:has(.cologo) { align-items: flex-end; }
.doc h1 { font: 700 22px/1.25 "Plus Jakarta Sans", system-ui, "Segoe UI", sans-serif; margin: 16px 0 12px; text-transform: uppercase; letter-spacing: .01em; }
.doc h2 { font: 700 14px/1.3 "Plus Jakarta Sans", system-ui, "Segoe UI", sans-serif; margin: 20px 0 6px; padding-bottom: 3px; border-bottom: 1px solid #c9c9c9; }
.doc p { margin: 7px 0; }
.doc ul { margin: 6px 0; padding-left: 20px; }
.doc li { margin: 3px 0; }
.doc p.row, .doc div.row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; white-space: pre-wrap; }
.doc .in { font: 14px/1.3 Arial, Helvetica, sans-serif; color: #0b2a6f; border: 0; border-bottom: 1px solid #555; border-radius: 0;
  background: rgba(11, 92, 90, .07); padding: 1px 4px; margin: 0 2px; min-width: 0; vertical-align: baseline; }
.doc .in-s, .doc .in-time { width: 5.2em; }
.doc .in-num { width: 7em; }
.doc .in-date { width: 8.5em; }
.doc .in-m { width: 15em; max-width: 100%; }
.doc .in-l { display: block; width: 100%; margin: 3px 0; }
.doc .row .in-l { display: inline-block; flex: 1 1 16em; width: auto; }
.doc .row .in-m { flex: 1 1 9em; max-width: 22em; }
.doc .in:focus, .doc textarea:focus { outline: 2px solid #f2b705; outline-offset: 0; background: #fffbe6; }
.doc .in::placeholder { color: #9aa3ad; font-size: 12px; }
.doc .area { margin: 8px 0; }
.doc .arealabel { font-size: 14px; margin-bottom: 3px; }
.doc textarea { display: block; width: 100%; font: 14px/1.4 Arial, Helvetica, sans-serif; color: #0b2a6f; border: 1px solid #9a9a9a;
  border-radius: 2px; background: rgba(11, 92, 90, .05); padding: 5px 7px; resize: none; overflow: hidden; }
.doc .check { display: flex; gap: 9px; align-items: flex-start; margin: 6px 0; cursor: pointer; }
.doc .check input[type=checkbox] { flex: none; width: 16px; height: 16px; margin: 4px 0 0; accent-color: #0b2a6f; }
.doc .tablewrap { overflow-x: auto; margin: 8px 0; }
.doc table.grid { border-collapse: collapse; width: 100%; table-layout: fixed; font: 13px/1.3 Arial, Helvetica, sans-serif; }
.doc table.grid th { border: 1px solid #555; background: #f0f2f4; padding: 4px 5px; text-align: left; font-weight: 600; font-size: 12px; vertical-align: bottom; }
.doc table.grid td { border: 1px solid #555; padding: 0; vertical-align: top; }
.doc table.grid textarea { border: 0; border-radius: 0; background: transparent; padding: 4px 5px; min-height: 26px; font-size: 13px; }
.doc table.grid textarea:hover { background: rgba(11, 92, 90, .07); }
.doc .signs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 34px; margin: 26px 0 8px; }
.doc .signline { height: 44px; border-bottom: 1px solid #111; }
.doc .signrole { font: 600 12px/1.4 "Plus Jakarta Sans", system-ui, "Segoe UI", sans-serif; margin: 3px 0 4px; }
.doc .sign .row { font-size: 13px; margin: 2px 0; }
.doc .sign .in-m { flex: 1 1 8em; width: auto; }
.doc .docfoot { margin-top: 26px; padding-top: 6px; border-top: 1px solid #c9c9c9; font: 11px/1.4 "Plus Jakarta Sans", system-ui, "Segoe UI", sans-serif; color: #555; }
.tips { font: 14px/1.45 "Plus Jakarta Sans", "Plus Jakarta Sans", system-ui, "Segoe UI", sans-serif; background: #fff6df; color: #4d3600; border: 1px solid #ecd9a3;
  border-radius: 8px; padding: 10px 14px; margin: 4px 0 16px; }
.tips ul { margin: 6px 0 4px; }
.tips.machine { background: #fff1ee; border-color: #f0b8ad; color: #6d1f12; }
.lawrow { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lawchip { background: #fff; color: #0d6b68; border: 1px solid #b9d8d5; border-radius: 999px; padding: 2px 10px;
  font: 600 12px/1.6 "Plus Jakarta Sans", system-ui, "Segoe UI", sans-serif; cursor: pointer; }
.lawchip:hover { background: #e2f3f1; }

/* law text drawer inside the editor */
#edLaw { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 94vw); z-index: 5; background: var(--surface); color: var(--ink);
  border-left: 1px solid var(--line); box-shadow: -4px 0 18px rgba(0, 0, 0, .18); overflow: auto; padding: 14px 18px 30px; }
.edlawhead { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; position: sticky; top: -14px;
  background: var(--surface); padding: 14px 0 8px; margin-top: -14px; }
.edlawhead button { font: inherit; font-weight: 650; min-height: 38px; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; flex: none; }
#edLawBody pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.55 Georgia, "Times New Roman", serif; margin: 10px 0 0; }

@media print {
  body.form-open > :not(#editor) { display: none !important; }
  body.form-open { background: #fff; }
  body.form-open #editor { position: static; overflow: visible; background: #fff; }
  body.form-open .edbar, body.form-open #edLaw, body.form-open .screen-only { display: none !important; }
  body.form-open #edPages { padding: 0; }
  /* page-picture forms */
  body.form-open .fpage { box-shadow: none; margin: 0 auto; max-width: none; width: auto; height: 99.5vh;
    break-after: page; break-inside: avoid; }
  body.form-open .fpage:last-child { break-after: auto; }
  body.form-open .fpage input, body.form-open .fpage textarea { background: transparent; color: #000; }
  /* LabourOne.Plus documents */
  body.form-open .doc { box-shadow: none; margin: 0; max-width: none; padding: 0; font-size: 10.5pt; }
  body.form-open .doc .in, body.form-open .doc textarea { background: transparent; color: #000; }
  body.form-open .doc .in::placeholder { color: transparent; }
  body.form-open .doc textarea { border: 0.6pt solid #777; }
  body.form-open .doc table.grid textarea { border: 0; }
  body.form-open .doc h2 { break-after: avoid; }
  body.form-open .doc .sign, body.form-open .doc .area, body.form-open .doc tr, body.form-open .doc .check { break-inside: avoid; }
  body.form-open .doc thead { display: table-header-group; }
}
