/* exgen.css — worksheet & exam generator */
.xg-form .field>label{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.xg-mini{border:1.5px solid #cfe3e3;background:#fff;color:#0f766e;border-radius:999px;padding:0 12px;font-size:.78rem;font-family:var(--fh);font-weight:700;min-height:34px;line-height:1.2}
.xg-form{grid-template-columns:minmax(0,1fr)}
.xg-units-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(240px,100%),1fr));gap:8px}
.xg-units-list .xg-u{display:flex;margin:0;font-family:var(--fb);font-weight:600;align-items:center;gap:10px;border:2px solid #d8ecec;background:#fff;border-radius:14px;padding:8px 12px;cursor:pointer;line-height:1.4;min-height:52px;font-size:.98rem}
.xg-units-list .xg-u input{width:22px;height:22px;flex:0 0 auto;accent-color:#0f766e}
.xg-units-list .xg-u.xg-on{border-color:#0f766e;background:#f0fdfa}
.chip.xg-off{opacity:.38;text-decoration:line-through}
.xg-step{display:flex;align-items:center;gap:8px}
.xg-step button{width:52px;height:52px;border-radius:50%;border:0;background:#0f766e;color:#fff;font-size:1.6rem;font-weight:800;line-height:1}
.xg-step input{width:90px;text-align:center;font-size:1.3rem;font-weight:800}
.xg-det{margin-top:6px;border:2px dashed #d8ecec;border-radius:16px;padding:8px 14px;background:#fff}
.xg-det summary{font-family:var(--fh);font-weight:700;cursor:pointer;padding:6px 0}
.xg-chk{display:flex;align-items:center;gap:10px;margin:8px 0;font-weight:600;line-height:1.5}
.xg-chk input{flex:0 0 auto}
.xg-chk input{width:24px;height:24px;accent-color:#0f766e}
.xg-bar{position:sticky;top:0;z-index:30;display:flex;flex-wrap:wrap;gap:8px;align-items:center;background:rgba(255,248,239,.96);padding:10px 4px;margin-top:14px;border-bottom:2px solid #f3e3cc}
.xg-bar .btn.or{background:#ea580c;box-shadow:0 5px 0 #b8460a}
.xg-bar .btn:not(.ghost):not(.or){background:#0f766e;box-shadow:0 5px 0 #0b5953}
.xg-status{font-weight:700;color:#0f766e;font-size:.95rem}
.xg-hint{margin:6px 2px}
.xg-prev{position:relative;overflow:hidden;width:100%}
.xg-scale{transform-origin:top right;position:absolute;top:0;right:0}
html[dir=ltr] .xg-scale{transform-origin:top left;right:auto;left:0}
.xg-selbar{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);z-index:60;display:flex;gap:8px;align-items:center;background:#fff;border:3px solid #ea580c;border-radius:18px;padding:8px 12px;box-shadow:0 8px 28px rgba(0,0,0,.25);width:max-content;max-width:calc(100vw - 16px);flex-wrap:wrap;justify-content:center}
.xg-selbar.hide{display:none}
.xg-selbar b{font-family:var(--fh);color:#ea580c;padding:0 6px}
/* ---- the A4 sheet ---- */
.xg-page{width:794px;height:1123px;background:#fff;color:#111827;position:relative;margin:0 0 18px;padding:40px 45px 62px;box-shadow:0 4px 18px rgba(0,0,0,.18);font-family:var(--fb);font-size:16px;line-height:1.75;overflow:hidden;direction:rtl;text-align:right}
html[lang=he] .xg-page{direction:rtl}
.xg-meas{position:absolute;visibility:hidden;left:0;top:0;height:auto;box-shadow:none}
.xg-body{height:100%}
.xg-foot{position:absolute;left:45px;right:45px;bottom:20px;border-top:2px solid #0f766e;padding-top:4px;display:flex;justify-content:space-between;font-size:12px;color:#0f766e;font-weight:700;font-family:var(--fh)}
.xg-block{padding:0}
.xg-meta{display:flex;justify-content:space-between;font-size:13px;color:#0f766e;margin:0 2px 4px}
.xg-hbox{display:grid;grid-template-columns:1fr auto;gap:14px;align-items:center;border:3px solid #0f766e;border-radius:14px;padding:8px 14px;background:linear-gradient(90deg,#f0fdfa,#fff7ed)}
.xg-kick{font-size:13px;color:#0f766e;font-weight:700;font-family:var(--fh)}
.xg-title{font-family:var(--fh);font-weight:800;font-size:22px;color:#0f766e;line-height:1.45}
.xg-units{font-size:12.5px;color:#4b5563;line-height:1.5}
.xg-fields{font-size:14px;display:grid;gap:3px;white-space:nowrap}
.xg-f2{display:flex;gap:12px}
.xg-markrow{font-weight:800;color:#0f766e}
.xg-line{display:inline-block;min-width:150px;border-bottom:1.5px dotted #374151;height:1.1em;vertical-align:bottom}
.xg-line.sm{min-width:62px}
.xg-info{display:flex;justify-content:center;gap:26px;font-weight:800;color:#0f766e;font-size:14px;margin-top:6px;font-family:var(--fh)}
.xg-ver{color:#ea580c}
.xg-instr{margin:8px 0 4px;border-inline-start:5px solid #ea580c;background:#fff7ed;border-radius:8px;padding:5px 12px;font-size:14.5px;color:#9a3412;font-weight:700}
.xg-sec{margin-top:12px;padding:4px 10px;background:#f0fdfa;border-radius:8px;color:#0f766e;font-family:var(--fh);font-size:15px;font-weight:700;line-height:1.6}
.xg-sec .xg-pts{color:#6b7280;font-weight:600}
.xg-row{display:grid;grid-template-columns:1fr;gap:0 26px}
.xg-row.c2{grid-template-columns:1fr 1fr}
.xg-row.c3{grid-template-columns:1fr 1fr 1fr}
.xg-q{display:flex;gap:8px;align-items:flex-start;padding:7px 4px 8px;border-bottom:1px solid #e5e7eb;border-radius:6px;cursor:pointer}
.xg-q.sel{outline:3px solid #ea580c;background:#fff7ed}
.xg-n{flex:0 0 auto;width:26px;height:26px;border-radius:50%;background:#ea580c;color:#fff;font-weight:800;display:flex;align-items:center;justify-content:center;font-size:13px;font-family:'Noto Sans',Arial,sans-serif;margin-top:3px;line-height:1}
.xg-qb{flex:1;min-width:0}
.xg-stem .m{font-size:1.06em}
.xg-pts{color:#6b7280;font-size:13px;font-weight:600;white-space:nowrap}
.xg-ptsf{float:left;margin:2px 10px 0 0}
html[dir=ltr] .xg-ptsf{float:right}
.xg-q .qsvg{display:block;max-height:150px;max-width:100%;width:auto;height:auto;margin:4px auto}
.xg-q .picrow{margin:4px 0;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px 10px}
.xg-q .picrow .qsvg{margin:0;display:inline-block}
.xg-v .xg-qb{text-align:center}
.xg-v .vert{font-size:1.35em;margin:4px auto}
.xg-v .xg-stem{font-size:14px}
.xg-q .qbox{width:2.6em;height:1.6em;border:2px solid #ea580c;border-radius:6px}
.xg-ans{margin-top:4px;font-size:15px}
.xg-work{margin-top:4px;height:58px;font-size:13px;color:#6b7280;background:repeating-linear-gradient(to bottom,transparent 0 27px,#d1d5db 27px 28px)}
.xg-mc{display:flex;flex-wrap:wrap;gap:4px 26px;margin-top:4px}
.xg-let{color:#0f766e;font-weight:800;font-family:var(--fh)}
.xg-let::after{content:')'}
.xg-tf{display:flex;flex-wrap:wrap;gap:4px 22px;margin-top:4px;align-items:center}
.xg-tfb{font-weight:700}
.xg-sq{display:inline-block;width:18px;height:18px;border:2px solid #374151;border-radius:3px;vertical-align:middle}
.xg-keyh{font-family:var(--fh);font-weight:800;color:#0f766e;font-size:19px;border-bottom:3px solid #0f766e;margin-bottom:8px;padding-bottom:4px}
.xg-krow{display:grid;grid-template-columns:1fr 1fr;gap:0 26px}
.xg-k{display:flex;gap:8px;align-items:center;padding:5px 0;border-bottom:1px dashed #e5e7eb;font-size:15px;color:#9a3412}
.xg-k .vert{font-size:1em}
.xg-kp{color:#6b7280;font-size:12px}
/* print: the sheet goes through #printArea (print.css hides everything else; @page has 10mm margins) */
@media print{
  #printArea .xg-page{zoom:.9;box-shadow:none;margin:0;break-after:page;page-break-after:always}
  #printArea .xg-page:last-child{break-after:auto;page-break-after:auto}
  #printArea .xg-q.sel{outline:0;background:none}
}

.xg-form .grid2,.xg-det .grid2{grid-template-columns:minmax(0,1fr)}
@media(min-width:760px){.xg-form .grid2,.xg-det .grid2{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
.xg-form input{max-width:100%;box-sizing:border-box}
.xg-det{min-width:0}

@media(max-width:560px){
  .xg-bar{gap:6px;padding:8px 0;position:static}
  .xg-bar .btn.sm{min-height:40px;padding:0 11px;font-size:.84rem}
  .xg-selbar .btn.sm{min-height:40px;padding:0 12px;font-size:.86rem}
}

.xg-hbox.has-logo{grid-template-columns:auto 1fr auto}
.xg-logo{display:block;max-height:86px;max-width:120px;width:auto;height:auto;object-fit:contain}
.xg-logorow{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.xg-logoprev img{display:block;max-height:64px;max-width:140px;border:2px solid #d8ecec;border-radius:10px;background:#fff;padding:4px}
.xg-logoprev.hide{display:none}
.xg-filebtn{position:relative;overflow:hidden;cursor:pointer;margin:0}
.field .xg-filebtn{display:inline-flex;margin:0;font-size:.92rem}
.xg-filebtn input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%}
.xg-logof small{display:block;margin-top:6px;font-size:.82rem;line-height:1.5}
