/* ================================================================
   استوديو الورقيات (studio.js) — الورقة نفسها + شاشة المحرّر
   ألوان الشاشة من متغيّرات البرنامج (الفاتح/الغامق/الأخضر) — الورقة دايماً بيضا.
   ================================================================ */

/* ---------------------------------------------------- الورقة (طباعة + محرّر) */
.st-paper { box-sizing: border-box; direction: rtl; color: #000; background: #fff; width: var(--st-w, 148mm); min-height: var(--st-h, 210mm);
  -webkit-print-color-adjust: exact; print-color-adjust: exact; overflow-wrap: anywhere; }
.st-paper * { box-sizing: border-box; }
.st-paper .st-b { min-height: 1px; }
.st-paper img { max-width: 100%; }
.st-paper table { page-break-inside: auto; }
.st-paper tr { page-break-inside: avoid; }
.st-paper thead { display: table-header-group; }
/* العلامة المائية: فوق الورقة بشفافية خفيفة ومابتمسكش الضغط — في الطباعة والملف بتتكرر على كل صفحة */
.st-paper { position: relative; }
.st-paper .st-wm { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; }
.st-paper .st-wms { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.st-paper .st-wmm { flex: none; text-align: center; }
.st-paper .st-wmt { position: absolute; left: -30%; top: -30%; width: 160%; height: 160%; display: flex; flex-wrap: wrap; align-content: flex-start; }
.st-paper .st-wmt > span { display: flex; align-items: center; justify-content: center; text-align: center; }
@media print {
  .st-paper { width: auto !important; min-height: 0 !important; }
  body.printing-invoice #print-host .st-paper { margin: 0; }
  .st-paper .st-wm { position: fixed; inset: 0; }
  .st-paper .st-wm > .st-wms { height: 100% !important; }
  .st-paper .st-wm > .st-wms ~ .st-wms { display: none; }
}
/* (2026-11-02) الورقيات المتقسّمة صفحات (كشف المرتبات والقسيمة): كل صفحة ورقة لوحدها بمقاسها بالظبط —
   المعاينة والطباعة والملف نفس الصفحات (pages في studio.js). العلامة المائية في الطباعة من أول صفحة بس (بتتكرر لوحدها) */
.st-paper.st-pg { height: var(--st-h); min-height: 0; overflow: hidden; }
@media print {
  .st-paper.st-pg { height: calc(var(--st-h) - 0.6mm) !important; min-height: 0 !important; break-after: page; page-break-after: always; }
  .st-paper.st-pg:last-child { break-after: auto; page-break-after: auto; }
  .st-pg ~ .st-pg .st-wm { display: none; }
}
/* (2026-12-05) التركيبات الفاضية: صفحتين A5 جنب بعض في ورقة A4 بالعرض (twoUp في studio.js) — الأولى يمين وخط قص متقطّع في النص */
.st-2up { display: flex; direction: rtl; width: 297mm; background: #fff; }
.st-2up > .st-paper { flex: none; width: 148.5mm; }
.st-2up > .st-paper + .st-paper { border-right: .3mm dashed #9a9a9a; }
@media print {
  .st-2up { height: calc(210mm - 0.6mm); overflow: hidden; break-after: page; page-break-after: always; }
  .st-2up:last-child { break-after: auto; page-break-after: auto; }
  .st-2up > .st-paper.st-pg { width: 148.5mm !important; break-after: auto; page-break-after: auto; }
  .st-2up ~ .st-2up .st-wm, .st-2up > .st-pg ~ .st-pg .st-wm { display: none; }
}
/* (2026-12-01) الفاتورة الطويلة (invPages): كل صفحة ورقة بهوامشها — فصف عناوين الجدول في الصفحة التانية مابيتقصّش من حافة الورق.
   أقل حاجة طول الصفحة (min-height مش height): لو القياس غلط بحاجة صغيرة الزيادة بتنزل صفحة بدل ما تستخبى */
.st-paper.st-ipg { min-height: var(--st-h); }
@media print {
  .st-paper.st-ipg { min-height: calc(var(--st-h) - 0.6mm) !important; break-after: page; page-break-after: always; }
  .st-paper.st-ipg:last-child { break-after: auto; page-break-after: auto; }
  .st-ipg ~ .st-ipg .st-wm { display: none; }
  /* أكتر من نسخة (🖨️ الطباعة): كلمة «الأصل/صورة» فوق الورقة من غير ما تاخد مكان من الصفحة */
  .pr-copy:has(.st-ipg) { position: relative; }
  .pr-copy:has(.st-ipg) > .pr-copylbl { position: absolute; top: 1.2mm; left: 50%; transform: translateX(-50%); z-index: 6; margin: 0; background: #fff; }
}

/* المحرّر: إظهار اللي بيتعدّل */
.st-paper .st-ed { cursor: pointer; border-radius: 2px; outline: 1px dashed transparent; outline-offset: 1.5px; transition: outline-color .12s; }
.st-paper .st-ed:hover { outline-color: rgba(21, 128, 61, .55); }
.st-paper .st-ed.st-on { outline: 2px solid #15803d; outline-offset: 2.5px; background-color: rgba(21, 128, 61, .05); }
.st-paper .st-hid { opacity: .35; }
.st-paper .st-hid::after { content: 'مخفي'; font: 700 8px Cairo, sans-serif; color: #fff; background: #6b7c71; border-radius: 3px; padding: 0 4px; margin-inline-start: 4px; vertical-align: middle; }
.st-paper .st-ph { color: #8a9a90; font-weight: 600; font-size: .85em; font-style: italic; }
/* عمود فاضي: إطار خفيف — والكلام يظهر وانت بتسحب بس */
.st-paper .st-drop { border: 1px dashed #dbe5dd; border-radius: 4px; color: transparent; font: 600 9px Cairo, sans-serif; text-align: center; padding: 2.5mm 1mm; }
.st-dragging .st-paper .st-drop, .st-paper .st-r:hover .st-drop { border-color: #86b897; color: #3f6b4e; }
.st-paper .st-r.st-ron { outline: 2px dashed #15803d; outline-offset: 2px; }

/* ---------------------------------------------------- الشاشة */
.st-app { display: flex; flex-direction: column; gap: 10px; min-height: 520px; color: var(--text); font-family: inherit; }
.st-app svg { flex: none; }
.st-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-radius: var(--r-md, 14px);
  background: var(--glass-2); border: 1px solid var(--stroke-hi); box-shadow: var(--shadow-sm); }
.st-g { display: flex; align-items: center; gap: 6px; }
.st-end { margin-inline-start: auto; flex-wrap: wrap; }
.st-top .btn.sm { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.st-ico { padding: 0 8px !important; min-width: 36px; justify-content: center; }
.st-dsel { min-width: 170px; max-width: 240px; font-weight: 800; }
.st-docsel { min-width: 150px; max-width: 220px; font-weight: 800; color: #14532d; }
.st-psel { min-width: 170px; max-width: 230px; }
.st-lbl { font-size: 12.5px; color: var(--text-dim); font-weight: 600; }
.st-kinds { border: 1px solid #b7dcc2; background: #e7f3ea; color: #14532d; border-radius: 10px; padding: 6px 12px; font: 600 12.5px/1.4 inherit; font-family: inherit; cursor: pointer; text-align: start; max-width: 380px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-kinds.off { background: #fff7ed; border-color: #f3d6bd; color: #9a3412; }
.st-kinds:hover { filter: brightness(.97); }
#st-save.st-dirty::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; margin-inline-start: 2px; }
.st-phonly { display: none !important; }

.st-seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: rgba(120, 140, 120, .14); flex-wrap: wrap; }
.st-seg button { border: 0; background: transparent; border-radius: 8px; padding: 6px 11px; font: 700 12.5px inherit; font-family: inherit; color: var(--text-dim); cursor: pointer; min-height: 32px; }
.st-seg button[aria-pressed="true"] { background: #fff; color: #14532d; box-shadow: 0 1px 3px rgba(19, 35, 26, .18); }
.st-seg + .st-seg { margin-top: 6px; }

.st-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr) 330px; gap: 10px; }
.st-lib, .st-props { background: var(--glass-2); border: 1px solid var(--stroke-hi); border-radius: var(--r-md, 14px); overflow: auto; min-height: 0; }
.st-lib { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.st-libh { display: flex; flex-direction: column; gap: 2px; position: relative; }
.st-libh b { font-size: 15px; } .st-libh small { font-size: 11.5px; color: var(--text-dim); line-height: 1.5; padding-inline-end: 30px; }
.st-libx { display: none !important; position: absolute; top: 0; left: 0; }
.st-libg { font-size: 12px; font-weight: 800; color: var(--accent); margin-top: 4px; }
.st-libgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.st-tile { display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 4px 9px; border: 1px solid var(--stroke-hi); border-radius: 10px; background: var(--glass-hi);
  font: 600 12.5px inherit; font-family: inherit; color: var(--text); cursor: grab; text-align: start; touch-action: manipulation; user-select: none; }
.st-tile svg { color: var(--accent); }
.st-tile:hover { border-color: var(--accent); background: var(--glass-2); }

.st-stage { position: relative; min-height: 0; overflow: auto; border-radius: var(--r-md, 14px); background-color: #dfe5dc;
  background-image: radial-gradient(rgba(47, 74, 58, .16) 1px, transparent 1.2px); background-size: 16px 16px; }
.st-canvas { position: relative; min-height: 100%; padding: 26px 24px 70px; display: flex; justify-content: center; align-items: flex-start; box-sizing: border-box; }
.st-zoom { flex: none; box-shadow: 0 10px 32px rgba(19, 35, 26, .22); background: #fff; }
.st-ov { position: absolute; inset: 0; pointer-events: none; }
.st-zctl { position: sticky; float: left; bottom: 10px; left: 10px; margin: -52px 0 0 10px; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 11px;
  background: #fff; border: 1px solid #dde5da; box-shadow: 0 2px 8px rgba(19, 35, 26, .1); z-index: 5; color: #13231a; }
.st-zctl b { min-width: 46px; text-align: center; font-size: 12.5px; }
.st-zctl .btn { min-height: 30px; padding: 0 10px; }
.st-pinfo { position: sticky; float: right; bottom: 10px; margin: -50px 10px 0 0; padding: 7px 12px; border-radius: 11px; background: #fff; border: 1px solid #dde5da; font-size: 12px; font-weight: 600; color: #2f4a3a; z-index: 5; }
.st-emptyd { padding: 60px 30px; color: #4b5f52; font-weight: 700; }

/* الشريط الصغير فوق الحاجة المختارة */
.st-tb { position: absolute; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 11px; background: #13231a; box-shadow: 0 8px 20px rgba(19, 35, 26, .35); pointer-events: auto; z-index: 6; }
.st-tb button { width: 32px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #fff; display: flex; align-items: center; justify-content: center; font: 800 12px Cairo, sans-serif; cursor: pointer; }
.st-tb button.big { font-size: 15px; }
.st-tb button:hover { background: #2f4a3a; }
.st-tb button.on { background: #2f4a3a; outline: 1px solid #86b897; }
.st-tb button.bad { color: #fca5a5; }
.st-tb i { width: 1px; height: 18px; background: #4b5f52; margin: 0 2px; }
.st-tb svg { width: 16px; height: 16px; }
.st-grip { position: absolute; display: flex; align-items: center; gap: 4px; height: 34px; min-width: 20px; padding: 0 5px; border-radius: 8px; border: 1px solid #86b897; background: #fff; color: #3f6b4e;
  cursor: grab; pointer-events: auto; touch-action: none; z-index: 6; font: 700 12px Cairo, sans-serif; }
.st-pbreak { position: absolute; border-top: 2px dashed #f59e0b; pointer-events: none; }
.st-pbreak span { position: absolute; top: -11px; left: 6px; background: #f59e0b; color: #fff; font: 700 10px Cairo, sans-serif; border-radius: 5px; padding: 1px 7px; }
.st-ind { position: absolute; height: 4px; border-radius: 3px; background: #15803d; box-shadow: 0 0 0 2px rgba(21, 128, 61, .25); z-index: 7; }
.st-ind.row { background: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .25); }
.st-ind span { position: absolute; top: -21px; right: 0; white-space: nowrap; font: 800 10.5px Cairo, sans-serif; color: #fff; background: inherit; border-radius: 6px; padding: 1px 8px; }
.st-ghost { position: fixed; z-index: 9999; pointer-events: none; display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border-radius: 10px; background: #fff;
  border: 1.5px solid #15803d; box-shadow: 0 12px 26px rgba(19, 35, 26, .3); font: 800 12.5px Cairo, sans-serif; color: #14532d; transform: rotate(-3deg); }
.st-ghost svg { color: #15803d; }
.st-dragging, .st-dragging * { cursor: grabbing !important; user-select: none !important; }

/* لوحة الإعدادات */
.st-props { display: flex; flex-direction: column; }
.st-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 4px; padding: 8px; border-bottom: 1px solid var(--stroke-hi); position: sticky; top: 0; background: inherit; z-index: 2; }
.st-tabs button[role=tab] { height: 36px; border: 0; border-radius: 9px; background: transparent; font: 700 13.5px inherit; font-family: inherit; color: var(--text-dim); cursor: pointer; }
.st-tabs button[aria-selected="true"] { background: #e7f3ea; color: #14532d; font-weight: 800; }
.st-tabs button:disabled { opacity: .4; cursor: default; }
.st-sheetx { display: none; border: 0; background: transparent; color: var(--text-dim); cursor: pointer; padding: 0 6px; }
.st-pbody { padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.st-pfoot { padding: 9px 14px; border-top: 1px solid var(--stroke-hi); font-size: 11.5px; color: var(--text-dim); line-height: 1.6; }
.st-ph2 { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.st-ph2 b { display: block; font-size: 16px; } .st-ph2 small { display: block; font-size: 11.5px; color: var(--text-dim); }
.st-acts { display: flex; gap: 3px; }
.st-acts .btn { min-height: 32px; display: inline-flex; align-items: center; }
.st-acts .btn.bad, .st-menu .btn.bad { color: var(--bad); }
.st-sec { display: flex; flex-direction: column; gap: 7px; }
.st-sech { font-size: 12.5px; font-weight: 800; color: var(--accent); }
.st-sech:empty { display: none; }
.st-sec select.f, .st-sec input.f, .st-sec textarea.f { width: 100%; }
.st-hint { font-size: 11.5px; color: var(--text-dim); line-height: 1.6; }
.st-warn { font-size: 12px; background: #fff7ed; color: #9a3412; border: 1px solid #f3d6bd; border-radius: 9px; padding: 6px 10px; }
.st-two { display: flex; gap: 6px; flex-wrap: wrap; }
.st-wmbox { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--stroke-hi); padding-top: 12px; }
.st-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.st-chips button { border: 0; background: rgba(120, 140, 120, .14); border-radius: 999px; padding: 4px 11px; min-height: 30px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 700 12px inherit; font-family: inherit; color: var(--text-dim); cursor: pointer; }
.st-chips button[aria-pressed="true"] { background: #fff; color: #14532d; box-shadow: 0 1px 3px rgba(19, 35, 26, .18); }
.st-two .btn { display: inline-flex; align-items: center; gap: 6px; }
.st-swrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 600; min-height: 30px; }
.st-sw { flex: none; width: 42px; height: 24px; border: 0; border-radius: 12px; background: #c9d3c6; position: relative; cursor: pointer; padding: 0; }
.st-sw i { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: right .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.st-sw[aria-checked="true"] { background: #15803d; }
.st-sw[aria-checked="true"] i { right: 21px; }
.st-rng { display: flex; align-items: center; gap: 10px; }
.st-rng input { flex: 1; accent-color: #15803d; }
.st-rng output { min-width: 92px; font-size: 12px; font-weight: 700; color: var(--text-dim); text-align: left; }
.st-colors { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.st-colors button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; outline: 1px solid #c9d6c6; background: var(--c); cursor: pointer; }
.st-colors button[aria-pressed="true"] { outline: 2.5px solid #15803d; }
.st-cpick { position: relative; width: 34px; height: 34px; border-radius: 50%; border: 1.5px dashed #9fb7a6; display: flex; align-items: center; justify-content: center; color: #3f6b4e; font-size: 18px; cursor: pointer; overflow: hidden; }
.st-cpick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.st-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.st-boxes button { min-height: 56px; border: 1px solid var(--stroke-hi); border-radius: 10px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font: 700 11px inherit; font-family: inherit; color: #13231a; cursor: pointer; }
.st-boxes button[aria-pressed="true"] { border: 2px solid #15803d; }
.st-boxes i { display: block; width: 30px; height: 14px; background: repeating-linear-gradient(#cfd8cc 0 2px, transparent 2px 5px); }
.st-boxes i.u { background: none; border-bottom: 2px solid #13231a; } .st-boxes i.x { background: none; border: 2px solid #13231a; }
.st-boxes i.g { background: #e4e4e4; border-radius: 2px; } .st-boxes i.a { background: var(--a); border-radius: 3px; }
.st-boxes i.gr { background: none; border-top: 2px solid #13231a; border-bottom: 2px solid #13231a; }
.st-boxes i.gr.h { border-right: 2px solid #13231a; border-left: 2px solid #13231a; }
.st-boxes i.gr.all { border: 2px solid #13231a; background: linear-gradient(90deg, transparent 48%, #13231a 48%, #13231a 52%, transparent 52%); }
.st-boxes i.gr.rows { border-top: 0; background: repeating-linear-gradient(transparent 0 5px, #13231a 5px 6px); }
.st-boxes i.gr.none { border: 0; border-top: 2px solid #13231a; background: repeating-linear-gradient(#cfd8cc 0 2px, transparent 2px 5px); }
.st-cols { display: flex; flex-direction: column; gap: 5px; }
.st-colr { display: flex; align-items: center; gap: 4px; }
.st-colr .f { min-height: 32px; padding: 2px 7px; flex: 1; min-width: 0; }
.st-colr .st-w { flex: none; width: 52px; }
.st-colr .btn { min-height: 30px; padding: 0 5px; }
.st-colr.off .f { opacity: .5; }
.st-lays { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.st-lays button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px; border: 1px solid var(--stroke-hi); border-radius: 10px; background: #fff; font: 700 11px inherit; font-family: inherit; color: #13231a; cursor: pointer; }
.st-lays button[aria-pressed="true"] { border: 2px solid #15803d; }
.st-lays .lay { display: flex; gap: 3px; width: 54px; height: 18px; }
.st-lays .lay i { background: #b7dcc2; border-radius: 3px; }
.st-cw { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; font-size: 11.5px; color: var(--text-dim); }
.st-cw label { display: flex; flex-direction: column; gap: 3px; }
.st-adv summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }

/* النوافذ: التفعيل · الأشكال الجاهزة · النسخ */
.st-kd { display: flex; flex-direction: column; gap: 6px; }
.st-kopt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--stroke-hi); border-radius: 11px; cursor: pointer; flex-wrap: wrap; }
.st-kopt input { width: 20px; height: 20px; accent-color: #15803d; }
.st-kopt span { font-weight: 700; font-size: 14px; }
.st-kopt small { flex-basis: 100%; padding-inline-start: 30px; font-size: 11.5px; color: #9a3412; }
.st-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.st-galc { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 10px; border: 1px solid var(--stroke-hi); border-radius: 14px; background: var(--glass-hi); cursor: pointer; text-align: start; font-family: inherit; color: var(--text); }
.st-galc:hover { border-color: var(--accent); }
.st-galp { height: 200px; overflow: hidden; display: flex; justify-content: center; background: #e9eee7; border-radius: 9px; padding-top: 10px; pointer-events: none; }
.st-galp > div { box-shadow: 0 4px 12px rgba(0, 0, 0, .18); background: #fff; align-self: flex-start; }
.st-galc b { font-size: 14.5px; } .st-galc small { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.st-menu { display: flex; flex-direction: column; gap: 8px; }
.st-menu .btn { display: flex; align-items: center; gap: 8px; justify-content: flex-start; min-height: 44px; }
.st-vers { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.st-ver { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--stroke-hi); border-radius: 10px; }
.st-ver small { display: block; color: var(--text-dim); font-size: 11.5px; }

.st-fab { display: none; }

/* ---------------------------------------------------- الموبايل والشاشات الصغيرة */
@media (max-width: 1560px) and (min-width: 901px) {
  .st-lbl { display: none; }
  .st-kinds { max-width: 260px; }
  .st-psel { min-width: 150px; max-width: 190px; }
}
@media (max-width: 1180px) and (min-width: 901px) {
  .st-body { grid-template-columns: 210px minmax(0, 1fr) 290px; }
  .st-top .btn span { display: none; }
  .st-lbl { display: none; }
}
@media (max-width: 900px) {
  .st-app { gap: 8px; min-height: 0; }
  /* الشريط فوق في سطرين صغيرين: (التصميم + جديد + حفظ) · (المعاينة + طباعة + ملف) · (الورق + تراجع) · التفعيل */
  .st-top { padding: 6px 8px; gap: 6px; }
  .st-top .btn span, .st-lbl, #st-new span { display: none; }
  .st-top > .st-g:first-child { order: 1; flex: 1 1 100%; }
  .st-dsel, .st-docsel { min-width: 0; max-width: none; flex: 1; }
  .st-end { order: 2; flex: 1 1 100%; margin: 0; flex-wrap: nowrap; justify-content: stretch; }
  .st-end .st-psel { flex: 1; min-width: 0; max-width: none; }
  #st-paper { order: 3; }
  .st-ur { order: 4; margin-inline-start: auto; }
  .st-kinds { order: 5; flex-basis: 100%; max-width: none; padding: 5px 10px; font-size: 12px; }
  .st-top .btn.sm, .st-top .f { min-height: 40px; }
  .st-phonly { display: inline-flex !important; }
  .st-body { display: block; }
  .st-stage { height: calc(100vh - 210px); min-height: 380px; border-radius: 12px; }
  .st-canvas { padding: 14px 8px 70px; }
  .st-lib { display: none; position: fixed; inset: auto 0 0 0; max-height: 62vh; z-index: 60; border-radius: 22px 22px 0 0; background: var(--glass-hi);
    box-shadow: 0 -8px 26px rgba(19, 35, 26, .2); padding: 14px 14px 22px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .st-app.st-libopen .st-lib { display: flex; }
  .st-libx { display: inline-flex !important; }
  .st-tile { min-height: 48px; touch-action: manipulation; }
  .st-props { display: none; position: fixed; inset: auto 0 0 0; max-height: 58vh; z-index: 60; border-radius: 22px 22px 0 0; background: #fff; color: #13231a;
    box-shadow: 0 -8px 26px rgba(19, 35, 26, .2); }
  .st-app.st-sheet .st-props { display: flex; max-height: 50vh; }
  /* وانت بتعدّل حاجة: الشريط اللي فوق بيستخبى عشان الورقة تبان فوق اللوحة */
  .st-app.st-sheet .st-top { display: none; }
  .st-app.st-sheet .st-canvas { padding-bottom: 52vh; }
  .st-sheetx { display: inline-flex; align-items: center; }
  .st-pfoot { display: none; }
  .st-sw { width: 48px; height: 28px; border-radius: 14px; } .st-sw i { width: 22px; height: 22px; } .st-sw[aria-checked="true"] i { right: 23px; }
  .st-seg button { min-height: 40px; padding: 6px 12px; }
  .st-acts .btn, .st-colr .btn { min-height: 40px; min-width: 40px; }
  .st-fab { display: flex; position: fixed; left: 16px; bottom: 22px; z-index: 55; width: 56px; height: 56px; border: 0; border-radius: 50%; background: #15803d; color: #fff;
    align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(21, 128, 61, .4); cursor: pointer; }
  .st-fab svg { width: 26px; height: 26px; }
  .st-app.st-sheet .st-fab, .st-app.st-libopen .st-fab { display: none; }
  .st-zctl { display: none; }
  .st-pinfo { font-size: 11px; padding: 5px 9px; }
  .st-grip { height: 40px; padding: 0 9px; background: #15803d; color: #fff; border-color: #15803d; }
}
