.app { min-height: 100vh; display: flex; flex-direction: column; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* القائمة العلوية العائمة */
.topbar {
  position: sticky; top: 10px; z-index: 60;
  margin: 14px 24px 0; padding: 7px 8px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--teal); color: var(--sand); border-radius: 22px;
  box-shadow: 0 14px 30px -12px rgba(14, 77, 82, .55);
}
.topbar .brand { display: flex; align-items: center; gap: 9px; padding: 0 8px 0 12px; }
.brand-title { font-size: 1.02rem; font-weight: 700; white-space: nowrap; }
.modes { display: flex; gap: 2px; flex-wrap: wrap; }
.modes button {
  display: flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--sand);
  padding: 8px 14px; border-radius: 15px; font-size: .9rem; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.modes button svg { width: 17px; height: 17px; color: #9CC3BD; }
.modes button:hover { background: rgba(243, 233, 215, .12); color: #fff; }
.modes button.on { background: var(--sand); color: var(--teal); font-weight: 700; }
.modes button.on svg { color: var(--saffron-2); }
.modes button:focus-visible { outline: 2px solid var(--saffron); outline-offset: 1px; }
.local-pill { margin-inline-start: auto; display: flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 14px; font-size: .78rem; background: rgba(243, 233, 215, .1); border: 1px solid rgba(243, 233, 215, .18); }
.local-pill i { width: 7px; height: 7px; background: var(--saffron); transform: rotate(45deg); }

main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 26px 28px 24px; flex: 1; }
.page-head { margin-bottom: 20px; }
.page-title { font-weight: 700; font-size: 1.85rem; line-height: 1.3; color: var(--teal-3); letter-spacing: -.3px; margin: 4px 0 2px; }
.page-desc { color: var(--muted); margin: 0; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } .topbar { margin: 10px 12px 0; } main { padding: 20px 14px; } }

/* منطقة الإفلات */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px dashed var(--sand-4); border-radius: 26px; background: var(--sand-2);
  padding: 38px 16px; cursor: pointer; text-align: center; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--teal-2); background: #fff; }
.drop-ico { width: 54px; height: 54px; border-radius: 16px; background: var(--teal); color: var(--sand); display: grid; place-items: center; margin-bottom: 8px; transform: rotate(45deg); }
.drop-ico svg { width: 24px; height: 24px; transform: rotate(-45deg); color: var(--saffron); }
.drop .big { font-weight: 600; font-size: 1.05rem; color: var(--teal-3); }
.drop .sub { color: var(--muted); font-size: .85rem; }

/* قائمة الملفات */
.list-head { display: flex; align-items: baseline; gap: 10px; margin: 20px 4px 10px; }
.list-head b { color: var(--teal-3); font-weight: 600; }
.list-head span { color: var(--muted); font-size: .85rem; }
.link { margin-inline-start: auto; border: 0; background: none; color: var(--dl); cursor: pointer; font-size: .85rem; padding: 2px 6px; border-radius: 8px; }
.link:hover { background: var(--dl-soft); }
.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.item { position: relative; background: #fff; border: 1px solid var(--sand-3); border-radius: 20px; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-width: 0; box-shadow: var(--shadow-sm); }
.item .num { position: absolute; top: 14px; inset-inline-start: 14px; z-index: 1; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 8px; background: var(--teal); color: var(--sand); font-size: .75rem; font-weight: 600; display: grid; place-items: center; }
.thumb { height: 150px; border-radius: 14px; background: var(--sand-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb img { max-width: 92%; max-height: 92%; box-shadow: 0 2px 8px rgba(60, 40, 10, .18); transition: transform .15s; }
.thumb .ph { color: var(--muted-2); font-size: .8rem; }
.meta { font-size: .8rem; line-height: 1.45; min-width: 0; padding: 0 4px; }
.meta b { unicode-bidi: plaintext; text-align: right; display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta span { color: var(--muted); }
.tools { display: flex; gap: 4px; }
.tools button { flex: 1; border: 1px solid var(--sand-3); background: var(--sand-2); color: var(--teal); border-radius: 10px; padding: 3px 0; cursor: pointer; font-size: .9rem; }
.tools button:hover { border-color: var(--teal-2); background: var(--teal-soft); }
.tools button[data-a=del]:hover { border-color: var(--dl-line); background: var(--dl-soft); color: var(--dl); }
.tools button:disabled { opacity: .35; cursor: default; background: var(--sand-2); border-color: var(--sand-3); color: var(--teal); }

/* الإعدادات */
.side { position: sticky; top: 84px; }
.opts { padding: 18px; }
.opt { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--sand-3); }
.opt.row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.opt label { font-weight: 500; color: var(--teal-3); font-size: .9rem; }
.opt label small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; }
.opt select, .opt input[type=text] { width: 100%; }
.limit-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.limit-box .seg button { padding: 5px 13px; }
.limit-box .num { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; }
.limit-box input { width: 74px; text-align: center; }
.run { width: 100%; margin-top: 16px; padding: 12px; font-size: 1rem; border-radius: 16px; }
.bar { height: 8px; background: var(--sand-3); border-radius: 6px; overflow: hidden; margin-top: 12px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal-2), var(--saffron)); border-radius: 6px; transition: width .2s; }
.status { color: var(--muted); font-size: .85rem; margin-top: 8px; min-height: 1.4em; text-align: center; }
.status.err { color: var(--dl); }

/* النتائج */
.results { margin-top: 20px; padding: 18px; }
.rhead { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.rhead > h2 { margin-inline-end: auto; }
.rhead .btn { padding: 7px 14px; }
.card-title .ico.ok { background: var(--palm-soft); color: var(--palm); border-color: var(--palm-line); }
.rsum { font-size: 1.15rem; font-weight: 700; color: var(--teal); margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.rsum small { font-size: .85rem; font-weight: 500; color: var(--palm); background: var(--palm-soft); border: 1px solid var(--palm-line); border-radius: 10px; padding: 1px 9px; margin-inline-start: 8px; }
.w { background: var(--saffron-soft); color: #7A4D05; border: 1px solid var(--gold-line); border-radius: 12px; padding: 7px 12px; margin: 8px 0; font-size: .85rem; }
.r { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--sand-3); }
.r:first-child { margin-top: 6px; }
.r .n { unicode-bidi: plaintext; text-align: right; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.r .s { color: var(--muted); font-size: .82rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.r .tag { font-size: .74rem; border-radius: 10px; padding: 1px 9px; white-space: nowrap; border: 1px solid; }
.r .tag.ok { background: var(--palm-soft); color: var(--palm); border-color: var(--palm-line); }
.r .tag.over { background: var(--dl-soft); color: var(--dl); border-color: var(--dl-line); }
.r a { color: var(--teal); font-weight: 600; text-decoration: none; border: 1px solid var(--teal); border-radius: 12px; padding: 4px 14px; white-space: nowrap; font-size: .85rem; }
.r a:hover { background: var(--teal); color: var(--sand); }
.num-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; }
.num-row input { width: 64px; text-align: center; }

/* الحاسبة */
.calc { margin-top: 16px; padding: 14px 18px; }
.calc-grid { max-width: 420px; }
.calc-head { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); }
.calc-head span:first-child { font-weight: 600; color: var(--teal-3); }
.calc-state { font-size: .75rem; color: var(--saffron-2); }
.calc-main { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.calc-main b { font-size: 1.6rem; font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }
.calc-main span { font-size: .8rem; color: var(--muted); }
.calc-main span small { color: var(--palm); font-weight: 600; }
.calc-meter { position: relative; height: 8px; background: var(--sand-3); border-radius: 6px; margin: 8px 0 4px; overflow: visible; }
.calc-meter i { position: absolute; inset-block: 0; right: 0; width: 0; border-radius: 6px; background: var(--palm); transition: width .25s, background .2s; }
.calc-meter.over i { background: var(--dl); }
.calc-limit { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--teal-3); border-radius: 2px; }
.calc-verdict { font-size: .8rem; font-weight: 600; color: var(--palm); }
.calc-verdict.over { color: var(--dl); }
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.calc-grid button { border: 1px solid var(--sand-3); background: #fff; border-radius: 12px; padding: 5px 4px; cursor: pointer; text-align: center; line-height: 1.35; }
.calc-grid button small { display: block; font-size: .72rem; color: var(--muted); }
.calc-grid button b { font-size: .88rem; font-weight: 600; color: var(--teal-3); font-variant-numeric: tabular-nums; }
.calc-grid button.on { background: var(--teal); border-color: var(--teal); }
.calc-grid button.on small { color: #B9CFCB; } .calc-grid button.on b { color: var(--sand); }
.calc-grid button:hover:not(.on) { border-color: var(--teal-2); }
.calc-note { font-size: .74rem; color: var(--muted-2); margin-top: 8px; line-height: 1.5; }
.calc-note button { border: 0; background: none; color: var(--teal-2); font-weight: 600; cursor: pointer; padding: 0; font-size: inherit; text-decoration: underline; }

/* متابعة بالنتيجة */
.next { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; padding: 10px 12px; background: var(--sand-2); border: 1px dashed var(--sand-4); border-radius: 14px; }
.next > span { font-size: .82rem; color: var(--muted); margin-inline-end: 4px; }
.next button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--teal); background: #fff; color: var(--teal); border-radius: 11px; padding: 4px 12px; font-weight: 500; font-size: .85rem; cursor: pointer; }
.next button svg { width: 15px; height: 15px; }
.next button:hover { background: var(--teal); color: var(--sand); }
.limit-box .seg button.nolim { padding: 5px 10px; }
.limit-box { flex-wrap: wrap; }

/* عائلة الإضافات */
.family { width: 100%; max-width: 1240px; margin: 0 auto; padding: 4px 28px 8px; }
.fam-head { margin: 0 4px 10px; }
.fam-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .fam-grid { grid-template-columns: 1fr; } .family { padding: 4px 14px 8px; } }
.fam { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 22px; background: var(--teal); color: var(--sand); text-decoration: none; box-shadow: 0 14px 30px -18px rgba(14, 77, 82, .7); transition: transform .15s, box-shadow .15s; }
.fam::after { content: ""; position: absolute; top: -34px; inset-inline-end: -34px; width: 100px; height: 100px; transform: rotate(45deg); border: 12px solid rgba(227, 160, 43, .22); border-radius: 16px; pointer-events: none; }
.fam:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -16px rgba(14, 77, 82, .75); }
.fam img { border-radius: 13px; flex: none; }
.fam div { flex: 1; min-width: 0; }
.fam b { display: block; font-weight: 700; font-size: 1rem; }
.fam small { display: block; color: #B9CFCB; font-size: .78rem; line-height: 1.6; margin-top: 2px; }
.fam .get { flex: none; background: var(--saffron); color: var(--teal-3); font-weight: 600; font-size: .82rem; border-radius: 12px; padding: 8px 14px; white-space: nowrap; position: relative; z-index: 1; }
.fam:hover .get { background: var(--saffron-2); color: #fff; }
.made { text-align: center; color: var(--muted); font-size: .82rem; padding: 0 0 22px; margin-top: -10px; }
.made .heart { color: var(--dl); }

/* الترتيب بالسحب */
.item[draggable=true] { cursor: grab; }
.item[draggable=true]:active { cursor: grabbing; }
.item.dragging { opacity: .35; transform: scale(.97); }
.item.mark-before, .item.mark-after { position: relative; }
.item.mark-before::before, .item.mark-after::before { content: ""; position: absolute; top: 6px; bottom: 6px; width: 4px; border-radius: 4px; background: var(--saffron); box-shadow: 0 0 0 3px var(--saffron-soft); z-index: 2; }
.item.mark-before::before { right: -9px; }
.item.mark-after::before { left: -9px; }
.item img { pointer-events: none; -webkit-user-drag: none; }
.drag-hint { font-size: .78rem; color: var(--muted-2); }
.drag-hint::before { content: "⇄ "; color: var(--saffron-2); }

/* ===== أدوات الصفحات ===== */
.seg.wide { display: flex; gap: 4px; }
.seg.wide button { flex: 1; padding: 6px 8px; }
.muted { color: var(--muted); font-size: .76rem; }
.num-sample { background: #fff; border: 1px solid var(--sand-3); border-radius: 12px; padding: 8px; text-align: center; font-size: 1.15rem; color: #000; }
.ws { margin-top: 16px; padding: 16px 18px; }
.ws-empty { color: var(--muted); text-align: center; padding: 26px 10px; font-size: .9rem; }
.ws-loading { color: var(--saffron-2); font-size: .82rem; margin: 6px 0; }
.ws-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ws-bar b { color: var(--teal-3); font-weight: 600; margin-inline-end: auto; }
.ws-btn { border: 1px solid var(--sand-3); background: var(--sand-2); color: var(--teal); border-radius: 11px; padding: 5px 12px; cursor: pointer; font-size: .82rem; font-weight: 500; }
.ws-btn:hover { border-color: var(--teal-2); background: var(--teal-soft); }
.ws-tip { color: var(--muted-2); font-size: .78rem; margin: 6px 0 10px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.pcard { position: relative; background: var(--sand-2); border: 1px solid var(--sand-3); border-radius: 16px; padding: 8px; cursor: grab; display: flex; flex-direction: column; gap: 6px; }
.pcard:active { cursor: grabbing; }
.pcard.dragging { opacity: .35; }
.pthumb { height: 150px; display: grid; place-items: center; overflow: hidden; }
.pthumb img { max-width: 92%; max-height: 92%; box-shadow: 0 2px 8px rgba(60,40,10,.2); background: #fff; transition: transform .15s; pointer-events: none; }
.pnum { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 1; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 8px; background: var(--teal); color: var(--sand); font-size: .75rem; font-weight: 600; display: grid; place-items: center; }
.porig { color: var(--saffron-2); font-size: .72rem; text-align: center; min-height: 1em; }
.ptools { display: flex; gap: 4px; }
.ptools button { flex: 1; border: 1px solid var(--sand-3); background: #fff; color: var(--teal); border-radius: 9px; padding: 2px 0; cursor: pointer; }
.ptools button:hover { border-color: var(--teal-2); background: var(--teal-soft); }
.ptools button.del:hover { border-color: var(--dl-line); background: var(--dl-soft); color: var(--dl); }
.pcard.mark-before::before, .pcard.mark-after::before { content: ""; position: absolute; top: 6px; bottom: 6px; width: 4px; border-radius: 4px; background: var(--saffron); box-shadow: 0 0 0 3px var(--saffron-soft); z-index: 2; }
.pcard.mark-before::before { right: -9px; } .pcard.mark-after::before { left: -9px; }

/* خانة التوقيع */
.sig-slot { background: var(--sand-2); border: 1px solid var(--sand-3); border-radius: 18px; padding: 12px 14px; margin-bottom: 14px; }
.sig-head { display: flex; align-items: baseline; gap: 10px; }
.sig-head b { color: var(--teal-3); font-weight: 700; }
.sig-head small { color: var(--muted); font-size: .76rem; }
.sig-body { display: flex; gap: 14px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.sig-prev { position: relative; overflow: hidden; width: 240px; height: 96px; border-radius: 14px; border: 1px dashed var(--sand-4); display: grid; place-items: center; background-color: #fff;
  background-image: linear-gradient(45deg, #f4efe4 25%, transparent 25%), linear-gradient(-45deg, #f4efe4 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f4efe4 75%), linear-gradient(-45deg, transparent 75%, #f4efe4 75%);
  background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0; }
.sig-prev img { position: absolute; inset: 7% 4%; width: 92%; height: 86%; max-width: none; object-fit: contain; }
.sig-prev.empty span { color: var(--muted-2); font-size: .82rem; background: #fff; padding: 2px 8px; border-radius: 8px; }
.sig-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; min-width: 240px; }
.sig-acts .btn { padding: 7px 14px; font-size: .86rem; }
.sig-acts small { flex-basis: 100%; }
.btn.ghost-del { border-color: var(--dl-line); color: var(--dl); }
.btn.ghost-del:hover { background: var(--dl-soft) !important; }

/* لوحة رسم التوقيع */
.pad-ov { position: fixed; inset: 0; z-index: 100; background: rgba(11,59,63,.4); display: grid; place-items: center; padding: 16px; }
.pad { width: 720px; max-width: 100%; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pad-title { color: var(--teal-3); font-size: 1.05rem; }
.pad-cv { width: 100%; aspect-ratio: 1200 / 450; background: #fff; border: 1px solid var(--sand-3); border-radius: 14px; touch-action: none; cursor: crosshair;
  background-image: linear-gradient(to top, transparent 74%, var(--sand-3) 74%, var(--sand-3) calc(74% + 1px), transparent calc(74% + 1px)); }
.pad-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pad-row.end { justify-content: flex-start; }

/* معاينة التوقيع والترقيم */
.sprev-row { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.sprev { width: min(360px, 100%); }
.sprev.small { width: min(230px, 100%); }
.sprev-label { font-size: .8rem; color: var(--muted); margin-bottom: 6px; text-align: center; }
.stage { position: relative; width: 100%; background: #fff; box-shadow: 0 6px 18px -8px rgba(60,40,10,.35); border: 1px solid var(--sand-3); overflow: visible; }
.stage-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }

.numlab { position: absolute; bottom: 2.2%; color: #000; white-space: nowrap; line-height: 1.4; }
.numlab.center { left: 50%; transform: translateX(-50%); }
.numlab.left { left: 4.7%; } .numlab.right { right: 4.7%; }
.numlab.muted-lab { color: var(--muted-2); font-size: .72rem; background: var(--sand-2); padding: 0 6px; border-radius: 6px; }

/* التوقيعان */
.sig-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 760px) { .sig-slots { grid-template-columns: 1fr; } }
.sig-slots .sig-slot { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sig-slots .sig-prev { width: 100%; height: 110px; }
.sig-slots .sig-acts { min-width: 0; flex: none; }
.sig-note { grid-column: 1 / -1; }
.fav-row { display: flex; gap: 6px; }
.fav-row .btn { flex: 1; padding: 6px 8px; font-size: .82rem; }

/* التوقيع في المعاينة: سحب + مقابض تكبير */
.sigbox { position: absolute; cursor: move; touch-action: none; user-select: none; outline: 1.5px dashed var(--saffron); outline-offset: 2px; border-radius: 3px; }
.sigbox img { display: block; width: 100%; height: auto; pointer-events: none; }
.sigbox:hover, .sigbox.active { background: rgba(227,160,43,.1); }
.sigbox .hdl { position: absolute; width: 11px; height: 11px; background: #fff; border: 2px solid var(--saffron-2); border-radius: 3px; }
.sigbox .hdl.nw { top: -7px; left: -7px; cursor: nwse-resize; } .sigbox .hdl.se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.sigbox .hdl.ne { top: -7px; right: -7px; cursor: nesw-resize; } .sigbox .hdl.sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.sigbox .sig-size { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); background: var(--teal); color: var(--sand); font-size: 10.5px; padding: 0 6px; border-radius: 6px; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.sigbox:hover .sig-size, .sigbox.active .sig-size { opacity: 1; }
.nosig { position: absolute; inset: auto 0 8% 0; text-align: center; color: var(--dl); font-size: .8rem; }
.ov-box { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--sand-4); }
.ov-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ov-head b { color: var(--teal-3); font-weight: 600; margin-inline-end: auto; }
.ov-head select { padding: 4px 8px; }
.ov-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.ov-chip { border: 1px solid var(--sand-3); background: #fff; border-radius: 10px; padding: 3px 12px; cursor: pointer; font-size: .82rem; }
.ov-chip.on { background: var(--teal); border-color: var(--teal); color: var(--sand); }
.ov-ctl { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.ov-none { display: flex; align-items: center; gap: 8px; font-size: .82rem; cursor: pointer; }

/* بدء من جديد */
.reset-btn { display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 14px; font: inherit; font-size: .78rem; color: var(--sand); background: transparent; border: 1px solid rgba(243, 233, 215, .25); cursor: pointer; transition: background .15s, color .15s; margin-inline-start: auto; white-space: nowrap; }
.reset-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.reset-btn:hover { background: rgba(243, 233, 215, .12); }
.reset-btn.arm { background: var(--saffron); color: var(--teal-3); border-color: var(--saffron); font-weight: 600; }
.reset-btn + .local-pill { margin-inline-start: 8px; }
/* إعدادات ناجز الافتراضية */
.nz-card { padding: 18px 20px 8px; margin-top: 18px; }
.nz-card .card-title small { display: block; font-size: .76rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.nz-card .card-title { align-items: flex-start; }
.nz-status { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); margin: 6px 0 2px; }
.nz-status i { width: 8px; height: 8px; transform: rotate(45deg); background: var(--palm); flex: none; }
.nz-status.off i { background: var(--sand-4); }
.nz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.nz-grid .opt select { width: auto; min-width: 120px; }
@media (max-width: 760px) { .nz-grid { grid-template-columns: 1fr; } }

/* التقسيم: نطاقات متتابعة */
.rng { display: flex; flex-direction: column; gap: 10px; }
.rng-file { display: flex; flex-direction: column; gap: 6px; }
.rng-head { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--teal-3); min-width: 0; }
.rng-head b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rng-fn { flex: none; width: 20px; height: 20px; border-radius: 6px; background: var(--teal); color: var(--sand); font-size: .7rem; display: grid; place-items: center; }
.rng-row { display: flex; align-items: center; gap: 6px; background: var(--sand-2); border: 1px solid var(--sand-3); border-radius: 12px; padding: 6px 8px; font-size: .84rem; }
.rng-tag { font-weight: 600; color: var(--teal-3); min-width: 46px; }
.rng-lbl { color: var(--muted); font-size: .78rem; }
.rng-from { min-width: 30px; text-align: center; font-weight: 600; color: var(--teal-3); }
.rng-row input.rng-to { width: 64px; padding: 4px 6px; text-align: center; }
.rng-cnt { color: var(--saffron-2); font-size: .75rem; margin-inline-start: auto; white-space: nowrap; }
.rng-del { border: 1px solid var(--sand-3); background: #fff; color: var(--muted); border-radius: 8px; width: 24px; height: 24px; cursor: pointer; flex: none; }
.rng-del:hover { color: var(--dl); border-color: var(--dl-line); background: var(--dl-soft); }
.rng-hint, .rng-empty { font-size: .78rem; color: var(--muted); }

/* ترتيب المرفقات: صفحات فاصلة */
.ws-btn.sep-toggle { border-color: var(--saffron); color: var(--teal-3); background: var(--saffron-soft); font-weight: 600; }
.ws-btn.sep-toggle.on { background: var(--saffron); }
.pcard .ins { position: absolute; top: 50%; right: -15px; transform: translateY(-50%); z-index: 3; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: var(--saffron); color: var(--teal-3); font-weight: 700; cursor: pointer; box-shadow: 0 3px 10px -3px rgba(60,40,10,.5); display: grid; place-items: center; line-height: 1; }
.pcard .ins:hover { background: var(--saffron-2); color: #fff; }
.sep-on.pgrid { column-gap: 20px; }
.sepcard { background: #fffaf0; border-color: var(--saffron); }
.sep-mini { height: 150px; margin: 0 auto; aspect-ratio: 595 / 842; background: #fff; border: 1.5px solid #193337; outline: .5px solid var(--saffron); outline-offset: -5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px; box-shadow: 0 2px 8px rgba(60,40,10,.2); text-align: center; overflow: hidden; }
.sep-mini b { font-size: .8rem; color: #193337; font-weight: 700; }
.sep-orn { display: block; width: 46px; height: 1px; background: var(--saffron); position: relative; }
.sep-orn::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; background: var(--saffron); transform: translate(-50%, -50%) rotate(45deg); }
.sep-mini span { font-size: .6rem; color: #2e4a4d; line-height: 1.5; max-height: 4.5em; overflow: hidden; word-break: break-word; }
.sepcard textarea, .cover textarea { width: 100%; resize: vertical; font: inherit; font-size: .78rem; border: 1px solid var(--sand-3); border-radius: 10px; padding: 6px 8px; background: #fff; min-height: 48px; }
.sepnum { background: var(--saffron); color: var(--teal-3); }
.sep-add-end { border: 1.5px dashed var(--saffron); background: transparent; color: var(--saffron-2); justify-content: center; align-items: center; min-height: 200px; font: inherit; font-size: .82rem; cursor: pointer; }
.sep-add-end .plus { font-size: 1.6rem; line-height: 1; }
.sep-add-end:hover { background: var(--saffron-soft); }

/* الدمج: صفحة غلاف قبل الملف */
.item .cover { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--sand-3); }
.cover-tg { border: 1px dashed var(--saffron); background: transparent; color: var(--saffron-2); border-radius: 9px; padding: 4px 6px; font: inherit; font-size: .76rem; cursor: pointer; }
.cover-tg:hover { background: var(--saffron-soft); }
.cover.on .cover-tg { border-style: solid; background: var(--saffron-soft); color: var(--teal-3); font-weight: 600; }
.cover-title { font-size: .78rem; color: var(--teal-3); text-align: center; }
.link.cover-all { color: var(--saffron-2); margin-inline-start: auto; }
.link.cover-all + .link { margin-inline-start: 12px; }

/* غلاف المرفقات */
.row-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-inline label { font-weight: 500; color: var(--teal-3); font-size: .9rem; }
.row-inline label small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; }
#mcPosRow { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
#mcPosRow[hidden] { display: none; }
.sub-l { font-size: .8rem !important; color: var(--muted) !important; }
.covcard { background: #fff6e3; }
.covcard .sep-mini b { font-size: 1rem; }
.cov-note { color: var(--saffron-2); font-size: .72rem; text-align: center; }
.ws-btn.sep-toggle.cov { background: #fff; }
.item.has-mc { box-shadow: 0 0 0 2px var(--saffron); }
.item.has-mc::after { content: "غلاف المرفقات قبله"; position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--saffron); color: var(--teal-3); font-size: .68rem; font-weight: 600; padding: 1px 8px; border-radius: 8px; white-space: nowrap; }

/* معاينة قبل/بعد */
.pv-btn { border: 1px solid var(--teal-2); background: var(--teal-soft); color: var(--teal-3); border-radius: 10px; padding: 3px 10px; font: inherit; font-size: .8rem; cursor: pointer; white-space: nowrap; }
.pv-btn:hover { background: var(--teal); color: var(--sand); }
.pv-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(10, 30, 32, .62); display: flex; align-items: center; justify-content: center; padding: 18px; }
.pv-modal[hidden] { display: none; }
.pv-box { background: var(--sand); border-radius: 22px; width: min(1280px, 100%); height: min(94vh, 100%); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.pv-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--teal); color: var(--sand); }
.pv-head b { font-weight: 600; }
.pv-nav { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; font-size: .86rem; }
.pv-nav button, .pv-zoom, .pv-x { border: 1px solid rgba(243,233,215,.3); background: transparent; color: var(--sand); border-radius: 10px; padding: 4px 12px; font: inherit; font-size: .84rem; cursor: pointer; }
.pv-nav button:disabled { opacity: .35; cursor: default; }
.pv-nav button:not(:disabled):hover, .pv-zoom:hover, .pv-x:hover { background: rgba(243,233,215,.14); }
.pv-zoom { background: var(--saffron); color: var(--teal-3); border-color: var(--saffron); font-weight: 600; }
.pv-zoom:hover { background: var(--saffron-2) !important; color: #fff; }
.pv-panes { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; min-height: 0; }
.pv-pane { display: flex; flex-direction: column; min-height: 0; background: #fff; border: 1px solid var(--sand-3); border-radius: 14px; overflow: hidden; }
.pv-lab { padding: 6px 12px; font-weight: 600; color: var(--teal-3); font-size: .86rem; border-bottom: 1px solid var(--sand-3); background: var(--sand-2); }
.pv-lab small { color: var(--muted); font-weight: 400; margin-inline-start: 6px; }
.pv-scroll { flex: 1; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 4px; background: #ece6d8; }
.pv-panes.zoom .pv-scroll { justify-content: flex-start; }
.pv-scroll canvas { box-shadow: 0 2px 10px rgba(0,0,0,.18); background: #fff; height: auto; }
.pv-panes:not(.zoom) .pv-scroll canvas { max-height: 100%; width: auto !important; max-width: 100%; }
.pv-wait { margin: auto; color: var(--muted); }
@media (max-width: 760px) { .pv-panes { grid-template-columns: 1fr; } }

.res-x { border: 1px solid var(--sand-3); background: #fff; color: var(--muted); width: 34px; height: 34px; border-radius: 11px; cursor: pointer; font-size: .95rem; flex: none; }
.res-x:hover { color: var(--dl); border-color: var(--dl-line); background: var(--dl-soft); }
.calc-smart { display: block; margin-top: 6px; color: var(--muted); }

/* ملفات الوورد */
.word-ph { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #2b579a; font-size: .78rem; }
.word-ph b { width: 46px; height: 46px; border-radius: 12px; background: #2b579a; color: #fff; display: grid; place-items: center; font-size: 1.5rem; font-family: Arial, sans-serif; }
.word-ph.busy b { animation: wpulse 1s ease-in-out infinite alternate; }
@keyframes wpulse { from { opacity: .45; } to { opacity: 1; } }
.word-act { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--sand-3); }
.word-act small { color: var(--muted); font-size: .72rem; line-height: 1.5; }
.word-btn { border: 1px solid #2b579a; background: #eef3fb; color: #2b579a; border-radius: 9px; padding: 5px 8px; font: inherit; font-size: .8rem; cursor: pointer; font-weight: 600; }
.word-btn:hover { background: #2b579a; color: #fff; }

/* لوحة الصفحات: بطاقات الأغلفة وصفحات المرفقات القابلة للتعديل (1.2.0) */
.sep-kind { text-align: center; color: var(--saffron-2); font-size: .7rem; font-weight: 600; }
.sep-fields { display: flex; flex-direction: column; gap: 5px; }
.sep-row { display: flex; flex-direction: column; gap: 5px; }
.sep-f { display: flex; align-items: center; gap: 5px; font-size: .7rem; color: var(--muted-2); }
.sep-f span { flex: 0 0 auto; min-width: 34px; }
.sep-f input { flex: 1; min-width: 0; font: inherit; font-size: .78rem; color: var(--teal-3); border: 1px solid var(--sand-3); border-radius: 9px; padding: 4px 7px; background: #fff; }
.sep-f input:focus, .sepcard textarea:focus { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 3px var(--saffron-soft); }
.sep-f input.sep-num { max-width: 70px; text-align: center; }
.sepcard.dup { border-color: var(--dl); box-shadow: 0 0 0 2px rgba(194, 65, 45, .25); }
.sepcard.dup .sep-mini b { color: var(--dl); }
.dup-note { color: var(--dl); font-size: .7rem; text-align: center; font-weight: 600; }
.ws-warn { background: #fdecea; border: 1px solid #f1b8ae; color: var(--dl); border-radius: 12px; padding: 7px 12px; font-size: .8rem; margin: 6px 0 10px; font-weight: 500; }
.pcard.flash { animation: sepflash 1.3s ease; }
@keyframes sepflash { 0%, 60% { box-shadow: 0 0 0 4px var(--saffron); } 100% { box-shadow: none; } }
.item .cover .cover-title { border: 0; background: transparent; font: inherit; font-size: .78rem; font-weight: 600; color: var(--teal-3); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.ws[data-mode="merge"] .porig { font-size: .66rem; }
.ws[data-mode="merge"] .pthumb .ph { color: var(--muted-2); }

/* ترقيم الصفحات داخل اللوحة + معاينة الصفحة (1.2.1) */
.pthumb.zoomable { cursor: zoom-in; }
.pimg { position: relative; container-type: size; height: auto; box-shadow: 0 2px 8px rgba(60,40,10,.2); background: #fff; }
.pimg img { width: 100%; height: 100%; max-width: none; max-height: none; box-shadow: none; display: block; }
.pnum-ov { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; color: #000; line-height: 1.5; direction: rtl; pointer-events: none; background: rgba(227, 160, 43, .18); outline: 1px dashed rgba(201, 134, 26, .8); padding: 0 .3em; border-radius: 3px; }
.pnum-ov.off { opacity: .35; text-decoration: line-through; }
.ptools button.numtg { flex: 0 0 30px; font-weight: 700; color: var(--saffron-2); }
.ptools button.numtg.off { background: var(--sand-3); color: var(--muted-2); text-decoration: line-through; }
.np-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(10, 30, 32, .62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.np-panel { background: var(--sand-2); border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; max-width: 100%; max-height: 100%; box-shadow: 0 20px 60px -20px rgba(0,0,0,.5); }
.np-head { display: flex; align-items: center; gap: 10px; }
.np-head b { color: var(--teal-3); margin-inline-end: auto; }
.np-x { border: 0; background: #fff; border-radius: 10px; width: 32px; height: 32px; cursor: pointer; color: var(--teal); }
.np-stage { display: grid; place-items: center; overflow: auto; }
.np-page { position: relative; background: #fff; box-shadow: 0 4px 18px rgba(60,40,10,.25); }
.np-page img { width: 100%; height: 100%; display: block; }
.np-page .pnum-ov.drag { pointer-events: auto; cursor: grab; touch-action: none; background: rgba(227, 160, 43, .25); outline: 2px solid var(--saffron); }
.np-page .pnum-ov.drag:active { cursor: grabbing; }
.np-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.np-tip { color: var(--muted-2); font-size: .78rem; }

/* معاينة التقسيم (1.2.3) */
.spv-file { margin-top: 10px; }
.spv-file + .spv-file { border-top: 1px dashed var(--sand-3); padding-top: 12px; }
.spv-name { font-weight: 600; color: var(--teal-3); margin-bottom: 6px; font-size: .88rem; }
.spv-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.spv-chip { border-radius: 10px; padding: 3px 10px; font-size: .78rem; font-weight: 600; }
.spv-grid { column-gap: 20px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.spv-card { cursor: default; border-width: 2px; }
.spv-card .pthumb { height: 130px; }
.spv-card.g0, .spv-chip.g0 { background: #e3efec; border-color: #9cc5bd; color: var(--teal-3); }
.spv-card.g1, .spv-chip.g1 { background: #fbecd0; border-color: #e3b55f; color: #7a5310; }
.spv-card.g2, .spv-chip.g2 { background: #e6e9f6; border-color: #a7b1db; color: #33407a; }
.spv-card.g3, .spv-chip.g3 { background: #f4e2e6; border-color: #d7a2ae; color: #7a2d3f; }
.spv-card .porig { color: inherit; }
.spv-tag { position: absolute; top: -10px; inset-inline-start: 10px; z-index: 2; background: var(--teal); color: var(--sand); font-size: .68rem; font-weight: 600; padding: 1px 8px; border-radius: 8px; }
.spv-card .cut { position: absolute; top: 50%; right: -17px; transform: translateY(-50%); z-index: 3; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: #fff; color: var(--muted-2); cursor: pointer; box-shadow: 0 2px 8px -2px rgba(60,40,10,.45); font-size: .8rem; display: grid; place-items: center; line-height: 1; opacity: .55; }
.spv-card .cut:hover { opacity: 1; color: var(--dl); }
.spv-card .cut.on { background: var(--dl); color: #fff; opacity: 1; }

/* معاينة كل الصفحات في التوقيع والترقيم (1.2.4) */
.allpv { margin-top: 16px; border-top: 1px dashed var(--sand-3); padding-top: 12px; }
.allpv-card { cursor: default; }
.allpv-card .pthumb { height: 130px; }
.pimg .sig-ov { position: absolute; height: auto; max-width: none; max-height: none; box-shadow: none; background: transparent; pointer-events: none; }
.np-page .sig-ov { position: absolute; height: auto; pointer-events: none; }

/* ===== 1.2.5: تخصيص التوقيع تحت كل صفحة ===== */
.sigk { display: flex; justify-content: center; align-items: center; margin: 5px auto 0; width: max-content; max-width: 100%; border: 1px solid var(--sand-3); border-radius: 999px; background: #fff; overflow: hidden; }
.sigk button { border: 0; background: transparent; color: var(--teal); font: inherit; font-size: .64rem; padding: 2px 6px; cursor: pointer; line-height: 1.5; white-space: nowrap; }
.sigk button + button { border-inline-start: 1px solid var(--sand-3); }
.sigk button.on { background: var(--teal); color: var(--sand); }
.sigk button.rs { color: var(--saffron-2); font-weight: 700; padding: 2px 5px; }
.allpv-card.sig-custom .pthumb { outline: 2px solid var(--saffron); outline-offset: -2px; border-radius: 12px; }
.allpv-card .pthumb.zoomable { cursor: zoom-in; }
.np-sigctl .sigk { margin-top: 0; }
.np-sigctl .sigk button { font-size: .8rem; padding: 4px 12px; }
.np-page .sigbox { z-index: 2; }
.np-page .nosig { position: absolute; inset: auto 0 12px 0; text-align: center; color: var(--muted); font-size: .85rem; }
.allpv .spv-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
.sigk-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.sigk-rs { border: 0; background: none; color: var(--saffron-2); font: inherit; font-size: .64rem; cursor: pointer; padding: 0; }
.sigk-rs:hover { text-decoration: underline; }
.np-sigctl .sigk-wrap { flex-direction: row; gap: 8px; }
.np-sigctl .sigk-rs { font-size: .8rem; }

/* ===== اسم «مِرفاق» وفلسفته + الدليل ===== */
button.brand { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 12px; }
button.brand:hover .brand-title { color: var(--saffron); }
button.brand:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; }
.name-line { text-align: center; font-size: .8rem; color: var(--muted); padding: 0 16px 14px; margin-top: -8px; }
.name-line b { color: var(--teal); }
.name-line .nl-sep { color: var(--saffron); font-size: .6rem; margin: 0 8px; vertical-align: .1em; }
.name-line button, .name-line a { background: none; border: 0; padding: 0; font: inherit; color: var(--teal); font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: var(--saffron); text-underline-offset: 3px; }
.name-ov { position: fixed; inset: 0; z-index: 1000; background: rgba(11, 59, 63, .55); display: grid; place-items: center; padding: 18px; }
.name-card { position: relative; background: var(--sand-2, #FBF6EC); color: var(--ink, #1F2A2B); border-radius: 22px; border-top: 5px solid var(--saffron); max-width: 640px; width: 100%; max-height: calc(100vh - 36px); overflow: auto; padding: 26px 30px 24px; line-height: 1.95; }
.name-card p { margin: 0 0 12px; text-align: justify; font-size: .95rem; }
.name-card b { color: var(--teal); }
.name-word { display: flex; align-items: baseline; justify-content: center; gap: 16px; margin-bottom: 10px; }
.nw-big { font-size: 2.6rem; font-weight: 700; color: var(--teal); line-height: 1.2; }
.nw-root { color: var(--saffron-2, #C9861A); font-weight: 700; letter-spacing: 3px; }
.name-card blockquote { margin: 6px 0 0; text-align: center; background: var(--sand, #F3E9D7); border-right: 4px solid var(--saffron); border-radius: 12px; padding: 10px 14px; font-weight: 700; color: var(--teal); }
.name-card blockquote small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.name-x { position: absolute; top: 10px; left: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--sand, #F3E9D7); color: var(--teal); font-size: 1.3rem; cursor: pointer; line-height: 1; }
.name-x:hover { background: var(--saffron); }

.made small { display: block; font-size: .74rem; color: var(--muted-2); margin-top: 2px; }
.made a { color: var(--teal); font-weight: 700; text-decoration: none; border-bottom: 1px dashed var(--saffron); }
.made a:hover { color: var(--saffron-2); }

/* ===== الواجهة البسيطة / الاحترافية ===== */
.ui-seg { display: inline-flex; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 3px; gap: 2px; margin-inline-start: auto; flex: none; }
.ui-seg button { border: 0; background: transparent; color: var(--sand); font: inherit; font-size: .8rem; font-weight: 600; padding: 5px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.ui-seg button.on { background: var(--saffron); color: var(--teal-3, #0B3B3F); }
.ui-seg button:not(.on):hover { background: rgba(255,255,255,.12); }
.ui-seg + .reset-btn { margin-inline-start: 8px; }
html.simple [data-adv], html.simple .b-adv, html.simple .calc-grid, html.simple .calc-note { display: none !important; }

/* الواجهة البسيطة: صفحة وحدة */
html.simple .modes, html.simple #calc, html.simple #nextActs { display: none !important; }
.smodes { display: flex; gap: 6px; margin-inline-start: 18px; }
.smodes button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #d8ecea; font: inherit; font-weight: 600; border-radius: 999px; padding: 7px 18px; cursor: pointer; }
.smodes button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.smodes button.on { background: #F3E9D7; color: #0A3A3E; border-color: #F3E9D7; }
.cmp-out .seg { margin-top: 8px; }
.cmp-out .seg button { padding: 4px 14px; }
html:not(.simple) .simple-only { display: none !important; }
html.simple .sepcard:not(.covcard) .sep-f.f-title { display: none; }
html.simple .run { background: var(--saffron, #E3A02B); border-color: var(--saffron, #E3A02B); color: #0A3A3E; font-size: 1.12rem; padding: 15px; font-weight: 700; box-shadow: 0 6px 18px rgba(227,160,43,.35); }
html.simple .run:not(:disabled):hover { filter: brightness(1.05); background: var(--saffron, #E3A02B); }
html.simple .run:disabled { box-shadow: none; opacity: .55; }
.cmp-out { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #FBF3E2; border: 1px solid #F0D9A8; border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.cmp-out > div { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.cmp-out small { color: #6b6b6b; font-size: .82rem; }
.cmp-out .btn svg { width: 18px; height: 18px; }
html.simple #numSizeRow { display: none !important; }
html.simple .side { max-height: calc(100vh - 100px); overflow-y: auto; border-radius: 24px; }
html.simple .side .run { position: sticky; bottom: 10px; z-index: 2; }

.pg-fold { font-weight: 700; }
.pg-fold:not(.on) { background: var(--teal, #0E4D52); color: #F3E9D7; border-color: var(--teal, #0E4D52); }
.board.folded .ws-bar { margin-bottom: 0; }

/* تفاصيل تقنية مخفية في الواجهتين */
.x-hide, .calc-grid, .calc-note { display: none !important; }

/* التوقيع داخل التنظيم */
.os-box { display: flex; flex-direction: column; gap: 10px; background: var(--sand-2, #FBF6EC); border: 1px solid var(--sand-3, #E4D6BA); border-radius: 16px; padding: 12px; }
.os-box .sig-slot { margin-bottom: 0; padding: 10px 12px; background: #fff; }
.os-slots { display: flex; flex-direction: column; gap: 8px; }
.os-f { display: flex; flex-direction: column; gap: 6px; }
.os-f > label { font-weight: 600; font-size: .9rem; }
.os-f .seg.wide button { padding: 6px 4px; font-size: .86rem; }
.os-custom { width: 100%; }
.os-pad { width: 820px; }
.os-box .sig-head small { display: none; }
.os-box .sig-prev { height: 64px; min-height: 0; padding: 4px; }
.os-box .sig-prev img { max-height: 100%; }
.os-box .sig-acts .btn { padding: 4px 10px; font-size: .82rem; }
