/* PishkhanPlus 2.49.0 — موبایل جمع‌وجور و خلوت (≤760px). آخرین فایل CSS؛ فقط چیدمان گوشی را تغییر می‌دهد. */
@media (max-width: 760px) {
  /* ---------- نوار بالا: کوتاه‌تر ---------- */
  html body .topbar { padding: 6px 10px !important; row-gap: 6px !important; min-height: 0 !important; }
  html body .topbar .tabs { min-height: 0 !important; gap: 4px !important; }
  html body .topbar .tabs .tab, html body .topbar .tabs [role="tab"] { min-height: 32px !important; padding: 4px 10px !important; font-size: 12.5px !important; border-radius: 10px !important; }
  html body .topbar .cmd, html body .topbar input[type="search"], html body .topbar .search { min-height: 38px !important; height: 38px !important; font-size: 13px !important; }
  html body .topbar .sb, html body .topbar #gbell, html body .topbar #gpal { width: 38px !important; height: 38px !important; min-width: 38px !important; }

  /* ---------- دکمه‌های شناور: فقط اسکن کارت، کوچک و بالای نوار پایین ---------- */
  html body #ppAudioToggle, html body .pp-audio-toggle { display: none !important; }
  html body #fab.fab { display: none !important; }
  html body #p238ScanFab.p238-fab { display: none !important; width: 46px !important; height: 46px !important; min-width: 0 !important; padding: 0 !important; left: 12px !important; right: auto !important; bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important; font-size: 18px !important; border-radius: 50% !important; }
  html body #p238ScanFab.p238-fab span:not(:first-child) { display: none !important; }

  /* ---------- صفحه ---------- */
  html body #page.page, html body #page { padding: 10px 10px calc(96px + env(safe-area-inset-bottom, 0px)) !important; }
  html body #page .box { border-radius: 14px !important; }
  html body #page .box-h { padding: 10px 12px !important; }
  html body #page .box-h h2 { font-size: 14px !important; }
  html body #page .box-b { padding: 10px 12px !important; }

  /* سرصفحه هر بخش: یک ردیف عنوان + دکمه‌ها در یک ردیف قابل لغزش */
  html body #page .ph { padding: 12px !important; gap: 8px !important; border-radius: 16px !important; }
  html body #page .ph .hh-ico { display: none !important; }
  html body #page .ph h1 { font-size: 19px !important; line-height: 1.5 !important; margin: 0 !important; }
  html body #page .ph .sub { font-size: 11.5px !important; margin: 0 !important; }
  html body #page .ph kbd { display: none !important; }
  html body #page .ph > .btn, html body #page .ph .bar .btn { min-height: 38px !important; padding: 6px 12px !important; font-size: 12.5px !important; }
  html body #page .ph .bar { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto !important; gap: 6px !important; width: 100% !important; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  html body #page .ph .bar::-webkit-scrollbar { display: none; }
  html body #page .ph .bar > .btn { flex: 0 0 auto !important; width: auto !important; }
  html body #page .ph .pp-share-tools { display: none !important; }
  html body #page .ph .ix-btn span { display: inline !important; }

  /* ---------- مشتریان: بالای فهرست خلوت ---------- */
  html body #page:has(> .cx-kpis) > section.coach { display: none !important; }
  html body #page:has(> .cx-kpis) > .p238-tenure { display: none !important; }
  html body #page .v26-strip { margin: 0 0 8px !important; }
  html body #page .cx-kpis { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto !important; gap: 8px !important; padding: 2px 2px 6px !important; scroll-snap-type: x mandatory; scrollbar-width: none; grid-template-columns: none !important; }
  html body #page .cx-kpis::-webkit-scrollbar { display: none; }
  html body #page .cx-kpis > .cx-k { flex: 0 0 auto !important; min-width: 118px; min-height: 0 !important; height: auto !important; padding: 8px 12px !important; scroll-snap-align: start; border-radius: 14px !important; display: flex !important; align-items: center !important; gap: 8px !important; border-top-width: 0 !important; border-inline-start: 3px solid var(--k, #2563eb) !important; }
  html body #page .cx-kpis > .cx-k::before, html body #page .cx-kpis > .cx-k::after { display: none !important; }
  html body #page .cx-kpis > .cx-k > .cx-ki { width: 30px !important; height: 30px !important; min-width: 30px !important; font-size: 15px !important; border-radius: 9px !important; }
  html body #page .cx-kpis > .cx-k > div { display: flex !important; flex-direction: column !important; line-height: 1.35 !important; }
  html body #page .cx-kpis > .cx-k small { font-size: 11px !important; white-space: nowrap; }
  html body #page .cx-kpis > .cx-k b { font-size: 17px !important; white-space: nowrap; }
  html body #page .cx-kpis > .cx-k em, html body #page .cx-kpis > .cx-k svg, html body #page .cx-kpis > .cx-k canvas { display: none !important; }
  html body #page .cx-ai { padding: 0 !important; overflow: hidden; }
  html body #page .cx-ai > .cx-ai-h { cursor: pointer; padding: 10px 12px !important; position: relative; }
  html body #page .cx-ai > .cx-ai-h::after { content: "▾"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #64748b; transition: transform .2s; }
  html body #page .cx-ai.pp-open > .cx-ai-h::after { transform: translateY(-50%) rotate(180deg); }
  html body #page .cx-ai:not(.pp-open) > .cx-ai-l { display: none !important; }
  html body #page .cx-ai > .cx-ai-l { padding: 0 10px 10px !important; }
  html body #page .cx-tabs { margin: 8px 0 !important; }
  html body #page .grid-tools { gap: 6px !important; }
  html body #page .grid-tools .chip { min-height: 32px !important; padding: 4px 10px !important; font-size: 12px !important; }
  html body #page .grid-tools:not(.pp-open) .chip:nth-of-type(n+5) { display: none !important; }
  html body #page .grid-tools .pp-more-chips { min-height: 32px; padding: 4px 10px; font-size: 12px; border-radius: 99px; border: 1px dashed #94a3b8; background: transparent; color: inherit; font-family: inherit; }
  html body #page .grid-tools [data-gcols] { display: none !important; }

  /* ---------- مشتریان: هر مشتری یک ردیف فشرده (نه کارت بزرگ) ---------- */
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody { display: flex !important; flex-direction: column !important; gap: 0 !important; background: var(--gl-glass-strong, #fff); border-radius: 14px; overflow: hidden; border: 1px solid var(--gl-hair, #e2e8f0); }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] { display: grid !important; grid-template-columns: minmax(0, 1fr) auto !important; align-items: center !important; column-gap: 8px !important; row-gap: 1px !important; padding: 9px 12px !important; border: 0 !important; border-bottom: 1px solid var(--gl-hair, #eef1f6) !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; min-height: 60px; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust]:last-child { border-bottom: 0 !important; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] > td:first-child { grid-column: 1 / -1 !important; grid-row: 1; display: flex !important; align-items: center !important; gap: 8px !important; padding: 0 !important; margin: 0 !important; border: 0 !important; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] > td:first-child .who { flex: 1 1 auto; min-width: 0; display: flex !important; align-items: center; gap: 9px !important; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] > td:first-child .who .av { width: 34px !important; height: 34px !important; min-width: 34px !important; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] > td:first-child .who b { font-size: 13.5px !important; font-weight: 700 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] .p2384-row-tenure,
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] .p2385-contact-share,
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] .cpf-qm { display: none !important; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] .p2384-row-contact { flex: 0 0 auto; margin: 0 !important; gap: 4px !important; flex-wrap: nowrap !important; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] .p2384-row-contact a { width: 34px; height: 34px; min-height: 0 !important; padding: 0 !important; border-radius: 50% !important; font-size: 0 !important; display: grid !important; place-items: center; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] .p2384-row-contact a::before { font-size: 15px; line-height: 1; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] .p2384-row-contact a[href^="tel:"]::before { content: "📞"; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] .p2384-row-contact a[href^="sms:"]::before { content: "✉️"; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] .p2384-row-contact a[href*="wa.me"]::before { content: "💬"; }
  /* خط دوم: موبایل · سطح — کنار هم و کم‌رنگ */
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] > td[data-label="تلفن همراه"],
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] > td[data-label="امتیاز / سطح"] { display: inline-block !important; grid-row: 2; padding: 0 43px 0 0 !important; font-size: 11px !important; line-height: 1.6 !important; color: var(--muted, #64748b) !important; border: 0 !important; width: auto !important; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] > td[data-label="تلفن همراه"] { grid-column: 1; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] > td[data-label="امتیاز / سطح"] { grid-column: 2; padding: 0 !important; text-align: left !important; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] > td[data-label="امتیاز / سطح"] .sub { display: none !important; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] > td[data-label="مانده (ریال)"],
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] > td[data-label="مدت عضویت"] { display: none !important; }

  /* ---------- پرونده مشتری ---------- */
  html body #page .cpf-hero { padding: 12px !important; gap: 8px 12px !important; border-radius: 16px !important; }
  html body #page .cpf-hero h1, html body #page .cpf-hero h2 { font-size: 18px !important; }
  html body #page .cpf-hero .av { width: 58px !important; height: 58px !important; }
  html body #page .cpf-act { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto !important; gap: 6px !important; scrollbar-width: none; }
  html body #page .cpf-act::-webkit-scrollbar { display: none; }
  html body #page .cpf-act > * { flex: 0 0 auto !important; min-height: 0 !important; height: auto !important; padding: 7px 11px !important; border-radius: 99px !important; font-size: 12px !important; display: inline-flex !important; flex-direction: row !important; gap: 5px !important; align-items: center !important; color: #fff !important; white-space: nowrap; }
  html body #page .cpf-act > * * { color: inherit !important; font-size: inherit !important; }
  html body #page .cpf-act > * :is(svg, img) { width: 15px !important; height: 15px !important; }
  html body #page :is(.cpf-k, .cpf-kpis > *, .cpf-stats > *) { padding: 10px 11px !important; min-height: 0 !important; }

  /* ---------- جدول‌های عمومی و فرم‌ها ---------- */
  html body #page .ac-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html body #page .ac-kpi > div { padding: 9px 10px !important; }
  html body #page .ac-kpi b { font-size: 13px !important; }
  html body .dlg .field, html body .dlg input, html body .dlg select { font-size: 16px !important; } /* iOS: بدون زوم خودکار */
}
@media (max-width: 380px) {
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] .p2384-row-contact a { width: 30px; height: 30px; }
  html body #page .tw:has(table.g tbody tr[data-cust]) tbody > tr[data-cust] .p2384-row-contact a[href*="wa.me"] { display: none !important; }
}
@media (max-width: 760px) {
  html body #page .grid-tools { flex-wrap: wrap !important; }
  html body #page .grid-tools input[type="search"], html body #page .grid-tools [data-gq] { flex: 1 1 100% !important; max-width: none !important; min-width: 0 !important; min-height: 40px !important; font-size: 14px !important; order: -1; }
}
