:root{
  --ink:#202832; --head:#354d65; --line:#202832; --muted:#5b6470;
  --accent:#9b1c3c; --bg:#eef0f3; --paper:#fff; --err:#b3261e; --ok:#1e6b3a;
  font-family: Arial, "Noto Sans Hebrew", "Arimo", "Helvetica Neue", sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink)}
body{font-size:16px;line-height:1.5;-webkit-text-size-adjust:100%}
main{max-width:830px;margin:0 auto;padding:16px 10px 40px}
.paper{background:var(--paper);box-shadow:0 1px 4px rgba(0,0,0,.12);border-radius:4px;padding:44px 70px 40px}
.doc-head{text-align:center;margin-bottom:22px}
.logo{display:block;margin:0 auto 18px;width:204px;height:auto}
h1{font-size:24px;margin:0 0 6px;color:#000;font-weight:700}
.sub{font-weight:700;margin:0;font-size:15px}
h2{color:var(--head);font-size:17px;margin:22px 0 6px;font-weight:700}
p{margin:0 0 8px}
.body{font-size:16px;margin-top:14px}
.small{font-size:15px}
.line{display:flex;align-items:flex-end;gap:10px;margin:0 0 12px;flex-wrap:nowrap}
.line.wrap{flex-wrap:wrap}
.lbl{white-space:nowrap;font-size:15px;padding-bottom:4px}
.fixed-val{border-bottom:1px solid var(--line);padding:0 6px 3px;min-width:180px;font-weight:700}
.fill{font:inherit;font-size:16px;color:var(--ink);border:0;border-bottom:1px solid var(--line);background:#f6f8fb;
  padding:4px 6px;border-radius:3px 3px 0 0;outline:none;min-width:0}
.fill:focus{background:#eaf0fb;border-bottom:2px solid var(--head)}
.fill.long{flex:1 1 220px}
.fill.short{flex:0 1 120px;width:120px}
.fill.mid{flex:1 1 200px}
.fill.area{flex:1;resize:vertical;min-height:58px;line-height:1.6}
.comments{align-items:flex-start}.comments .lbl{padding-top:6px}
.invalid{background:#fdecea !important;border-bottom-color:var(--err) !important}
fieldset.health{border:0;padding:0;margin:0 0 10px}
fieldset.health legend{padding:0;margin-bottom:6px}
fieldset.health.invalid{outline:2px solid var(--err);outline-offset:4px;background:transparent !important}
.opt{display:flex;gap:10px;align-items:flex-start;margin:0 0 8px;cursor:pointer;font-size:15px}
.opt input{position:absolute;opacity:0;width:1px;height:1px}
.opt .box{flex:0 0 20px;height:20px;border:1.5px solid var(--ink);margin-top:2px;position:relative;background:#fff}
.opt input:checked + .box::before,.opt input:checked + .box::after{content:"";position:absolute;top:8px;left:1px;width:16px;height:2px;background:var(--ink)}
.opt input:checked + .box::before{transform:rotate(45deg)}
.opt input:checked + .box::after{transform:rotate(-45deg)}
.opt input:focus-visible + .box{outline:2px solid var(--head);outline-offset:2px}
.upload{border:1px dashed #9aa6b4;border-radius:6px;padding:10px 12px;margin:4px 0 14px;background:#fafbfc}
.upload-lbl{font-weight:700;display:block;margin-bottom:6px}
.hint{font-size:14px;color:var(--muted);margin:6px 0 0}
.file-list{margin:6px 0 0;padding:0 18px 0 0;font-size:14px}
.file-list button{font:inherit;font-size:13px;margin-inline-start:8px;background:none;border:0;color:var(--err);text-decoration:underline;cursor:pointer}
.parent{display:flex;gap:18px;align-items:flex-end;flex-wrap:wrap;margin-bottom:6px}
.parent .line{flex:1 1 300px;margin-bottom:12px}
.sig-wrap{display:flex;align-items:flex-end;gap:10px;flex:0 1 300px;margin-bottom:12px}
.sig{position:relative;width:240px;height:96px;border-bottom:1px solid var(--line);background:#f6f8fb;border-radius:3px 3px 0 0;touch-action:none}
.sig canvas{position:absolute;inset:0;width:100%;height:100%;cursor:crosshair}
.sig-ph{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#8a94a0;font-size:13px;pointer-events:none}
.sig.has .sig-ph{display:none}
.sig .clear{position:absolute;bottom:2px;left:2px;font:inherit;font-size:12px;background:#fff;border:1px solid #c5ccd5;border-radius:3px;padding:1px 6px;cursor:pointer}
.sig.invalid{background:#fdecea}
.sign-off{display:flex;flex-direction:column;align-items:center;margin-top:30px;gap:2px;font-size:15px}
.actions{max-width:830px;margin:14px auto 0;background:#fff;border-radius:4px;padding:16px 20px;box-shadow:0 1px 4px rgba(0,0,0,.08)}
.note{font-size:14px;color:var(--muted);margin:0 0 8px}
.msg{min-height:1.5em;font-weight:700;margin:6px 0}
.msg.err{color:var(--err)}.msg.ok{color:var(--ok)}
.btns{display:flex;gap:12px;flex-wrap:wrap;justify-content:flex-start;margin-top:8px}
button.primary,button.secondary{font:inherit;font-size:17px;font-weight:700;border-radius:6px;padding:11px 22px;cursor:pointer;min-height:48px}
button.primary{background:var(--accent);color:#fff;border:0}
button.primary:disabled{opacity:.6;cursor:wait}
button.secondary{background:#fff;color:var(--head);border:1.5px solid var(--head)}
.done{margin-top:16px;text-align:right}
.done h2{font-size:22px;color:var(--ok);margin-top:0}

@media (max-width:640px){
  main{padding:8px 6px 30px}
  .paper{padding:24px 16px 26px}
  h1{font-size:20px}
  .line,.line.wrap{flex-wrap:wrap}
  .line .lbl{flex:0 0 100%;padding-bottom:0}
  .fill.long,.fill.mid,.fill.short{flex:1 1 100%;width:100%}
  .fixed-val{flex:1 1 100%}
  .comments{flex-direction:column;align-items:stretch}
  .sig-wrap{flex:1 1 100%;flex-wrap:wrap}
  .sig-wrap .lbl{flex:0 0 100%}
  .sig{width:100%;height:120px}
  .btns button{flex:1 1 100%}
}

/* תבנית ה-PDF: עמוד A4 ברוחב 794 פיקסלים */
#printRoot{position:fixed;top:0;left:-20000px;width:794px;pointer-events:none}
.pg{width:794px;height:1123px;background:#fff;color:var(--ink);padding:44px 92px 40px;position:relative;overflow:hidden;
  font-family:Arial,"Noto Sans Hebrew","Arimo",sans-serif;direction:rtl}
.pg .logo{width:250px;margin:0 auto 16px}
.pg h1{font-size:23px;text-align:center;margin:0 0 8px;color:#000}
.pg .sub{text-align:center;font-size:14.5px;margin:0 0 18px}
.pg h2{font-size:16px;margin:10px 0 4px}
.pg p{font-size:14.5px;line-height:1.5;margin:0 0 5px}
.pg .pl{display:flex;align-items:flex-end;gap:10px;font-size:14.5px;margin:0 0 10px}
.pg .v{border-bottom:1px solid var(--line);padding:0 6px 2px;min-height:23px;font-weight:700;color:#0b2a6b}
.pg .v.grow{flex:1}
.pg .chk{display:flex;gap:9px;align-items:flex-start;font-size:14.5px;line-height:1.45;margin:0 0 5px}
.pg .chk .b{flex:0 0 15px;height:15px;border:1.3px solid var(--ink);margin-top:2px;position:relative;font-size:14px;line-height:13px;text-align:center;font-weight:700;color:#0b2a6b}
.pg .cm{flex:1;border-bottom:1px solid var(--line);min-height:50px;max-height:50px;overflow:hidden;font-size:14px;line-height:25px;font-weight:700;color:#0b2a6b;white-space:pre-wrap;word-break:break-word}
.pg .sg{display:flex;align-items:flex-end;gap:10px;font-size:14.5px;margin:0 0 4px}
.pg .sgimg{width:170px;height:48px;border-bottom:1px solid var(--line);display:flex;align-items:flex-end;justify-content:center;padding-bottom:1px}
.pg .sgimg img{max-width:166px;max-height:46px}
.pg .so{text-align:center;font-weight:700;font-size:14.5px;line-height:1.5;margin-top:12px}
.pg .meta{position:absolute;bottom:16px;right:92px;left:92px;border-top:1px solid #c9ced6;padding-top:4px;font-size:10.5px;color:#5b6470;display:flex;justify-content:space-between;gap:10px}
.pg .appx{font-size:15px;line-height:1.7;white-space:pre-wrap;word-break:break-word}
