/* app-extras.css: اللمس وتقليل الحركة وإضافات متفرقة. الملفات تُحمَّل بالترتيب: app.css, app-theme.css, app-motion.css, app-deeds.css, app-extras.css, app-lit.css, app-petitions.css */
/* touch: no double-tap zoom delay, no text selection when long-pressing controls, scroll stays inside dialogs */
button,
a,
summary,
label,
.btn,
.mrow,
.mc {
  touch-action: manipulation;
}
.btn,
.tab,
.sbtn,
.stg,
.seg,
.tabbar,
.fabb,
.fabm,
.catb,
summary {
  -webkit-user-select: none;
  user-select: none;
}
.ov,
.pop,
.palr {
  overscroll-behavior: contain;
}
@supports (height: 100dvh) {
  .boot {
    min-height: 100dvh;
  }
  @media (max-width: 860px) {
    .dlg,
    .dlg.wide {
      max-height: 92dvh;
    }
  }
}

/* reduced motion: keep the feedback (opacity, colour), drop the travel */
@media (prefers-reduced-motion: reduce) {
  #main.enter,
  .ov > .dlg,
  #toasts .toast,
  .pop:not([hidden]),
  .fabm:not([hidden]),
  details.morem[open] > div,
  details.sec[open] > .secb {
    animation-name: fade !important;
  }
  .ov.out > .dlg,
  #toasts .toast.out {
    animation-name: fadeout !important;
  }
  .boot i {
    animation: fade 0.4s 0.3s both;
  }
  .mrow:hover,
  .catb:hover,
  .mc.dragging,
  :is(
      .btn,
      .sbtn,
      .stg,
      .seg button,
      .seg a.segl,
      .catb,
      .qbtn,
      .tabbar a,
      .tabbar button,
      .mrow,
      a.card,
      .mc,
      .fabb
    ):active {
    transform: none !important;
  }
  .fab.away {
    transform: none;
  }
  details.sec > summary::before {
    transition: none;
  }
}

/* خانات ملف العميل */
.drv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.fold {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: right;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.12s;
}
.fold:hover {
  border-color: color-mix(in srgb, var(--acc) 35%, var(--line));
  transform: translateY(-1px);
}
.fold .ico {
  width: 24px;
  height: 24px;
  color: var(--acc);
  margin-bottom: 2px;
}
.fold .fd {
  font-size: 12px;
  line-height: 1.5;
}
.infold .fchip {
  display: none;
}
@media (max-width: 860px) {
  .drv {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .fold {
    padding: 12px;
  }
  .fold .fd {
    display: none;
  }
}

/* نافذة التأكيد: فوق أي نافذة مفتوحة */
.ov.ask {
  z-index: 70;
  align-items: center;
}
.dlg.sm {
  max-width: 420px;
}
.askm {
  margin: 0 0 16px;
  line-height: 1.8;
  font-size: 15px;
}
.askin {
  width: 100%;
  margin-bottom: 16px;
}

/* خانة التاريخ يوم/شهر/سنة على الحاسوب */
.dbx {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}
.dbx > input[type="text"] {
  flex: 1;
  min-width: 0;
  text-align: right;
}
.dbxb {
  flex: none;
  width: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--mute);
  cursor: pointer;
}
.dbxb:hover {
  color: var(--acc);
}
.dbxb svg {
  width: 17px;
  height: 17px;
}
.dbx > input[type="date"] {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* شاشة الدخول والإعداد: بطاقة واحدة لا بطاقة داخل بطاقة */
.auth > .card form {
  background: none;
  border: 0;
  padding: 0;
  box-shadow: none;
}
/* زر الإضافة السريعة على الحاسوب: في الشريط العلوي لا فوق المحتوى */
@media (min-width: 861px) {
  body:has(.fab) .tb {
    padding-left: 150px;
  }
  .fab {
    top: 13px;
    bottom: auto;
    left: 32px;
    flex-direction: column;
    z-index: 45;
  }
  .fabb {
    width: auto;
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 14px;
    box-shadow: var(--shadow);
  }
  .fabb::after {
    content: " إضافة";
  }
}
/* قراءة فقط (صاحب الشركة): الموقف الحالي وحده، والمراحل الأخرى باهتة */
.sbtn:disabled:not(.on) {
  display: none;
}
.sbtn:disabled,
.stg:disabled {
  cursor: default;
}
.stg:disabled:not(.on) {
  opacity: 0.55;
}
.sech {
  margin: 26px 0 12px;
  font-size: 16px;
}
.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
}
.danger-zone h4 {
  color: var(--danger);
}
@media (max-width: 860px) {
  .card > .sh {
    flex-wrap: wrap;
    gap: 8px;
  }
  .tabs,
  .seg {
    -webkit-mask-image: linear-gradient(
      to left,
      #000 calc(100% - 28px),
      transparent
    );
    mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
  }
}
/* نتيجة الجلسة في قائمة المواعيد */
.hres {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink);
}
.hres b {
  color: var(--acc);
}

/* تنبيه النسخ الاحتياطي في صفحة «اليوم» (للإدارة) */
.warnbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  border-color: var(--warn);
  line-height: 1.8;
}
.warnbar .btn {
  flex-shrink: 0;
}
@media (max-width: 860px) {
  .warnbar {
    flex-direction: column;
    align-items: stretch;
  }
  /* اسم طويل بلا مسافات (ملف، بريد) ينكسر داخل مكانه: لولا ذلك تتسع الصفحة كلها ويخرج الشريط السفلي عن الشاشة */
  #main td,
  #main td a,
  #main li,
  #main p,
  #main h1,
  #main h4,
  #main .mute,
  #main .crumbs,
  .ov .dlg h3,
  .ov .dlg p,
  .ov .dlg li {
    overflow-wrap: anywhere;
  }
  #main .btn,
  #main .chip,
  #main .tab {
    overflow-wrap: normal;
  }
  table.mcards td > * {
    min-width: 0;
  }
  /* بطاقة الوثيقة: الاسم، ثم سطر تفاصيل، ثم الأزرار */
  table.mcards.dcmp tr,
  table.mcards.lcmp tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 10px;
    padding: 10px 12px;
  }
  table.mcards.dcmp td,
  table.mcards.lcmp td {
    display: block;
    padding: 0;
    border: 0;
    font-size: 13px;
  }
  table.mcards.dcmp td::before,
  table.mcards.lcmp td::before {
    display: none;
  }
  table.mcards.dcmp td.phx,
  table.mcards.lcmp td.phx,
  table.mcards.lcmp td.ld-i:empty,
  table.mcards.lcmp td.ld-x:empty {
    display: none;
  }
  table.mcards.dcmp .dn {
    flex: 1 1 100%;
    font-size: 15px;
    font-weight: 600;
  }
  table.mcards.dcmp .dw {
    flex: 1 1 100%;
  }
  table.mcards.dcmp .dc::after {
    content: " ·";
    color: var(--mute);
  }
  table.mcards.dcmp .du div {
    display: inline;
    margin-inline-start: 6px;
  }
  table.mcards.dcmp td.dshr::before {
    display: inline;
    content: "مرئية للعميل ";
    font-size: 12px;
  }
  table.mcards.dcmp .da {
    flex: 1 1 100%;
    margin-top: 7px;
  }
  /* بطاقة المبلغ: البيان والمبلغ في سطر، ثم الشركة والتاريخ */
  table.mcards.lcmp .ld-b {
    order: 1;
    flex: 1 1 55%;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
  }
  table.mcards.lcmp .ld-b .mute {
    font-weight: 400;
    font-size: 12.5px;
  }
  table.mcards.lcmp .ld-a {
    order: 2;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
  }
  table.mcards.lcmp .ld-c {
    order: 3;
    color: var(--mute);
  }
  table.mcards.lcmp .ld-d {
    order: 4;
  }
  table.mcards.lcmp .ld-x {
    order: 5;
    margin-inline-start: auto;
  }
  table.mcards.lcmp .ld-m {
    order: 6;
    flex: 1 1 100%;
  }
  table.mcards.lcmp .ld-i {
    order: 7;
  }
  /* الرفع زر واحد في الصفحات، والنوافذ كما هي */
  #main .uplb {
    display: inline-flex;
    margin-bottom: 10px;
  }
  #main .uplf.open > .uplb {
    display: none;
  }
  #main .uplf:not(.open) > form {
    display: none;
  }
  /* التصفية: بحث وزر، والبقية عند الطلب */
  .filters:has(> .fbtn) {
    flex-wrap: wrap;
    overflow: visible;
    margin: 0 0 12px;
    padding: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .filters:has(> .fbtn) > input[type="search"] {
    flex: 1 1 0;
    min-width: 0;
  }
  .fbtn {
    display: inline-flex;
    align-items: center;
    flex: none;
  }
  .filters:has(> .fbtn):not(.open) > :not(input[type="search"], .fbtn) {
    display: none;
  }
  .filters.open:has(> .fbtn) > :not(input[type="search"], .fbtn) {
    flex: 1 1 100%;
  }
  /* التقويم على الهاتف */
  .calseg {
    display: inline-flex;
    margin-bottom: 12px;
  }
  .calhide {
    display: none;
  }
  /* أهداف لمس لا تقل عن 40 بكسل، وخط لا يقل عن 13 */
  #main .btn,
  #main .sbtn,
  #main .stg,
  #main .tab,
  #main .seg button,
  #main .seg a.segl {
    min-height: 40px;
  }
  #main .x {
    min-width: 40px;
    min-height: 40px;
  }
  #main input:not([type="checkbox"], [type="radio"], [type="date"]),
  #main select {
    min-height: 42px;
  }
  #main input[type="checkbox"] {
    width: 22px;
    height: 22px;
    flex: none;
  }
  #main .mute,
  #main .chip,
  #main .crumbs,
  #main .court,
  #main .vs,
  #main .snote,
  #main .lawtoc a,
  #main .phs code,
  #main .dgrid span,
  #main .meta > div > span.mute,
  #main .kpi > .mute:first-child,
  #main .fold .fd,
  #main .ld span {
    font-size: 13px;
  }
  table.mcards.lcmp .ld-b .mute,
  table.mcards.dcmp td.dshr::before,
  .casesum > span:last-child {
    font-size: 13px;
  }
  /* خطوة العمل: النص في سطر كامل، وأزرارها تحته */
  .list li:has(> label.row > input[type="checkbox"]) {
    flex-wrap: wrap;
  }
  /* !important لأن للخانة flex:1 مكتوبة في العنصر نفسه */
  .list li:has(> label.row > input[type="checkbox"]) > label.row {
    flex: 1 1 100% !important;
  }
  .list li:has(> label.row > input[type="checkbox"]) {
    justify-content: flex-end;
  }
  /* مكتبة النماذج: اسم الملف في سطر، وأزراره تحته بدل أن تتكدس عمودياً */
  .list li:has(> a[data-act="preview"]) {
    flex-wrap: wrap;
  }
  .list li:has(> a[data-act="preview"]) > a {
    flex: 1 1 100%;
  }
  /* حماية أخيرة: ما يتجاوز عرض الصفحة يُقص ولا يوسّع الصفحة */
  .mainwrap {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
  }
  /* الجداول على الهاتف: بطاقة لكل صف، واسم العمود بجانب كل قيمة */
  .tw:has(> table.mcards) {
    overflow: visible;
  }
  table.mcards thead {
    display: none;
  }
  table.mcards,
  table.mcards tbody,
  table.mcards tr {
    display: block;
    width: auto;
  }
  table.mcards tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px 12px;
    margin: 0 0 10px;
    background: var(--panel);
  }
  table.mcards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px dashed var(--line);
    text-align: start;
    white-space: normal;
  }
  table.mcards td:last-child {
    border-bottom: 0;
  }
  table.mcards td::before {
    content: attr(data-label);
    color: var(--mute);
    font-size: 13px;
    flex-shrink: 0;
  }
  table.mcards td[data-label=""] {
    justify-content: flex-end;
  }
  table.mcards td[data-label=""]::before {
    display: none;
  }
  table.mcards td:empty {
    display: none;
  }
  /* مسافة أسفل الصفحة تكفي لزر الإضافة العائم، فلا يغطي آخر المحتوى */
  main {
    padding-bottom: calc(160px + env(safe-area-inset-bottom));
  }
}
/* الحقل المخفي برمجياً (مثل حقول نتيجة الجلسة لغير الجلسات) يُخفى فعلاً: عرض .fl كان يغلب سمة hidden */
.fl[hidden] {
  display: none !important;
}

/* محرر الطلب على ورقة الشركة: المعاينة بطول أكبر لأنها صفحة A4 كاملة */
.ltg .pvw {
  height: 78vh;
}
.ltg .pvw iframe {
  height: calc(78vh / var(--s, 1));
}

/* القيد المالي البسيط: «دفعتُ» بالأحمر و«استلمتُ» بالأخضر */
.lform .lamt {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}
.ldir {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 12px;
}
.ld {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
}
.ld input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ld b {
  font-size: 18px;
}
.ld span {
  font-size: 12.5px;
  color: var(--mute);
  line-height: 1.6;
}
.ld.out b {
  color: var(--danger);
}
.ld.in b {
  color: var(--ok);
}
.ld.out:has(input:checked) {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}
.ld.in:has(input:checked) {
  border-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 10%, transparent);
}
.ld:has(input:focus-visible) {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
@media (max-width: 860px) {
  .ldir {
    grid-template-columns: 1fr;
  }
}

/* فترة الكشف: من / إلى وأزرار سريعة، ورصيد أول المدة وآخرها */
.perbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 12px;
}
.perbar label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.perbar .btn.on {
  border-color: var(--acc);
  color: var(--acc);
}
tr.perow td {
  font-weight: 700;
  background: var(--bg);
}
.perend {
  margin: 8px 0 0;
}

/* الاشتراك (النسخة السحابية): أشرطة الاستهلاك والميزات */
.plancard .pbar {
  margin: 10px 0;
}
.plancard .bar {
  height: 8px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 4px;
}
.plancard .bar i {
  display: block;
  height: 100%;
  background: var(--c-green);
}
.plancard .bar i.hi {
  background: var(--c-red);
}
.pfeat {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* شارة خطة الاشتراك بجانب اسم المكتب (وفي الشريط العلوي على الهاتف) */
:root {
  --pb-free-bg: #e9eef5;
  --pb-free-ink: #4b5d73;
}
@media screen {
  html.dark {
    --pb-free-bg: #253142;
    --pb-free-ink: #a9bad0;
  }
}
.pbadge {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  font:
    600 11px/1 "IBM Plex Sans Arabic",
    system-ui,
    sans-serif;
  letter-spacing: 0.03em;
  direction: ltr;
  white-space: nowrap;
  vertical-align: middle;
  cursor: default;
}
button.pbadge {
  cursor: pointer;
}
button.pbadge:hover {
  filter: brightness(1.08);
}
button.pbadge:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
.pbadge.t-free {
  background: var(--pb-free-bg);
  color: var(--pb-free-ink);
}
.pbadge.t-max {
  background: linear-gradient(135deg, #f4d98b, #c99a3a);
  color: #3a2806;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
/* القائمة الجانبية داكنة دائماً: ألوان Free الداكنة فيها */
.side .pbadge.t-free {
  background: #253142;
  color: #a9bad0;
}
.brand .bname {
  min-width: 0;
}
.pbm {
  display: none;
}
@media (max-width: 860px) {
  .pbm {
    display: inline-flex;
    align-self: center;
  }
}

/* الدعم الفني عبر واتساب (أعلى صفحة الإعدادات) */
.supcard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.supcard:hover {
  border-color: #25d366;
}
.supcard:focus-visible {
  outline: 2px solid #25d366;
  outline-offset: 2px;
}
.supic {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #25d366;
}
.supic svg {
  width: 26px;
  height: 26px;
}
.suptx {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.suptx .mute {
  font-size: 13px;
}
.supgo {
  flex: none;
  font-size: 18px;
  color: var(--mute);
}
.supcard:hover .supgo {
  color: #1da851;
}

/* حالة الاشتراك (النسخة السحابية): الشريط أعلى الصفحات وسطر الحالة في صفحة الاشتراك */
.subbar.bad {
  border-color: var(--danger);
}
.substate {
  margin: 0 0 10px;
}
.substate.trial b,
.substate.active b,
.substate.open b {
  color: var(--ok);
}
.substate.late b {
  color: var(--warn);
}
.substate.readonly b {
  color: var(--danger);
}
.paylog summary {
  cursor: pointer;
  color: var(--acc);
  margin: 6px 0;
}

/* التحقق بخطوتين: رمز QR والمفتاح */
.totpqr {
  display: flex;
  justify-content: center;
  margin: 8px 0;
}
.totpqr svg {
  border-radius: 8px;
  max-width: 100%;
  height: auto;
}
.totpkey {
  letter-spacing: 0.06em;
  font-size: 15px;
}

/* نافذة «ما الجديد» */
.news {
  margin: 4px 0 14px;
}
.news ul {
  margin: 6px 0 0;
  padding-inline-start: 20px;
  line-height: 1.8;
}

/* اسم النظام أسفل بطاقة الدخول */
.auth .authbrand {
  text-align: center;
  margin-top: 14px;
  font-size: 12px;
}
/* شعار إنكيدو فوق الاسم: قناع بلون --gold فيتبع الوضع الليلي */
.auth .authbrand::before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 4px;
  background: #c9a24a;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%23000'%3E%3Cg transform='translate(50 16) scale(.75)'%3E%3Ccircle r='9.5'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(0)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(45)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(90)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(135)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(180)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(225)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(270)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(315)'/%3E%3C/g%3E%3Crect x='47.5' y='30' width='5' height='22'/%3E%3Crect x='10' y='30' width='80' height='4.5' rx='2.2'/%3E%3Cpath d='M5 50h18a9 9 0 0 1-18 0zM77 50h18a9 9 0 0 1-18 0z'/%3E%3Crect x='40' y='52' width='20' height='10' rx='1.5'/%3E%3Crect x='30' y='64' width='40' height='11' rx='1.5'/%3E%3Crect x='20' y='77' width='60' height='12' rx='1.5'/%3E%3C/g%3E%3Cpath d='M14 34l-8 16M14 34l8 16M86 34l-8 16M86 34l8 16' stroke='%23000' stroke-width='1.8' fill='none'/%3E%3C/svg%3E")
    center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%23000'%3E%3Cg transform='translate(50 16) scale(.75)'%3E%3Ccircle r='9.5'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(0)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(45)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(90)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(135)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(180)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(225)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(270)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(315)'/%3E%3C/g%3E%3Crect x='47.5' y='30' width='5' height='22'/%3E%3Crect x='10' y='30' width='80' height='4.5' rx='2.2'/%3E%3Cpath d='M5 50h18a9 9 0 0 1-18 0zM77 50h18a9 9 0 0 1-18 0z'/%3E%3Crect x='40' y='52' width='20' height='10' rx='1.5'/%3E%3Crect x='30' y='64' width='40' height='11' rx='1.5'/%3E%3Crect x='20' y='77' width='60' height='12' rx='1.5'/%3E%3C/g%3E%3Cpath d='M14 34l-8 16M14 34l8 16M86 34l-8 16M86 34l8 16' stroke='%23000' stroke-width='1.8' fill='none'/%3E%3C/svg%3E")
    center/contain no-repeat;
}

/* شريط «ثبّت إنكيدو على جهازك» */
.instbar {
  position: fixed;
  z-index: 60;
  inset-inline: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 520px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.18);
  animation: instin 0.25s ease-out;
}
.instbar img {
  border-radius: 10px;
  flex: none;
}
.instbar .itx {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.instbar .itx span {
  color: var(--mute);
  font-size: 13px;
  line-height: 1.6;
}
.instbar .itx svg {
  vertical-align: -3px;
}
.instbar .ibt {
  display: flex;
  gap: 6px;
  flex: none;
}
@keyframes instin {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .instbar {
    animation: none;
  }
}
@media (max-width: 860px) {
  body:has(.tabbar) .instbar {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
  .instbar {
    flex-wrap: wrap;
  }
  .instbar .ibt {
    width: 100%;
    justify-content: flex-end;
  }
}
/* مساحة أسفل الصفحة ما دام الشريط ظاهراً، فلا يغطي آخر الصفحة (زر الدخول مثلاً) */
body:has(#instbar) {
  padding-bottom: 180px;
}

/* «ابدأ من هنا» في صفحة اليوم للمدير */
.startc .bar {
  height: 6px;
  border-radius: 6px;
  background: var(--line);
  overflow: hidden;
  margin: 4px 0 12px;
}
.startc .bar i {
  display: block;
  height: 100%;
  background: var(--ok);
}
.startc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.startc li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
}
.startc li > div {
  flex: 1;
  min-width: 0;
}
.startc li.next {
  background: color-mix(in srgb, var(--acc) 8%, transparent);
}
.startc li.ok b {
  color: var(--mute);
  text-decoration: line-through;
}
.startc .n {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  font-size: 13px;
}
.startc li.ok .n {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.startc li.next .n {
  border-color: var(--acc);
  color: var(--acc);
}
.startc li.skip b {
  color: var(--mute);
}
.startc .lnk {
  background: none;
  border: 0;
  padding: 4px 6px;
  color: var(--mute);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

/* مراحل المعاملات في الإعدادات */
.strows li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.strows input {
  flex: 1;
  min-width: 0;
}
.strows .num {
  min-width: 18px;
  text-align: center;
}
/* مفتاح الميزات الإضافية في الإعدادات */
label.sw {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  cursor: pointer;
  font-size: 13px;
}
label.sw input {
  width: 18px;
  height: 18px;
  accent-color: var(--ok);
}

/* البحث الموحّد: مجموعات النتائج */
.pop .gsh {
  padding: 8px 12px 2px;
  font-size: 12px;
  color: var(--mute);
  background: var(--bg);
}
.pop a:has(.gsi) {
  display: flex;
  gap: 10px;
  align-items: center;
}
.pop .gsi {
  flex: none;
}
.pop .gst {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pop .gst .mute {
  font-size: 12px;
}

/* الصفحة الفارغة التي تشرح نفسها، وتلميح أول زيارة */
.card.empty.es {
  text-align: center;
  padding: 28px 18px;
}
.es .esi {
  font-size: 40px;
  line-height: 1;
}
.es h3 {
  margin: 12px 0 6px;
}
.es p {
  margin: 0 auto 16px;
  max-width: 460px;
  line-height: 1.8;
}
.tipb {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 14px;
  line-height: 1.8;
  border-color: color-mix(in srgb, var(--acc) 45%, transparent);
  background: color-mix(in srgb, var(--acc) 9%, var(--panel));
}
.tipb > div {
  flex: 1;
}
.tipi {
  font-size: 18px;
  line-height: 1.6;
}

/* الإعدادات بقسمين */
.setsec h4 {
  margin-bottom: 4px;
}
.setrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.setrow:last-child {
  border-bottom: 0;
}
.setrow:hover {
  background: var(--bg);
}
.seti {
  font-size: 20px;
  flex: none;
}
.sett {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sett .mute {
  font-size: 13px;
}

/* علامة الحفظ */
#savest {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translate(-50%, 12px);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 90;
}
#savest.on,
#savest.ok {
  opacity: 1;
  transform: translate(-50%, 0);
}
#savest.ok {
  color: var(--ok);
}
@media (max-width: 860px) {
  #savest {
    bottom: 84px;
  }
}

/* صفحة العميل: سطر التعريف، ويحتاج انتباهك، والمعاملات والمواعيد، والمتطلبات المختصرة */
.cosub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 6px;
  font-size: 14px;
}
.cosub a {
  color: inherit;
}
.coatt,
.cogrid,
.cogrid + .card {
  margin-bottom: 16px;
}
.coatt h4 {
  margin: 0 0 10px;
}
.coatt.ok {
  padding: 12px 16px;
}
.comore {
  display: inline-block;
  margin-top: 8px;
}
details.comore summary {
  cursor: pointer;
  color: var(--mute);
}
.corow {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.corow:last-of-type {
  border-bottom: 0;
}
.corow > .row {
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
}
.corow > .mute {
  font-size: 13px;
}
.corow.ev {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.corow.ev > .chip {
  flex: none;
  min-width: 78px;
  text-align: center;
}
.corow.ev > span:last-child {
  display: flex;
  flex-direction: column;
}
.cochips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cochip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
}
.cochip.click {
  cursor: pointer;
}

/* تبويبات صفحة المعاملة */
.mpane {
  display: none;
}
.mpane.on {
  display: block;
}
/* زر رئيسي واحد: الباقي بمظهر عادي */
#main .btn.pri.pri2,
#main .btn.pri.pri2:hover {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
#mempre .btn.on {
  background: var(--acc);
  color: var(--onacc);
  border-color: var(--acc);
}
/* أزرار تخص الهاتف فقط */
@media (min-width: 861px) {
  .uplb,
  .fbtn,
  .calseg {
    display: none;
  }
}
/* صفحة الدعوى: على الحاسوب كل شيء ظاهر، وعلى الهاتف سطر مختصر يفتح الحالة والملخص */
.casefull {
  display: contents;
}
.casesum {
  display: none;
}
@media (max-width: 860px) {
  .casefull {
    display: none;
  }
  .casefull.on {
    display: contents;
  }
  .casesum {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
  }
  .casesum > span:first-child {
    min-width: 0;
  }
  .casesum > span:first-child .mute {
    display: block;
    margin-top: 3px;
  }
  .casesum > span:last-child {
    flex: none;
    font-size: 12px;
  }
}
.catseg {
  margin-bottom: 4px;
}

/* الهاتف: خانة التاريخ تتقلص مع الشاشة بدل أن توسّع الصفحة، وأهداف لمس أكبر */
@media (max-width: 860px) {
  label:has(> .dbx) {
    flex-wrap: wrap;
    max-width: 100%;
    min-width: 0;
  }
  label:has(> .dbx) > .dbx {
    flex: 1 1 150px;
    max-width: 100%;
  }
  /* داخل النماذج الخانة عمودية: الأساس 150px يصير ارتفاعاً */
  .fl:has(> .dbx) > .dbx {
    flex: 0 0 auto;
    width: 100%;
  }
  /* «ابدأ من هنا»: الزران تحت النص حتى لا يضيق */
  .startc li:has([data-act="startImport"]) {
    flex-wrap: wrap;
  }
  .startc li:has([data-act="startImport"]) > div {
    flex: 1 1 calc(100% - 44px);
  }
  .dbx > input[type="text"] {
    width: 100%;
  }
  .hbar {
    flex-wrap: wrap;
  }
  .hbar > span {
    min-width: 0 !important;
  }
  .x {
    min-width: 30px;
    min-height: 36px;
  }
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
  }
  label:has(> input[type="checkbox"]),
  label:has(> input[type="radio"]) {
    min-height: 32px;
    align-items: center;
  }
  .btn.sm {
    min-height: 34px;
  }
  .list a,
  .bc a {
    display: inline-block;
    padding-block: 6px;
  }
}

/* صفحة المكتب العامة في الإعدادات (app-site.js) */
.grid2 > .sitecard,
.grid2 > .sitef {
  grid-column: 1/-1;
}
.sitef {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
/* لا يتّسع شيء في الصفحة أكثر من الشاشة (خط الهاتف الكبير أو نص طويل بلا مسافات) */
.sitef > *,
.sitef .dgrid2 > *,
.stpls > *,
.steam > *,
.stm > *,
.sitef input,
.sitef textarea {
  min-width: 0;
  max-width: 100%;
}
.sitef,
.sitecard {
  overflow-wrap: anywhere;
}
.sitepub {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.ssw {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-weight: 600;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  padding: 4px 0;
}
.ssw > span {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #c5cbd3;
  position: relative;
  transition: background 0.2s;
}
.ssw > span::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: right 0.2s;
}
.ssw.on > span {
  background: var(--ok);
}
.ssw.on > span::after {
  right: 23px;
}
.siteurl {
  background: var(--acc2);
  color: var(--acc);
  border-radius: 10px;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 13.5px;
}
.stpls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.stp {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  text-align: right;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stp b {
  margin-top: 6px;
  font-size: 13.5px;
}
.stp .mute {
  font-size: 12px;
}
.stp.on {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc2);
}
.stp.on::after {
  content: "✓";
  position: absolute;
  top: -9px;
  left: -9px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--acc);
  color: var(--onacc);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.smini {
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e4e7ec;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.smini .smk {
  height: 16px;
  background: #0b1a2b;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: none;
}
.smini .smk img {
  width: 9px;
  height: 9px;
}
.smini .smk em {
  width: 22px;
  height: 3px;
  background: #e2c27a;
  border-radius: 2px;
}
.sm-a .h {
  background: #0b1a2b;
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.sm-a .h i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #c9a24a;
}
.sm-a .h u {
  width: 56px;
  height: 5px;
  background: #fff;
  border-radius: 3px;
}
.sm-a .s {
  background: #f5f6f8;
  flex: 1;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sm-a .s div {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 4px;
  height: 18px;
}
.sm-b {
  background: #f7f3ea;
  align-items: center;
  padding-top: 10px;
  gap: 5px;
}
.sm-b > i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0b1a2b;
  box-shadow:
    0 0 0 2px #f7f3ea,
    0 0 0 3px #c9a24a;
}
.sm-b > u {
  width: 56px;
  height: 5px;
  background: #0b1a2b;
  border-radius: 3px;
  margin-bottom: 3px;
}
.sm-b > div:not(.smk) {
  width: calc(100% - 20px);
  height: 12px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #e6dcc6;
}
.sm-b > div.k {
  background: #0b1a2b;
}
.sm-b .smk {
  align-self: stretch;
}
.sm-c .n {
  height: 14px;
  border-bottom: 1px solid #e4e7ec;
}
.sm-c .t {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sm-c .t u {
  height: 7px;
  width: 80%;
  background: #0b1a2b;
  border-radius: 3px;
}
.sm-c .t u + u {
  width: 55%;
  background: #c9a24a;
}
.sm-c .st {
  height: 18px;
  background: #0b1a2b;
  margin-top: 4px;
}
.sm-c .g {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 6px;
}
.sm-c .g div {
  height: 22px;
  border: 1px solid #e4e7ec;
  border-radius: 4px;
}
.slogo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.slogo > img,
.slogo > span {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: #0b1a2b;
  color: #e2c27a;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
  border: 2px solid #c9a24a;
}
.sitef textarea {
  width: 100%;
  line-height: 1.8;
}
.sareas {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.sareas .chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sareas .x {
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
}
.sadd {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.sadd input {
  width: 190px;
}
.steam {
  display: grid;
  gap: 4px;
}
.stm {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.stm:first-child {
  border-top: 0;
}
.stm > label {
  gap: 10px;
  min-width: min(190px, 100%);
  cursor: pointer;
}
.stm > input {
  flex: 1;
  min-width: min(180px, 100%);
}
.sav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0b1a2b;
  color: #e2c27a;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  overflow: hidden;
  flex: none;
}
.sav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sbrand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f7f3ea;
  border: 1px solid #ecdcb4;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #6d5a2c;
}
.sbrand img {
  width: 30px;
  height: 30px;
}
.snote {
  background: #fff8eb;
  border: 1px solid #f1dfb8;
  color: #7a5a17;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin: 10px 0 14px;
}
@media screen {
  html.dark .sbrand,
  html.dark .snote {
    background: var(--acc2);
    border-color: var(--line);
    color: var(--ink);
  }
}
@media (max-width: 860px) {
  .sitef .dgrid2 {
    grid-template-columns: 1fr;
  }
  .stpls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sadd {
    width: 100%;
  }
  .sadd input {
    flex: 1;
    width: auto;
  }
}

/* خطة الاشتراك: القفل على ما لا تفتحه الخطة، ونافذة الترقية، ومقارنة الخطط، ورابط الدعوة (app-plan.js) */
.plk {
  display: inline-flex;
  vertical-align: -2px;
  margin-inline-start: 6px;
  color: var(--mute);
}
.plk svg {
  width: 14px;
  height: 14px;
}
.catb.locked,
.btn.locked {
  opacity: 0.62;
}
.catb.locked:hover {
  opacity: 0.85;
}
.upg {
  background: var(--soft, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
}
.upg ul {
  margin: 6px 0 0;
  padding-inline-start: 20px;
  line-height: 1.9;
}
.plnote {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pcmp {
  margin: 12px 0;
}
.pcmp summary {
  cursor: pointer;
  padding: 6px 0;
}
.pcmp th.on,
.pcmp td.on {
  background: rgba(168, 132, 79, 0.1);
}
.pcmp td,
.pcmp th {
  text-align: center;
}
.pcmp tbody th {
  text-align: start;
  font-weight: 500;
}
.invite {
  margin: 12px 0;
  padding: 10px 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

/* المفكرة (app-notes.js): بطاقات ملوّنة بترتيب الأعمدة، ومحرر في نافذة */
:root {
  --nc-n: var(--panel, #fff);
  --nc-y: #fff4c4;
  --nc-g: #dff2e3;
  --nc-b: #dcebfb;
  --nc-p: #fbe2ea;
  --nc-v: #ece4fb;
  --nc-k: #eceef1;
}
@media screen {
  html.dark {
    --nc-y: #4a4020;
    --nc-g: #1f3b2a;
    --nc-b: #1d3250;
    --nc-p: #4a2533;
    --nc-v: #36294f;
    --nc-k: #2e333b;
  }
}
.nc-n {
  --nb: var(--nc-n);
}
.nc-y {
  --nb: var(--nc-y);
}
.nc-g {
  --nb: var(--nc-g);
}
.nc-b {
  --nb: var(--nc-b);
}
.nc-p {
  --nb: var(--nc-p);
}
.nc-v {
  --nb: var(--nc-v);
}
.nc-k {
  --nb: var(--nc-k);
}
.nnew {
  display: flex;
  gap: 8px;
  margin: 0 auto 16px;
  max-width: 640px;
}
.nquick {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--mute);
  font: inherit;
  cursor: text;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  text-align: start;
}
.nquick svg {
  width: 18px;
  height: 18px;
}
.ngrid {
  columns: 4 220px;
  column-gap: 12px;
  margin-bottom: 18px;
}
.ncard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 12px;
  padding: 14px 16px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--nb);
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition:
    box-shadow 0.15s,
    transform 0.15s;
}
.ncard:hover {
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}
.ncard b {
  font-size: 15px;
  padding-inline-end: 22px;
}
.ntx {
  margin: 0;
  white-space: pre-line;
  line-height: 1.7;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 9;
  -webkit-box-orient: vertical;
}
.ncl {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ncl li span {
  margin-inline-end: 6px;
}
.ncl li.done,
.nlist li.done [data-nli] {
  text-decoration: line-through;
  opacity: 0.6;
}
.npin {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  opacity: 0.7;
}
.npin svg {
  width: 15px;
  height: 15px;
}
.nft {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
}
.dlg.nedlg {
  background: var(--nb);
}
.nedlg .row.end {
  background: var(--nb);
}
.ntitle,
.nbody,
.nlist [data-nli] {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  outline: none;
  box-shadow: none;
}
.ntitle {
  font-size: 18px;
  font-weight: 700;
  padding: 4px 2px 10px;
}
.nbody {
  resize: none;
  min-height: 160px;
  line-height: 1.8;
  padding: 2px;
}
.nlist {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nlist li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.nlist [data-nli] {
  flex: 1;
  min-width: 0;
  resize: none;
  overflow: hidden;
  line-height: 1.6;
  padding: 6px 2px;
  min-height: 0;
}
.nlist input[type="checkbox"] {
  margin-top: 8px;
}
.nlist .x {
  flex: none;
}
.nlist input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: none;
}
.ntools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.ntools select {
  max-width: 220px;
}
.ncolors {
  display: flex;
  gap: 6px;
}
.ndot {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: var(--nb);
  cursor: pointer;
}
.ndot.on {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
:is(.side, .tabbar, .sheetnav) a[data-h="notes"] {
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.5 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2V8.5L15.5 3Z'/%3E%3Cpath d='M15 3v6h6M8 13h8M8 17h5'/%3E%3C/svg%3E");
}
@media (max-width: 860px) {
  .ngrid {
    columns: 2 150px;
    column-gap: 10px;
  }
  /* أهداف لمس مريحة على الهاتف */
  .ndot {
    width: 34px;
    height: 34px;
  }
  .ncolors {
    flex-wrap: wrap;
    gap: 8px;
  }
  .nlist li {
    gap: 10px;
    min-height: 44px;
  }
  .nlist input[type="checkbox"] {
    width: 24px;
    height: 24px;
  }
  .nlist .x {
    width: 40px;
    height: 40px;
  }
  .ntools .btn {
    min-height: 40px;
  }
  .ncard {
    margin-bottom: 10px;
    padding: 12px 12px 8px;
  }
  .ntools select {
    max-width: 100%;
    flex: 1 1 100%;
  }
}

/* المساعد (app-ai.js): فقاعات المحادثة وخانة السؤال الثابتة أسفلها */
.aichat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 820px;
  margin: 0 auto;
  min-height: calc(100dvh - 190px);
}
.aimsgs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.aim {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.aim.me {
  align-self: flex-start;
  background: var(--acc);
  color: var(--onacc);
  border-end-start-radius: 4px;
}
.aim.bot {
  align-self: flex-end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-end-end-radius: 4px;
}
.aim.err {
  align-self: flex-end;
  background: var(--panel);
  border: 1px solid var(--danger);
  color: var(--danger);
}
.aim a {
  font-weight: 600;
}
.aim.busy {
  display: flex;
  gap: 5px;
  padding: 14px 16px;
}
.aim.busy span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mute);
  animation: aidot 1s infinite ease-in-out;
}
.aim.busy span:nth-child(2) {
  animation-delay: 0.15s;
}
.aim.busy span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes aidot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .aim.busy span {
    animation: none;
  }
}
.aiform {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 0;
  background: var(--bg);
}
.aiform textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  min-height: 46px;
  max-height: 160px;
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
}
.aiform .btn {
  height: 46px;
}
.aifoot {
  text-align: center;
  font-size: 12px;
  margin: 0;
}
.aihello {
  text-align: center;
  padding: 30px 10px 10px;
}
.aihello .esi {
  font-size: 34px;
}
.aihints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.aihints .chip {
  cursor: pointer;
  padding: 8px 12px;
  font: inherit;
  font-size: 13.5px;
}
.aion {
  max-width: 640px;
  margin: 0 auto;
}
:is(.side, .tabbar, .sheetnav) a[data-h="ai"] {
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.9 4.6L18.5 9l-4.6 1.9L12 15.5l-1.9-4.6L5.5 9l4.6-1.4z'/%3E%3Cpath d='M19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8z'/%3E%3C/svg%3E");
}
@media (max-width: 860px) {
  /* الهاتف: خانة السؤال مثبتة فوق الشريط السفلي دائماً، والمحادثة تُترك لها مساحة */
  .aichat {
    min-height: 0;
    padding-bottom: 96px;
  }
  body[data-pg="ai"] .fab {
    display: none;
  }
  .aiform {
    position: fixed;
    inset-inline: 0;
    bottom: calc(64px + env(safe-area-inset-bottom));
    z-index: 6;
    padding: 8px 14px;
    border-top: 1px solid var(--line);
  }
  .aifoot {
    display: none;
  }
  .aim {
    max-width: 92%;
  }
}

/* المساعد: زر ✨ العائم، واللوحة الجانبية (من الأسفل على الهاتف)، وأزرار الرد، والمحادثات، وسياق الدعوى */
.aifab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 40;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #1e3a5f, #a8844f);
  color: #fff;
  font-size: 24px;
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.15s;
}
.aifab:hover {
  transform: scale(1.06);
}
#aipanel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 45;
  width: min(440px, 100%);
  background: var(--bg);
  border-inline-start: 1px solid var(--line);
  box-shadow: 0 0 40px -10px rgba(0, 0, 0, 0.35);
  animation: aiin 0.2s ease-out;
}
@keyframes aiin {
  from {
    transform: translateX(-24px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  #aipanel {
    animation: none;
  }
}
.aipin {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 14px;
  gap: 8px;
}
.aiph {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.aiph b {
  font-size: 16px;
}
.aichat.inpanel {
  flex: 1;
  min-height: 0;
  max-width: none;
  padding-bottom: 0;
}
.inpanel .aimsgs {
  overflow-y: auto;
  min-height: 0;
  padding: 4px 2px;
}
.inpanel .aiform {
  position: static;
  padding: 6px 0 0;
  border: 0;
}
.inpanel .aifoot {
  display: block;
}
.aiacts {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.aib {
  font: inherit;
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mute);
  cursor: pointer;
}
.aib:hover {
  color: var(--ink);
  border-color: var(--acc);
}
.aictx {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 4px 6px 4px 12px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--acc);
  font-size: 13px;
}
.aihist .list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.aimem {
  max-width: 820px;
  margin: 0 auto 10px;
}
.aimem .list li {
  display: flex;
  justify-content: space-between;
}
@media (max-width: 860px) {
  .aifab {
    left: 16px;
    bottom: calc(150px + env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
    font-size: 21px;
  }
  #aipanel {
    top: auto;
    height: 88dvh;
    width: 100%;
    border-radius: 20px 20px 0 0;
    border: 0;
    animation-name: aiup;
  }
  .aipin {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}
@keyframes aiup {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

/* اللوحة مفتوحة على الهاتف: لا تتحرك الصفحة خلفها */
@media (max-width: 860px) {
  body.aiopen {
    overflow: hidden;
  }
}

/* رأس لوحة المساعد: سطر واحد بأزرار أيقونات، والباقي من الحد تحته بخط صغير */
.aiph {
  flex-wrap: nowrap;
}
.aiphb {
  display: flex;
  gap: 4px;
  align-items: center;
}
.aiib {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  text-decoration: none;
  cursor: pointer;
}
.aiib:hover {
  border-color: var(--acc);
}
.aipl {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
}
.aipl .chip {
  font-size: 12.5px;
}
/* حالة الحفظ في محرر الملاحظة: سطر واحد بجانب الأزرار */
#nsave {
  white-space: nowrap;
  font-size: 13px;
}

/* المفكرة: التذكير، وملاحظاتي في صفحة الدعوى */
.nrem {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13.5px;
}
.nrem input {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 6px 0;
  min-width: 0;
}
.nremc {
  font-size: 12px;
}
.cnotes {
  margin-top: 14px;
}
.cnotes .ngrid {
  margin-top: 8px;
}

/* تذييل بطاقة الملاحظة: الشارات تلتف ولا تخرج من البطاقة، والتاريخ في سطر واحد */
.nft .chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nft > .mute {
  white-space: nowrap;
  margin-inline-start: auto;
}
/* الشريط السفلي وقائمة «المزيد» في الوضع الليلي: أيقونات وكتابة أوضح، والبند المختار بخلفية تميّزه */
@media screen and (max-width: 860px) {
  html.dark .tabbar a,
  html.dark .tabbar button {
    color: #c7ced8;
  }
  html.dark .tabbar .on {
    color: var(--acc);
    background: var(--acc2);
  }
  html.dark .sheetnav a::before {
    background: #c7ced8;
  }
  html.dark .sheetnav a.on::before {
    background: var(--acc);
  }
}

/* مربع إحصاء صفري في «اليوم»: خافت، فيبرز ما فيه شيء */
.kpi.kz {
  opacity: 0.55;
  box-shadow: none;
}
.calm .btn {
  margin-inline-start: auto;
}

/* أيقونات البرنامج داخل أزرار المساعد والتذكير */
.aiib svg,
.nrem svg,
.nremc svg,
.nsnooze svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.nremc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nsnooze {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--acc2);
  font-size: 13.5px;
}
/* الهاتف: المساعد داخل قائمة «+» بدل زر عائم ثانٍ */
@media (max-width: 860px) {
  .aifab {
    display: none !important;
  }
}

/* السحب للتحديث: دائرة صغيرة أعلى الشاشة تمتلئ مع السحب وتدور أثناء التحديث */
html {
  overscroll-behavior-y: contain;
}
#ptr {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  z-index: 60;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  border-radius: 50%;
  background: var(--panel);
  border: 3px solid var(--line);
  border-top-color: var(--acc);
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-50px) rotate(calc(var(--p, 0) * 300deg));
  transition: opacity 0.15s;
  pointer-events: none;
}
#ptr.on {
  opacity: 1;
  transform: translateY(calc(var(--p, 0) * 40px - 20px))
    rotate(calc(var(--p, 0) * 300deg));
}
#ptr.go {
  border-color: var(--acc);
  border-top-color: transparent;
}
#ptr.spin {
  transform: translateY(20px);
  animation: ptrspin 0.7s linear infinite;
}
@keyframes ptrspin {
  to {
    transform: translateY(20px) rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  #ptr.spin {
    animation: none;
  }
}
/* هيكل التحميل */
.skel {
  display: grid;
  gap: 12px;
}
.skel i {
  display: block;
  height: 72px;
  border-radius: 14px;
  background: var(--line);
  opacity: 0.6;
  animation: skelp 1.2s ease-in-out infinite alternate;
}
.skel i.skh {
  height: 28px;
  width: 40%;
}
@keyframes skelp {
  to {
    opacity: 0.25;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skel i {
    animation: none;
  }
}
/* الأسماء الطويلة جداً في القوائم على الهاتف: سطران ثم «…»، والاسم كاملاً في صفحته */
@media (max-width: 860px) {
  .list li > a {
    min-width: 0;
  }
  .list li > a > div:first-child {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
  }
}

/* رقم الدعوى قابل للنسخ، والعدّ التنازلي لأقرب مدة في رأس الدعوى */
.cpno {
  border: 0;
  background: transparent;
  color: var(--mute);
  padding: 4px;
  margin-inline-start: 6px;
  vertical-align: middle;
  cursor: pointer;
  border-radius: 8px;
}
.cpno:hover {
  color: var(--acc);
  background: var(--acc2);
}
.cpno svg {
  width: 18px;
  height: 18px;
}
.cdl {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
}
.cdl.red {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}
/* الجرس: مجموعة التذكيرات */
.bgrp summary {
  cursor: pointer;
  padding: 10px 14px;
  list-style: none;
}
.bgrp summary::-webkit-details-marker {
  display: none;
}
.bgrp.unread summary {
  font-weight: 600;
}
.bgrp > a {
  padding-inline-start: 26px;
}

/* ملخص «أرصدة الشركات»: ما في ذمة الشركات والمستحصل */
.balsum {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.balsum .card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
}
.balsum .card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--c);
}
.balsum .bsd {
  --c: var(--danger);
}
.balsum .bsp {
  --c: var(--ok);
}
.balsum .v {
  margin: 6px 0 4px;
  font-size: 30px;
  font-weight: 700;
  color: var(--c);
}
.balsum .v.zero {
  color: var(--mute);
  font-weight: 500;
}
@media (max-width: 860px) {
  .balsum {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .balsum .card {
    padding: 14px 16px;
  }
  .balsum .v {
    font-size: 24px;
  }
}
