/*
 * PM TECH — الغلاف الموحد للتطبيقات
 * كل مساحة عمل تُعرض كواجهة هاتف أصلية من دون رسم إطار هاتف صناعي.
 */
:root {
  --pm-phone-navy: #0B3472;
  --pm-phone-blue: #087AF1;
  --pm-phone-sky: #EAF5FF;
  --pm-phone-green: #52B534;
  --pm-phone-ink: #173A70;
  --pm-phone-muted: #718096;
  --pm-phone-line: #E7EEF6;
  --pm-phone-card: #FFFFFF;
  --pm-phone-shadow: 0 8px 22px rgba(18, 61, 108, .08);
}

html:has(body.phone-shell) { background: #F6FAFE; }

body.phone-shell { min-width: 320px; min-height: 100%; height: auto !important; overflow-x: hidden; overflow-y: auto; margin: 0;
  color: var(--pm-phone-ink);
  background:
    radial-gradient(circle at 96% 0%, rgba(184, 228, 255, .68), transparent 21rem),
    linear-gradient(180deg, #FFFFFF 0%, #F5FAFF 100%);
  font-family: Cairo, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.phone-shell *,
body.phone-shell button,
body.phone-shell input,
body.phone-shell select,
body.phone-shell textarea { font-family: inherit; }

/* يحافظ على العرض المقصود للتطبيق في المتصفح كما في الهاتف الحقيقي. */
body.phone-shell .sales-app-wrapper,
body.phone-shell .dash-layout-container,
body.phone-shell .screen-admin,
body.phone-shell .pl-shell,
body.phone-shell .stitch-creator-app {
  width: min(100%, 440px);
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  margin-right: auto;
  margin-left: auto;
}

/* صانع المساعد: احتفظ بالخطوات لكن أزل شكل بطاقة سطح المكتب. */
body.creator-shell .stitch-creator-app {
  display: block;
  padding: 0;
  overflow: hidden;
  background: transparent;
}

body.creator-shell .stitch-container {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: rgba(255, 255, 255, .98);
}

body.creator-shell .stitch-topbar,
body.creator-shell .stitch-nav-bar,
body.creator-shell .stitch-footer-action {
  background: rgba(255, 255, 255, .96);
  border-color: var(--pm-phone-line);
}

/* بعض خطوات صانع المساعد أطول من الشاشة؛ التمرير يكون على الصفحة لا داخل إطار مقفل. */
@media (max-width: 639px) {
  html:has(body.creator-shell), body.creator-shell { height:auto; min-height:100dvh; overflow-y:auto !important; }
  body.creator-shell .stitch-creator-app { min-height:100dvh; height:auto; overflow:visible !important; }
  body.creator-shell .stitch-container { height:auto; min-height:100dvh; max-height:none; overflow:visible !important; }
  body.creator-shell .stitch-screen { min-height:100dvh; height:auto; }
  body.creator-shell .stitch-body-scroll { overflow:visible; flex:none; padding-bottom:96px; }
}

/* التطبيق يمرر صفحته طبيعياً، بينما نافذة PM فقط تملك تمرير الرسائل الداخلي. */
@media (max-width: 767px) {
  html:has(body.phone-shell), body.phone-shell { height:auto !important; min-height:100dvh; overflow-x:hidden; overflow-y:auto !important; }
  body.phone-shell.tool-phone .pl-shell,
  body.phone-shell.tool-phone .sd-shell,
  body.phone-shell.tool-phone .dvs-shell { min-height:100dvh; height:auto; overflow:visible !important; }
  body.phone-shell .unified-assistant-screen { touch-action:pan-y; overscroll-behavior:contain; }
  body.phone-shell .unified-assistant-screen .pl-chat-messages,
  body.phone-shell .unified-assistant-screen .sd-chat-messages,
  body.phone-shell .unified-assistant-screen .page-assistant-messages { -webkit-overflow-scrolling:touch; touch-action:pan-y; }
}

/* صفحات الدخول والتسجيل قابلة للتمرير دائماً على الشاشات القصيرة */
@media (max-width: 767px) {
  html:has(body.phone-auth), body.phone-auth,
  html:has(body.auth-page-body), body.auth-page-body {
    height: auto !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }
  body.phone-auth .auth-page-content,
  body.auth-page-body .auth-page-content,
  body.phone-auth main,
  body.auth-page-body main,
  body.phone-auth .auth-card,
  body.auth-page-body .auth-card,
  body.phone-auth .login-card,
  body.auth-page-body .login-card,
  body.phone-auth .register-card,
  body.auth-page-body .register-card {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  body.phone-auth .auth-page-content,
  body.auth-page-body .auth-page-content {
    padding-top: 14px !important;
    padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  }
}

/* مساحة معاينة الشاسيه على سطح المكتب: لوحة واضحة وارتفاع ثابت بلا تراكب */
@media (min-width: 768px) {
  body.phone-shell.tool-phone.solar-determiner-body #pane-3d {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    min-height: 0;
    height: auto !important;
    overflow: visible !important;
  }
  body.phone-shell.tool-phone.solar-determiner-body #pane-3d .sd-3d-viewport-card {
    width: 100%;
    min-height: 590px;
    overflow: hidden;
  }
  body.phone-shell.tool-phone.solar-determiner-body #pane-3d #three-canvas-container {
    width: 100% !important;
    height: 560px !important;
    min-height: 560px;
  }
  body.phone-shell.tool-phone.solar-determiner-body #pane-3d .sd-3d-legend-bar,
  body.phone-shell.tool-phone.solar-determiner-body #pane-3d .sd-3d-details-grid { position: relative; clear: both; }
  body.phone-shell.tool-phone.solar-determiner-body #pane-3d .sd-3d-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

body.creator-shell .stitch-title,
body.creator-shell .stitch-heading h2,
body.creator-shell .stitch-card-body h3,
body.creator-shell .stitch-field-label { color: var(--pm-phone-navy); }

body.creator-shell .stitch-btn-primary {
  background: linear-gradient(135deg, var(--pm-phone-navy), var(--pm-phone-blue));
  box-shadow: 0 9px 20px rgba(8, 102, 216, .22);
}

body.creator-shell .stitch-card-item,
body.creator-shell .stitch-choice-card,
body.creator-shell .stitch-showcase-card,
body.creator-shell .stitch-capability-card {
  border-color: var(--pm-phone-line);
  box-shadow: 0 5px 15px rgba(18, 61, 108, .05);
}

body.creator-shell .stitch-card-item.is-selected,
body.creator-shell .stitch-choice-card.is-selected {
  border-color: var(--pm-phone-blue);
  background: #F1F8FF;
}

/* تسجيل الزائر: نفس ألوان البوابة الرئيسية مع شريط متابعة واضح. */
body.phone-shell.sales-mode {
  --sales-bg: #F5FAFF;
  --sales-blue: var(--pm-phone-blue);
  --sales-blue-hover: #0668D1;
  --sales-blue-soft: #EAF5FF;
  --sales-border: var(--pm-phone-line);
  --sales-navy: var(--pm-phone-navy);
  --sales-green: var(--pm-phone-green);
  background:
    radial-gradient(circle at 100% 0%, rgba(184, 228, 255, .72), transparent 21rem),
    #F5FAFF;
}

body.phone-shell .sales-app-wrapper {
  max-width: 440px;
  padding: max(8px, env(safe-area-inset-top)) 14px calc(84px + env(safe-area-inset-bottom));
  background: transparent;
}

body.phone-shell .sales-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 48px;
  margin: 0 0 10px;
  padding: 7px 4px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 5px 16px rgba(19, 71, 128, .08);
  backdrop-filter: blur(12px);
}

body.phone-shell .sales-brand-logo { height: 28px; }
body.phone-shell .sales-brand-text h1 { color: var(--pm-phone-navy); font-size: 14px; }
body.phone-shell .sales-brand-text p,
body.phone-shell .sales-top-actions .sales-link-btn:nth-of-type(2) { display: none; }
body.phone-shell .sales-top-actions { gap: 5px; }
body.phone-shell .sales-topbar .sales-link-btn,
body.phone-shell .sales-topbar .sales-rep-active-pill,
body.phone-shell .sales-topbar .sales-header-followup { border-color: #DDEBFA; background: #F4F9FF; color: var(--pm-phone-navy); }

body.phone-shell .sales-mobile-brief {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 11px 13px;
  border-radius: 17px;
  color: #FFF;
  background: linear-gradient(135deg, var(--pm-phone-navy), var(--pm-phone-blue));
  box-shadow: 0 10px 22px rgba(7, 104, 213, .22);
}

body.phone-shell .sales-mobile-brief-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: rgba(255,255,255,.16); }
body.phone-shell .sales-mobile-brief strong { display: block; font-size: 13px; }
body.phone-shell .sales-mobile-brief small { display: block; font-size: 10px; opacity: .85; }
body.phone-shell .sales-mobile-brief b { margin-inline-start: auto; font-size: 11px; }

body.phone-shell .sales-stepper-container {
  position: static;
  margin: 0 0 10px;
  padding: 6px 2px 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.phone-shell .stepper-header-row { justify-content: center; }
body.phone-shell .stepper-title-area { width: 100%; justify-content: center; }
body.phone-shell .step-main-title { color: var(--pm-phone-navy); font-size: 18px; }
body.phone-shell .step-number-badge,
body.phone-shell .stepper-nav-controls { display: none; }
body.phone-shell .stepper-progress-track { margin-top: 9px; padding: 0 22px; }
body.phone-shell .stepper-bar-segment.active { background: var(--pm-phone-blue); }

body.phone-shell .category-cards-grid { gap: 8px; }
body.phone-shell .category-choice-card {
  min-height: 114px;
  padding: 11px 8px;
  border-color: var(--pm-phone-line);
  border-radius: 17px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 5px 15px rgba(18, 61, 108, .055);
}
body.phone-shell .category-card-icon { width: 39px; height: 39px; margin-bottom: 6px; color: var(--pm-phone-navy); background: #EEF6FE; }
body.phone-shell .category-card-title { color: var(--pm-phone-navy); font-size: 12px; }
body.phone-shell .category-choice-card.active { border-color: var(--pm-phone-blue); background: #F2F8FF; }
body.phone-shell .interests-grid,
body.phone-shell .stage-cards-grid { gap: 8px; }
body.phone-shell .interest-item-card,
body.phone-shell .stage-choice-card,
body.phone-shell .contact-form-card {
  border-color: var(--pm-phone-line);
  border-radius: 17px;
  box-shadow: 0 5px 15px rgba(18, 61, 108, .055);
}
body.phone-shell .contact-form-card { padding: 15px; background: rgba(255,255,255,.98); }
body.phone-shell .form-grid-2cols { grid-template-columns: 1fr; gap: 12px; }
body.phone-shell .sales-text-input,
body.phone-shell .sales-select-input { min-height: 50px; border-color: #D8E7F5; border-radius: 13px; background: #F8FBFF; font-size: 16px; }
body.phone-shell .quick-gov-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
body.phone-shell .quick-gov-pill { min-height: 38px; padding: 6px; font-size: 10px; }
body.phone-shell .btn-sales-next {
  position: static !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  z-index: auto;
  width: 100%;
  margin-top: 12px;
  min-height: 54px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--pm-phone-navy), var(--pm-phone-blue));
  box-shadow: 0 12px 27px rgba(7, 104, 213, .28);
}

/* لوحات المبيعات والإدارة. */
body.phone-shell.dashboard-body {
  --dash-bg: #F5FAFF;
  --dash-navy: var(--pm-phone-navy);
  --dash-blue: var(--pm-phone-blue);
  --dash-blue-soft: #EAF5FF;
  --dash-border: var(--pm-phone-line);
  --dash-green: var(--pm-phone-green);
  background:
    radial-gradient(circle at 100% 0%, rgba(184,228,255,.66), transparent 22rem),
    #F5FAFF;
}

body.phone-shell.dashboard-body .dash-layout-container {
  display: block;
  max-width: 440px;
  background: transparent;
}

body.phone-shell.dashboard-body .dash-sidebar { display: none !important; }

body.phone-shell.dashboard-body .dash-main-content {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  padding: max(8px, env(safe-area-inset-top)) 14px calc(82px + env(safe-area-inset-bottom));
  gap: 12px;
  overflow: visible;
}

body.phone-shell.dashboard-body .dash-header-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  min-height: 46px;
  margin: 0 -2px;
  padding: 6px 4px;
  border: 0;
  border-radius: 0;
  background: rgba(255,255,255,.94);
  box-shadow: 0 5px 15px rgba(19, 71, 128, .07);
  backdrop-filter: blur(12px);
}

body.phone-shell.dashboard-body .dash-header-logo { height: 27px; }
body.phone-shell.dashboard-body .dash-header-titles { text-align: center; min-width: 0; }
body.phone-shell.dashboard-body .dash-header-titles h1 { overflow: hidden; color: var(--pm-phone-navy); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
body.phone-shell.dashboard-body .dash-header-titles p,
body.phone-shell.dashboard-body .dash-expo-pill,
body.phone-shell.dashboard-body .dash-user-pill > span:not(.avatar-circle) { display: none; }
body.phone-shell.dashboard-body .dash-user-pill { width: 36px; height: 36px; padding: 0; justify-content: center; border: 1px solid #DDEBFA; border-radius: 50%; background: #F2F8FF; }
body.phone-shell.dashboard-body .dash-user-pill .avatar-circle { width: 28px; height: 28px; }

body.phone-shell.dashboard-body .dash-kpi-grid-5,
body.phone-shell.dashboard-body .dash-kpi-grid-4 {
  display: flex;
  gap: 9px;
  margin: 0 -14px;
  padding: 2px 14px 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
body.phone-shell.dashboard-body .dash-kpi-grid-5::-webkit-scrollbar,
body.phone-shell.dashboard-body .dash-kpi-grid-4::-webkit-scrollbar { display: none; }
body.phone-shell.dashboard-body .dash-kpi-grid-5 .dash-kpi-card,
body.phone-shell.dashboard-body .dash-kpi-grid-4 .dash-kpi-card { flex: 0 0 52%; min-width: 0; scroll-snap-align: start; border-radius: 17px; box-shadow: var(--pm-phone-shadow); }
body.phone-shell.dashboard-body .dash-bottom-grid,
body.phone-shell.dashboard-body .dash-bottom-grid--two,
body.phone-shell.dashboard-body .dash-middle-grid { grid-template-columns: 1fr; gap: 12px; }
body.phone-shell.dashboard-body .dash-panel-card,
body.phone-shell.dashboard-body .dash-card-section,
body.phone-shell.dashboard-body .sales-clients-table-card,
body.phone-shell.dashboard-body .dash-bottom-actions-bar { border-color: var(--pm-phone-line); border-radius: 18px; box-shadow: var(--pm-phone-shadow); }
body.phone-shell.dashboard-body .panel-title-group h2 { color: var(--pm-phone-navy); font-size: 16px; }
body.phone-shell.dashboard-body .table-scroll-desktop { display: none !important; }
body.phone-shell.dashboard-body .lead-mobile-list,
body.phone-shell.dashboard-body .team-mobile-list { display: block !important; }

body.phone-shell.dashboard-body .tg-bottom-nav {
  position: fixed;
  right: 50%;
  left: auto;
  z-index: 80;
  display: flex;
  width: min(100%, 440px);
  padding: 6px 5px calc(6px + env(safe-area-inset-bottom));
  transform: translateX(50%);
  border-top: 1px solid var(--pm-phone-line);
  background: rgba(255,255,255,.97);
  box-shadow: 0 -6px 17px rgba(19, 60, 113, .07);
}
body.phone-shell.dashboard-body .tg-tab { color: #7C8999; }
body.phone-shell.dashboard-body .tg-tab.active { color: var(--pm-phone-green); }
body.phone-shell.dashboard-body .tg-tab.active .tg-tab-icon { background: #EAF8E5; }
body.phone-shell.dashboard-body .tg-tab.active .tg-tab-icon svg { stroke: var(--pm-phone-green); }

/* مختبر اختيار الطلمبات. */
body.phone-shell.pump-lab-body {
  --pl-primary: var(--pm-phone-blue);
  --pl-primary-dark: var(--pm-phone-navy);
  --pl-primary-light: #EAF5FF;
  --pl-accent: var(--pm-phone-green);
  --pl-bg: #F5FAFF;
  --pl-border: var(--pm-phone-line);
  background: #F5FAFF;
}

body.phone-shell.pump-lab-body .pl-shell { max-width: 440px; padding: max(8px, env(safe-area-inset-top)) 14px 22px; }
body.phone-shell.pump-lab-body .pl-header { margin-bottom: 10px; padding: 9px 5px; border: 0; border-radius: 0; box-shadow: 0 5px 15px rgba(19, 71, 128, .07); }
body.phone-shell.pump-lab-body .pl-header-brand img { height: 28px; }
body.phone-shell.pump-lab-body .pl-header-title strong { color: var(--pm-phone-navy); font-size: 14px; }
body.phone-shell.pump-lab-body .pl-header-title span { display: none; }
body.phone-shell.pump-lab-body .pl-btn-secondary { padding: 8px 10px; border-radius: 12px; }
body.phone-shell.pump-lab-body .pl-mode-tabs { margin-bottom: 10px; border-radius: 14px; background: #EAF2FA; }
body.phone-shell.pump-lab-body .pl-tab-btn { padding: 9px 6px; font-size: 12px; }
body.phone-shell.pump-lab-body .pl-tab-btn.active { color: var(--pm-phone-navy); }
body.phone-shell.pump-lab-body .pl-chat-card,
body.phone-shell.pump-lab-body .pl-form-card,
body.phone-shell.pump-lab-body .pl-result-card { border-color: var(--pm-phone-line); border-radius: 18px; box-shadow: var(--pm-phone-shadow); }

/* استوديو تشغيل شاشة المعرض يصبح أيضاً عملياً على الهاتف — هذه القواعد للهاتف فقط ولا تمس سطح المكتب. */
@media (max-width: 768px) {
  body.phone-shell.screen-admin-shell .screen-admin {
    max-width: 440px;
    padding: max(12px, env(safe-area-inset-top)) 14px calc(82px + env(safe-area-inset-bottom));
    overflow: visible;
    background: transparent;
  }
  body.phone-shell.screen-admin-shell .studio-header { padding: 5px 0 18px; }
  body.phone-shell.screen-admin-shell .studio-brand img { width: 118px; }
  body.phone-shell.screen-admin-shell .studio-brand > span:last-child,
  body.phone-shell.screen-admin-shell .text-button { display: none; }
  body.phone-shell.screen-admin-shell .studio-hero { flex-direction: column; align-items: stretch; gap: 12px; padding: 3px 0 18px; }
  body.phone-shell.screen-admin-shell .studio-hero h1 { font-size: 28px; }
  body.phone-shell.screen-admin-shell .live-status-card { width: auto; min-width: 0; }
  body.phone-shell.screen-admin-shell .overview-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin-bottom: 15px; }
  body.phone-shell.screen-admin-shell .overview-card { min-height: 112px; padding: 13px; border-radius: 17px; }
  body.phone-shell.screen-admin-shell .overview-card strong { font-size: 23px; }
  body.phone-shell.screen-admin-shell .overview-card .leader-name,
  body.phone-shell.screen-admin-shell .overview-card .mode-name { font-size: 15px; }
  body.phone-shell.screen-admin-shell .admin-card { padding: 16px 13px; margin-bottom: 14px; border-color: var(--pm-phone-line); border-radius: 18px; box-shadow: var(--pm-phone-shadow); }
  body.phone-shell.screen-admin-shell .card-heading { flex-direction: column; gap: 9px; margin-bottom: 14px; }
  body.phone-shell.screen-admin-shell .card-heading h2 { color: var(--pm-phone-navy); font-size: 18px; }
  body.phone-shell.screen-admin-shell .settings-grid { grid-template-columns: 1fr; gap: 12px; }
  body.phone-shell.screen-admin-shell .playlist-row { grid-template-columns: 42px 45px minmax(0,1fr) 66px; gap: 7px; min-height: 72px; }
  body.phone-shell.screen-admin-shell .slide-type-preview { width:42px; height:40px; }
  body.phone-shell.screen-admin-shell .slide-copy small { display:none; }
  body.phone-shell.screen-admin-shell .slide-copy input { font-size: 11px; }
  body.phone-shell.screen-admin-shell .slide-duration input { width: 40px; }
  body.phone-shell.screen-admin-shell .switch-control { grid-column: 3 / 4; }
  body.phone-shell.screen-admin-shell .playlist-actions { grid-column: 4 / 5; grid-row: 2; flex-direction: column; padding: 0; }
  body.phone-shell.screen-admin-shell .row-save,
  body.phone-shell.screen-admin-shell .row-delete { min-height: 24px; padding: 0 6px; font-size: 9px; }
  body.phone-shell.screen-admin-shell .governors-head { display:none; }
  body.phone-shell.screen-admin-shell .governor-row { grid-template-columns: minmax(105px,1fr) 55px 65px; gap: 7px; padding: 9px 1px; }
  body.phone-shell.screen-admin-shell .boost-buttons { grid-column:1 / -1; grid-row:2; }
  body.phone-shell.screen-admin-shell .save-bar { right: max(9px, calc((100vw - 440px) / 2 + 9px)); left: max(9px, calc((100vw - 440px) / 2 + 9px)); bottom: 8px; }
  body.phone-shell.screen-admin-shell .save-bar p { display:none; }
}

/* شاشات الدخول مستقلة عن قالب Blade العام لكنها تستخدم لغة التطبيق نفسها. */
body.phone-auth {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 18px;
}
body.phone-auth main {
  width: min(100%, 404px);
  box-sizing: border-box;
  padding: 28px 22px;
  border: 1px solid var(--pm-phone-line);
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--pm-phone-shadow);
}
body.phone-auth main img { width: min(168px, 58vw); }
body.phone-auth main h1 { color: var(--pm-phone-navy); font-size: 20px; }
body.phone-auth main p { color: var(--pm-phone-muted); }
body.phone-auth main input { min-height: 48px; border-color: #D8E7F5; border-radius: 13px; background: #F8FBFF; }
body.phone-auth main button { min-height: 50px; border-radius: 14px; background: linear-gradient(135deg, var(--pm-phone-navy), var(--pm-phone-blue)); box-shadow: 0 9px 20px rgba(7, 104, 213, .21); }

@media (max-width: 380px) {
  body.phone-shell .sales-app-wrapper,
  body.phone-shell.dashboard-body .dash-main-content,
  body.phone-shell.pump-lab-body .pl-shell { padding-right: 11px; padding-left: 11px; }
  body.phone-shell .category-choice-card { min-height: 105px; }
  body.phone-shell .category-card-title { font-size: 11px; }
  body.phone-shell.dashboard-body .dash-kpi-grid-5 .dash-kpi-card,
  body.phone-shell.dashboard-body .dash-kpi-grid-4 .dash-kpi-card { flex-basis: 61%; }
}

/* الأدوات الهندسية: شاشة تطبيق واحدة بدلاً من لوحة سطح مكتب مصغرة. */
body.phone-shell.tool-phone {
  background:
    radial-gradient(circle at 100% 0%, rgba(183, 228, 255, .62), transparent 22rem),
    linear-gradient(180deg, #fff 0%, #F5FAFF 100%);
}

body.phone-shell.tool-phone .sd-shell,
body.phone-shell.tool-phone .dvs-shell,
body.phone-shell.tool-phone .pl-shell {
  width: min(100%, 440px);
  min-height: 100dvh;
  box-sizing: border-box;
  margin: 0 auto;
  padding: max(7px, env(safe-area-inset-top)) 14px calc(90px + env(safe-area-inset-bottom));
  background: transparent;
}

body.phone-shell.tool-phone .mobile-tool-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  min-height: 52px;
  margin: 0 -3px 11px;
  padding: 5px 3px;
  border: 0;
  border-bottom: 1px solid rgba(223, 235, 247, .86);
  border-radius: 0;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 5px 15px rgba(19, 71, 128, .07);
  backdrop-filter: blur(14px);
}

body.phone-shell.tool-phone .mobile-tool-nav {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  justify-self: center;
  padding: 0;
  border: 0;
  border-radius: 13px;
  color: var(--pm-phone-navy);
  background: #F1F7FD;
  text-decoration: none;
  cursor: pointer;
}

body.phone-shell.tool-phone .mobile-tool-nav svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.phone-shell.tool-phone .mobile-tool-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 7px;
  color: var(--pm-phone-navy);
  text-decoration: none;
}

body.phone-shell.tool-phone .mobile-tool-brand img { width: 87px; max-height: 32px; object-fit: contain; }
body.phone-shell.tool-phone .mobile-tool-brand span { overflow: hidden; font-size: 12px; font-weight: 900; white-space: nowrap; text-overflow: ellipsis; }

body.phone-shell.tool-phone .mobile-tool-toolbar {
  position: fixed;
  right: 50%;
  bottom: 0;
  z-index: 100;
  width: min(100%, 440px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  box-sizing: border-box;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  transform: translateX(50%);
  border-top: 1px solid #E3EDF7;
  background: rgba(255,255,255,.97);
  box-shadow: 0 -7px 18px rgba(19, 60, 113, .08);
  backdrop-filter: blur(15px);
}

body.phone-shell.tool-phone .mobile-tool-tab {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 49px;
  padding: 2px 3px;
  border: 0;
  color: #7A889A;
  background: transparent;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

body.phone-shell.tool-phone .mobile-tool-tab svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.phone-shell.tool-phone .mobile-tool-tab.active { color: var(--pm-phone-green); }
body.phone-shell.tool-phone .mobile-tool-tab.active svg { filter: drop-shadow(0 2px 4px rgba(79, 177, 47, .2)); }

/* محدد الطاقة الشمسية */
body.phone-shell.tool-phone.solar-determiner-body .sd-shell { max-width: 440px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-mode-switch {
  position: sticky;
  top: 63px;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 0 -2px 11px;
  padding: 5px;
  border: 1px solid #E0ECF7;
  border-radius: 15px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 5px 14px rgba(19, 71, 128, .06);
}
body.phone-shell.tool-phone.solar-determiner-body .sd-mode-btn { min-width: 0; min-height: 45px; padding: 6px 3px; border-radius: 11px; font-size: 10px; line-height: 1.25; }
body.phone-shell.tool-phone.solar-determiner-body .sd-mode-btn svg { width: 17px; height: 17px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-form-pane,
body.phone-shell.tool-phone.solar-determiner-body .sd-3d-details-grid { grid-template-columns: 1fr; gap: 11px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-card { padding: 15px 13px; border-color: var(--pm-phone-line); border-radius: 18px; box-shadow: var(--pm-phone-shadow); }
body.phone-shell.tool-phone.solar-determiner-body .sd-card-title { margin-bottom: 12px; padding-bottom: 8px; color: var(--pm-phone-navy); font-size: 15px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-field-group { margin-bottom: 12px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-input,
body.phone-shell.tool-phone.solar-determiner-body .sd-select { min-height: 46px; border-radius: 12px; font-size: 13px; background: #FBFDFF; }
body.phone-shell.tool-phone.solar-determiner-body .sd-grid-2 { grid-template-columns: 1fr; gap: 0; }
body.phone-shell.tool-phone.solar-determiner-body .sd-presets { gap: 6px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-preset-pill { min-height: 31px; padding: 5px 8px; border-radius: 10px; font-size: 10px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-btn-calc { position: sticky; bottom: 75px; z-index: 20; min-height: 50px; border-radius: 15px; box-shadow: 0 10px 22px rgba(7, 104, 213, .22); }
body.phone-shell.tool-phone.solar-determiner-body .sd-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-kpi-box { min-height: 88px; padding: 10px; border-radius: 13px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-kpi-val { font-size: 16px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-spec-row { display: grid; grid-template-columns: minmax(88px, .7fr) 1fr; gap: 7px; padding: 9px 0; }
body.phone-shell.tool-phone.solar-determiner-body .sd-spec-key,
body.phone-shell.tool-phone.solar-determiner-body .sd-spec-val { font-size: 11px; line-height: 1.6; }
body.phone-shell.tool-phone.solar-determiner-body .sd-yield-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-yield-item { padding: 9px; border-radius: 11px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-yield-item span,
body.phone-shell.tool-phone.solar-determiner-body .sd-yield-item strong { font-size: 10px; line-height: 1.5; }
body.phone-shell.tool-phone.solar-determiner-body .sd-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-actions-row .sd-btn-act:last-child { grid-column: 1 / -1; }
body.phone-shell.tool-phone.solar-determiner-body .sd-report-lang-bar { align-items: start; flex-direction: column; gap: 7px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-report-lang-pills { width: 100%; overflow-x: auto; }
body.phone-shell.tool-phone.solar-determiner-body .sd-3d-pane { gap: 11px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-3d-viewport-card { min-height: 292px; border-radius: 18px; }
body.phone-shell.tool-phone.solar-determiner-body #three-canvas-container { min-height: 292px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-3d-hud { top: 8px; right: 8px; left: 8px; gap: 5px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-hud-pill { padding: 5px 7px; font-size: 9px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-3d-toolbar { align-items: stretch; flex-direction: column; gap: 8px; padding: 9px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-camera-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-cam-btn { min-width: 0; padding: 6px; font-size: 9px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-tilt-controller { justify-content: space-between; font-size: 10px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-chat-pane { min-height: calc(100dvh - 190px); border-color: var(--pm-phone-line); border-radius: 18px; box-shadow: var(--pm-phone-shadow); }
body.phone-shell.tool-phone.solar-determiner-body .sd-chat-messages { padding: 13px; gap: 11px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-msg { max-width: 94%; gap: 7px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-msg-avatar { width: 30px; height: 30px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-msg-bubble { padding: 10px 12px; border-radius: 13px; font-size: 12px; line-height: 1.7; }
body.phone-shell.tool-phone.solar-determiner-body .sd-suggestions { padding: 8px 10px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-chat-input-row { padding: 9px; gap: 7px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-chat-input { min-height: 44px; border-radius: 13px; font-size: 12px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-btn-send { min-width: 48px; min-height: 44px; padding: 8px 11px; border-radius: 13px; }
body.phone-shell.tool-phone.solar-determiner-body .sd-btn-send span { display: none; }
body.phone-shell.tool-phone.solar-determiner-body .sd-bom-table { display: block; overflow-x: auto; white-space: nowrap; }

/* حاسبة الديزل والطاقة الشمسية */
body.phone-shell.tool-phone.dvs-body .dvs-main { gap: 11px; }
body.phone-shell.tool-phone.dvs-body .dvs-card { padding: 13px 12px; border-color: var(--pm-phone-line); border-radius: 15px; box-shadow: var(--pm-phone-shadow); }
body.phone-shell.tool-phone.dvs-body .dvs-card-title { align-items: start; gap: 7px; font-size: 13px; line-height: 1.5; }
body.phone-shell.tool-phone.dvs-body .tag-hint { flex: 0 0 auto; padding: 3px 6px; font-size: 9.5px; }
body.phone-shell.tool-phone.dvs-body .dvs-chips-grid { gap: 6px; }
body.phone-shell.tool-phone.dvs-body .dvs-chips-grid--wide { flex-direction: column; }
body.phone-shell.tool-phone.dvs-body .dvs-chips-grid--wide .dvs-chip-btn { width: 100%; min-width: 0; }
body.phone-shell.tool-phone.dvs-body .dvs-chip-btn { min-height: 40px; padding: 6px 10px; border-radius: 10px; font-size: 11.5px; line-height: 1.25; }
body.phone-shell.tool-phone.dvs-body .dvs-chip-btn small { font-size: 8.5px; }
body.phone-shell.tool-phone.dvs-body .dvs-grid-2,
body.phone-shell.tool-phone.dvs-body .dvs-hero-comparison { grid-template-columns: 1fr; gap: 10px; }
body.phone-shell.tool-phone.dvs-body .dvs-input { min-height: 42px; border-radius: 10px; font-size: 12.5px; }
body.phone-shell.tool-phone.dvs-body .dvs-hero-comparison > * { min-height: 0; padding: 13px; border-radius: 15px; }
body.phone-shell.tool-phone.dvs-body .dvs-loss-val,
body.phone-shell.tool-phone.dvs-body .dvs-saving-val { font-size: 21px; }
body.phone-shell.tool-phone.dvs-body .dvs-roi-bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; border-radius: 15px; }
body.phone-shell.tool-phone.dvs-body .dvs-roi-badge { align-self: flex-start; }
body.phone-shell.tool-phone.dvs-body .dvs-roi-badge .num { font-size: 24px; }
body.phone-shell.tool-phone.dvs-body .dvs-specs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
body.phone-shell.tool-phone.dvs-body .dvs-spec-pill { min-height: 54px; padding: 8px; border-radius: 11px; }
body.phone-shell.tool-phone.dvs-body .dvs-spec-pill .k { font-size: 9.5px; line-height: 1.45; }
body.phone-shell.tool-phone.dvs-body .dvs-spec-pill .v { font-size: 12px; line-height: 1.45; }
body.phone-shell.tool-phone.dvs-body .dvs-tbl-wrap { margin: 0 -2px; overflow-x: auto; border-radius: 11px; }
body.phone-shell.tool-phone.dvs-body .dvs-table { min-width: 620px; font-size: 10px; }
body.phone-shell.tool-phone.dvs-body .dvs-table th,
body.phone-shell.tool-phone.dvs-body .dvs-table td { padding: 8px 7px; }

/* مختبر اختيار الطلمبات */
body.phone-shell.tool-phone.pump-lab-body .pl-shell { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
body.phone-shell.tool-phone.pump-lab-body .pl-mode-tabs { position: sticky; top: 63px; z-index: 50; margin: 0 -2px 11px; padding: 5px; border: 1px solid #E0ECF7; background: rgba(255,255,255,.96); box-shadow: 0 5px 14px rgba(19, 71, 128, .06); }
body.phone-shell.tool-phone.pump-lab-body .pl-tab-btn { min-height: 44px; padding: 7px 5px; font-size: 11px; }
body.phone-shell.tool-phone.pump-lab-body .pl-main { gap: 11px; }
body.phone-shell.tool-phone.pump-lab-body .pl-chat-card { height: calc(100dvh - 184px); min-height: 460px; border-color: var(--pm-phone-line); border-radius: 18px; box-shadow: var(--pm-phone-shadow); }
body.phone-shell.tool-phone.pump-lab-body .pl-chat-messages { padding: 13px; gap: 11px; }
body.phone-shell.tool-phone.pump-lab-body .pl-msg { max-width: 95%; gap: 7px; font-size: 12px; }
body.phone-shell.tool-phone.pump-lab-body .pl-msg-avatar { width: 30px; height: 30px; border-radius: 10px; }
body.phone-shell.tool-phone.pump-lab-body .pl-msg-bubble { padding: 10px 12px; border-radius: 13px; }
body.phone-shell.tool-phone.pump-lab-body .pl-chat-input-bar { padding: 9px; gap: 7px; }
body.phone-shell.tool-phone.pump-lab-body .pl-chat-input-bar input { min-height: 44px; border-radius: 13px; font-size: 12px; }
body.phone-shell.tool-phone.pump-lab-body .pl-btn-send { width: 44px; height: 44px; border-radius: 13px; }
body.phone-shell.tool-phone.pump-lab-body .pl-wizard-card { padding: 14px 13px; border-color: var(--pm-phone-line); border-radius: 18px; box-shadow: var(--pm-phone-shadow); }
body.phone-shell.tool-phone.pump-lab-body .pl-form-grid { grid-template-columns: 1fr; gap: 11px; }
body.phone-shell.tool-phone.pump-lab-body .pl-form-group input,
body.phone-shell.tool-phone.pump-lab-body .pl-form-group select { min-height: 46px; border-radius: 12px; font-size: 13px; }
body.phone-shell.tool-phone.pump-lab-body .pl-btn-primary { min-height: 50px; border-radius: 15px; }
body.phone-shell.tool-phone.pump-lab-body .pl-card-pump { padding: 12px; border-radius: 15px; }
body.phone-shell.tool-phone.pump-lab-body .pl-card-specs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
body.phone-shell.tool-phone.pump-lab-body .pl-spec-box { padding: 7px; border-radius: 10px; }
body.phone-shell.tool-phone.pump-lab-body .pl-spec-box .label,
body.phone-shell.tool-phone.pump-lab-body .pl-spec-box .val { font-size: 10px; line-height: 1.45; }
body.phone-shell.tool-phone.pump-lab-body .pl-card-actions { align-items: stretch; flex-direction: column; gap: 8px; }
body.phone-shell.tool-phone.pump-lab-body .pl-btn-download { justify-content: center; min-height: 42px; border-radius: 12px; }

/* التطبيقات التي ستُستكمل لاحقاً تستخدم الغلاف نفسه بدلاً من صفحة فارغة منفصلة. */
body.phone-shell.tool-phone.placeholder-phone .placeholder-shell {
  width: min(100%, 440px);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin: 0 auto;
  padding: max(7px, env(safe-area-inset-top)) 14px calc(90px + env(safe-area-inset-bottom));
}
body.phone-shell.tool-phone.placeholder-phone .hub-placeholder-page {
  min-height: 0;
  flex: 1;
  padding: 10px 0;
  background: transparent;
}
body.phone-shell.tool-phone.placeholder-phone .hub-placeholder-card {
  width: min(100%, 380px);
  padding: 28px 20px;
  border-color: var(--pm-phone-line);
  border-radius: 22px;
  box-shadow: var(--pm-phone-shadow);
}
body.phone-shell.tool-phone.placeholder-phone .hub-placeholder-logo { width: min(160px, 52vw); height: 54px; }
body.phone-shell.tool-phone.placeholder-phone .hub-placeholder-mark { width: 58px; height: 58px; margin-top: 15px; border-radius: 19px; }
body.phone-shell.tool-phone.placeholder-phone .hub-placeholder-card h1 { color: var(--pm-phone-navy); font-size: 23px; }
body.phone-shell.tool-phone.placeholder-phone .hub-placeholder-card > p:not(.hub-placeholder-kicker) { font-size: 13px; }

@media (max-width: 360px) {
  body.phone-shell.tool-phone .mobile-tool-brand img { width: 76px; }
  body.phone-shell.tool-phone .mobile-tool-brand span { font-size: 10px; }
  body.phone-shell.tool-phone .mobile-tool-tab { font-size: 8px; }
  body.phone-shell.tool-phone.dvs-body .dvs-chips-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* التمرير الأساسي يظل على الصفحة في كل تطبيق. نافذة PM وحدها تستخدم تمرير الرسائل الداخلي عند فتحها. */
@media (max-width: 767px) {
  html:has(body.phone-shell),
  body.phone-shell {
    height: auto !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    touch-action: pan-y;
  }
  body.phone-shell.tool-phone .sd-shell,
  body.phone-shell.tool-phone .dvs-shell,
  body.phone-shell.tool-phone .pl-shell,
  body.phone-shell.tool-phone.pump-lab-body .pl-shell:has(#chatSection[style*="flex"]) {
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
    touch-action: pan-y;
  }
  body.phone-shell.tool-phone .sd-form-pane,
  body.phone-shell.tool-phone .dvs-main,
  body.phone-shell.tool-phone .pl-main {
    overflow: visible !important;
    touch-action: pan-y;
  }
  body.phone-shell .unified-assistant-screen .pl-chat-messages,
  body.phone-shell .unified-assistant-screen .sd-chat-messages,
  body.phone-shell .unified-assistant-screen .page-assistant-messages {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
}

/* شريط التطبيق الموحد: نفس أبعاد وعناصر بوابة PM TECH الرئيسية. */
body.phone-shell .mobile-app-header {
  position: sticky;
  top: 0;
  z-index: 70;
  display: grid;
  /* نفس ترتيب الرأس في الرئيسية: القائمة يساراً والإشعارات يميناً. */
  direction: ltr;
  grid-template-columns: 42px minmax(164px, 1fr) 42px;
  align-items: center;
  width: 100%;
  height: 50px;
  margin: 0 0 9px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(226, 237, 247, .88);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 5px 15px rgba(19, 71, 128, .07);
  backdrop-filter: blur(14px);
}
body.phone-shell.tool-phone .mobile-app-header,
body.phone-shell.sales-mode .mobile-app-header {
  width: 100vw;
  box-sizing: border-box;
  margin-right: calc(50% - 50vw);
  margin-left: calc(50% - 50vw);
  padding-right: max(14px, env(safe-area-inset-right));
  padding-left: max(14px, env(safe-area-inset-left));
}
body.phone-shell .mobile-app-menu { position: relative; }
body.phone-shell .mobile-app-menu summary { list-style: none; }
body.phone-shell .mobile-app-menu summary::-webkit-details-marker { display: none; }
body.phone-shell .mobile-app-header-action {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--pm-phone-navy);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}
body.phone-shell .mobile-app-header-action:hover,
body.phone-shell .mobile-app-header-action:focus-visible {
  border-radius: 13px;
  background: #F1F7FD;
  outline: none;
}
body.phone-shell .mobile-app-header-action svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.phone-shell .mobile-app-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
body.phone-shell .mobile-app-brand img { width: min(48vw, 176px); max-height: 50px; object-fit: contain; }
body.phone-shell .mobile-app-desktop-links { display: none; }
body.phone-shell .mobile-app-notification { justify-self: end; }
body.phone-shell .mobile-app-notification-dot {
  position: absolute;
  top: 5px;
  right: 3px;
  width: 9px;
  height: 9px;
  border: 1.5px solid #FFF;
  border-radius: 50%;
  background: var(--pm-phone-green);
}
body.phone-shell .mobile-app-menu-panel {
  position: absolute;
  z-index: 100;
  top: calc(100% + 4px);
  left: -6px;
  width: 220px;
  padding: 8px;
  border: 1px solid var(--pm-phone-line);
  border-radius: 18px;
  background: #FFF;
  box-shadow: 0 16px 38px rgba(15, 43, 84, .16);
  direction: rtl;
}
body.phone-shell .mobile-app-menu-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 11px;
  color: #24436D;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
body.phone-shell .mobile-app-menu-panel a:hover { color: var(--pm-phone-blue); background: #EFF7FF; }

body.phone-shell .mobile-app-bottom-nav {
  position: fixed;
  right: 50%;
  bottom: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 440px);
  min-height: 59px;
  box-sizing: border-box;
  padding: 6px 5px calc(6px + env(safe-area-inset-bottom));
  transform: translateX(50%);
  border-top: 1px solid var(--pm-phone-line);
  background: rgba(255,255,255,.97);
  box-shadow: 0 -6px 17px rgba(19, 60, 113, .07);
  backdrop-filter: blur(15px);
}
body.phone-shell.sales-mode .sales-inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin: 0 0 9px;
  padding: 7px 9px;
  border: 1px solid var(--pm-phone-line);
  border-radius: 15px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 5px 15px rgba(18, 61, 108, .05);
}
body.phone-shell.sales-mode .sales-inline-actions .sales-rep-active-pill,
body.phone-shell.sales-mode .sales-inline-actions .sales-header-followup,
body.phone-shell.sales-mode .sales-inline-actions .sales-link-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid #DDEBFA;
  border-radius: 10px;
  color: var(--pm-phone-navy);
  background: #F4F9FF;
  font: 800 10px/1.2 inherit;
  text-decoration: none;
}
body.phone-shell.sales-mode .sales-inline-actions .sales-rep-active-pill { margin-inline-end: auto; }
body.phone-shell.sales-mode .sales-inline-actions .rep-avatar { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #E3F1FF; }
body.phone-shell .mobile-app-nav-link {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #7C8999;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}
body.phone-shell .mobile-app-nav-link svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.phone-shell .mobile-app-nav-link.active { color: var(--pm-phone-green); }

/* مقدمة منظمة لكل تطبيق بدلاً من ألسنة سطح المكتب والأزرار العائمة. */
body.phone-shell.tool-phone .app-phone-intro {
  margin: 0 0 11px;
  padding: 17px 15px;
  border: 1px solid #DDEBF8;
  border-radius: 20px;
  color: #FFF;
  background:
    radial-gradient(circle at 7% 14%, rgba(125, 210, 95, .30), transparent 7rem),
    linear-gradient(135deg, #0B3472, #087AF1);
  box-shadow: 0 10px 23px rgba(7, 79, 156, .17);
}
body.phone-shell.tool-phone .app-phone-intro-kicker { display: block; margin-bottom: 4px; color: #BFE4FF; font-size: 10px; font-weight: 800; }
body.phone-shell.tool-phone .app-phone-intro h1 { margin: 0; font-size: 19px; line-height: 1.35; font-weight: 900; }
body.phone-shell.tool-phone .app-phone-intro p { margin: 4px 0 0; color: rgba(255,255,255,.86); font-size: 11px; line-height: 1.7; }
body.phone-shell.tool-phone .app-phone-intro-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 13px; }
body.phone-shell.tool-phone .app-phone-action {
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  color: #FFF;
  background: rgba(255,255,255,.12);
  font: 800 11px/1.3 inherit;
  cursor: pointer;
}
body.phone-shell.tool-phone .app-phone-action.primary { color: #0B397B; border-color: #FFF; background: #FFF; }
body.phone-shell.tool-phone .app-phone-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
body.phone-shell.tool-phone .app-inline-notice {
  display: none;
  margin: 0 0 11px;
  padding: 10px 12px;
  border: 1px solid #F6C9C9;
  border-radius: 13px;
  color: #9F1E28;
  background: #FFF5F5;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
}
body.phone-shell.tool-phone .app-inline-notice.is-visible { display: block; }

body.phone-shell.tool-phone .page-assistant-panel {
  margin: 0 0 11px;
  overflow: hidden;
  border: 1px solid var(--pm-phone-line);
  border-radius: 19px;
  background: #FFF;
  box-shadow: var(--pm-phone-shadow);
}
body.phone-shell.tool-phone .page-assistant-panel[hidden] { display: none; }
body.phone-shell.tool-phone .page-assistant-head { display: flex; align-items: center; gap: 9px; padding: 12px 13px; color: var(--pm-phone-navy); border-bottom: 1px solid #E8F0F8; background: #F7FBFF; }
body.phone-shell.tool-phone .page-assistant-head svg { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; }
body.phone-shell.tool-phone .page-assistant-head strong { font-size: 13px; }
body.phone-shell.tool-phone .page-assistant-head span { display: block; color: var(--pm-phone-muted); font-size: 10px; font-weight: 600; }
body.phone-shell.tool-phone .page-assistant-messages { max-height: 310px; overflow-y: auto; padding: 12px; }
body.phone-shell.tool-phone .page-assistant-msg { width: fit-content; max-width: 92%; margin: 0 0 8px; padding: 9px 11px; border-radius: 13px; color: #234267; background: #F2F7FC; font-size: 11px; line-height: 1.75; white-space: pre-line; }
body.phone-shell.tool-phone .page-assistant-msg.user { margin-right: auto; color: #FFF; background: var(--pm-phone-blue); }
body.phone-shell.tool-phone .page-assistant-msg.loading { color: #527293; }
body.phone-shell.tool-phone .page-assistant-form { display: flex; gap: 7px; padding: 9px; border-top: 1px solid #E8F0F8; background: #FFF; }
body.phone-shell.tool-phone .page-assistant-form input { min-width: 0; flex: 1; min-height: 42px; padding: 8px 11px; border: 1px solid #D7E7F5; border-radius: 12px; outline: none; color: var(--pm-phone-ink); background: #FAFDFF; font: inherit; font-size: 11px; }
body.phone-shell.tool-phone .page-assistant-form input:focus { border-color: var(--pm-phone-blue); box-shadow: 0 0 0 3px rgba(8,122,241,.09); }
body.phone-shell.tool-phone .page-assistant-form button { width: 43px; min-height: 42px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 0; border-radius: 12px; color: #FFF; background: var(--pm-phone-blue); cursor: pointer; }
body.phone-shell.tool-phone .page-assistant-form svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.15; }
body.phone-shell.tool-phone .dvs-assistant-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
body.phone-shell.tool-phone .dvs-assistant-suggestions button { padding: 7px 9px; border: 1px solid #D5E7F8; border-radius: 10px; color: #1A5B9E; background: #F7FBFF; font: 800 10px/1.35 inherit; cursor: pointer; }
body.phone-shell.tool-phone .app-chat-return {
  align-self: flex-start;
  margin: 10px 10px 0;
  padding: 7px 10px;
  border: 1px solid #D7E7F5;
  border-radius: 10px;
  color: var(--pm-phone-navy);
  background: #F7FBFF;
  font: 800 10px/1.3 inherit;
  cursor: pointer;
}

/* الأزرار التشغيلية تبقى داخل البطاقات: لا أزرار عائمة أو ثابتة فوق المحتوى. */
body.phone-shell.tool-phone.solar-determiner-body .sd-btn-calc,
body.phone-shell.tool-phone.dvs-body .dvs-btn-print {
  position: static;
  bottom: auto;
  z-index: auto;
  margin-top: 12px;
  box-shadow: none;
}
body.phone-shell.tool-phone .sd-mode-switch,
body.phone-shell.tool-phone .pl-mode-tabs,
body.phone-shell.tool-phone .mobile-tool-toolbar { display: none !important; }
body.phone-shell.tool-phone .sd-shell,
body.phone-shell.tool-phone .dvs-shell,
body.phone-shell.tool-phone .pl-shell { padding-top: max(7px, env(safe-area-inset-top)); padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
body.phone-shell.tool-phone .sd-chat-pane,
body.phone-shell.tool-phone .pl-chat-card { min-height: 0; height: auto; }

/* مختبر الطلمبات: بنية هاتفية مقصودة، لا بقايا من شبكة سطح المكتب. */
body.phone-shell.tool-phone.pump-lab-body .pl-wizard-card { overflow: hidden; }
body.phone-shell.tool-phone.pump-lab-body .pl-phone-section-head { margin: 0 0 12px; }
body.phone-shell.tool-phone.pump-lab-body .pl-phone-section-head span { color: var(--pm-phone-navy); font-size: 15px; font-weight: 900; }
body.phone-shell.tool-phone.pump-lab-body .pl-phone-section-head p { margin: 3px 0 0; color: var(--pm-phone-muted); font-size: 10px; font-weight: 600; line-height: 1.65; }
body.phone-shell.tool-phone.pump-lab-body .pl-quick-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
body.phone-shell.tool-phone.pump-lab-body .pl-quick-presets button { min-height: 51px; padding: 6px 4px; border: 1px solid #D9EAFB; border-radius: 12px; color: var(--pm-phone-navy); background: #F8FBFF; font: 800 10px/1.35 inherit; cursor: pointer; }
body.phone-shell.tool-phone.pump-lab-body .pl-quick-presets button small { display: block; margin-top: 2px; color: #6A88A9; font-size: 8px; font-weight: 700; direction: ltr; }
body.phone-shell.tool-phone.pump-lab-body .pl-quick-presets button:active { border-color: var(--pm-phone-blue); color: var(--pm-phone-blue); background: #EEF8FF; }
body.phone-shell.tool-phone.pump-lab-body .pl-form-grid { grid-template-columns: 1fr; gap: 9px; }
body.phone-shell.tool-phone.pump-lab-body .pl-form-group { min-width: 0; }
body.phone-shell.tool-phone.pump-lab-body .pl-form-group label { font-size: 11px; }
body.phone-shell.tool-phone.pump-lab-body .pl-form-group input,
body.phone-shell.tool-phone.pump-lab-body .pl-form-group select { min-height: 45px; font-size: 12px; }
body.phone-shell.tool-phone.pump-lab-body .pl-wizard-actions { margin-top: 12px; }
body.phone-shell.tool-phone.pump-lab-body .pl-btn-primary { width: 100%; min-height: 50px; border-radius: 14px; }
body.phone-shell.tool-phone.pump-lab-body .pl-chat-card { border-radius: 19px; box-shadow: var(--pm-phone-shadow); }

.pl-tech-table-wrap { margin: 10px 0 12px; overflow: hidden; border: 1px solid #E2ECF6; border-radius: 12px; background: #FBFDFF; }
.pl-tech-table { width: 100%; border-collapse: collapse; color: #24446B; font-size: 11px; line-height: 1.45; }
.pl-tech-table th, .pl-tech-table td { padding: 8px 9px; border-bottom: 1px solid #E8F0F7; text-align: right; vertical-align: middle; }
.pl-tech-table tr:last-child th, .pl-tech-table tr:last-child td { border-bottom: 0; }
.pl-tech-table th { width: 39%; color: #58718E; background: #F4F9FD; font-weight: 800; white-space: nowrap; }
.pl-tech-table td { color: #123A6C; font-weight: 800; }

/* وضع المحادثة على الهاتف: منطقة رسائل مستقلة، لا بطاقة سطح مكتب تتمدد خلف الرأس والشريط. */
@media (max-width: 767px) {
  html:has(body.phone-shell), body.phone-shell { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto !important; overscroll-behavior-y: contain; }
  body.phone-shell.tool-phone .sd-shell,
  body.phone-shell.tool-phone .dvs-shell,
  body.phone-shell.tool-phone .pl-shell { overflow: visible; }
  body.phone-shell.tool-phone.pump-lab-body .pl-header { display: none; }
  body.phone-shell.tool-phone.pump-lab-body .pl-shell:has(#chatSection[style*="flex"]) {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 100dvh;
    padding-top: 0;
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
    overflow: hidden;
  }
  body.phone-shell.tool-phone.pump-lab-body .pl-shell:has(#chatSection[style*="flex"]) .pl-main {
    flex: 1;
    min-height: 0;
    display: flex;
  }
  body.phone-shell.tool-phone.pump-lab-body .pl-shell:has(#chatSection[style*="flex"]) .pl-chat-card {
    flex: 1;
    min-height: 0 !important;
    height: auto !important;
    margin: 0;
    border-radius: 17px;
  }
  body.phone-shell.tool-phone.pump-lab-body .pl-chat-messages {
    min-height: 0;
    padding: 12px 11px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
body.phone-shell.tool-phone.pump-lab-body .pl-msg { max-width: 100%; font-size: 12px; }
body.phone-shell.tool-phone.pump-lab-body .pl-msg-bubble { max-width: calc(100% - 38px); overflow-wrap: anywhere; }
/* رسائل العميل القصيرة تبقى بحجم محتواها ولا تتمدد بعرض بطاقة المحادثة. */
body.phone-shell.tool-phone.pump-lab-body .pl-msg.user { align-self: flex-start; width: auto; max-width: 100%; }
body.phone-shell.tool-phone.pump-lab-body .pl-msg.user .pl-msg-bubble { width: fit-content; max-width: min(82vw, 320px); overflow-wrap: break-word; }
body.phone-shell.tool-phone.pump-lab-body .pl-msg.user .pl-msg-bubble > div:first-child { display: inline; }
  body.phone-shell.tool-phone.pump-lab-body .pl-chips-row { display: grid; grid-template-columns: 1fr; width: 100%; gap: 6px; }
  body.phone-shell.tool-phone.pump-lab-body .pl-chip { width: 100%; min-height: 36px; justify-content: flex-start; text-align: right; }
  body.phone-shell.tool-phone.pump-lab-body .pl-chat-input-bar {
    position: static;
    flex: 0 0 auto;
    padding: 9px;
    background: #FFF;
  }
  body.phone-shell.tool-phone.pump-lab-body .pl-chat-input-bar input { min-width: 0; font-size: 12px; }
  body.phone-shell.tool-phone.pump-lab-body .pl-tech-table { font-size: 10px; }
  body.phone-shell.tool-phone.pump-lab-body .pl-tech-table th,
  body.phone-shell.tool-phone.pump-lab-body .pl-tech-table td { padding: 7px 8px; }

  body.phone-shell.tool-phone.solar-determiner-body .sd-chat-pane {
    min-height: 0;
    height: calc(100dvh - 152px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.phone-shell.tool-phone.solar-determiner-body .sd-chat-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  body.phone-shell.tool-phone.solar-determiner-body .sd-chat-input-row { flex: 0 0 auto; position: static; }
  body.phone-shell.tool-phone .page-assistant-panel { max-height: calc(100dvh - 150px); display: flex; flex-direction: column; }
  body.phone-shell.tool-phone .page-assistant-messages { flex: 1; max-height: none; min-height: 160px; overflow-y: auto; }
}

/* سطح المكتب: تجربة مستقلة واسعة، مع رأس حقيقي بعرض المتصفح. */
@media (min-width: 768px) {
  html:has(body.phone-shell) { background: #F4F9FE; }
  body.phone-shell { min-width: 0; overflow-x: hidden; overflow-y: auto; background: radial-gradient(circle at 96% 0%, rgba(184,228,255,.55), transparent 30rem), #F6FAFE; }
  body.phone-shell .mobile-app-header {
    position: sticky; top: 0; z-index: 120; width: 100vw; height: 74px; box-sizing: border-box;
    display: grid; grid-template-columns: 48px minmax(190px, 1fr) auto 48px; align-items: center; gap: 22px;
    margin-right: calc(50% - 50vw); margin-left: calc(50% - 50vw); padding: 9px clamp(28px, 5vw, 94px);
    border-bottom: 1px solid #E5EFF8; background: rgba(255,255,255,.94); box-shadow: 0 4px 18px rgba(20,65,112,.05); backdrop-filter: blur(16px);
  }
  body.phone-shell .mobile-app-menu { grid-column: 1; }
  body.phone-shell .mobile-app-brand { grid-column: 2; justify-content: flex-start; }
  body.phone-shell .mobile-app-brand img { width: 184px; max-height: 48px; }
  body.phone-shell .mobile-app-desktop-links { grid-column: 3; display: flex; align-items: center; gap: clamp(12px, 1.8vw, 28px); }
  body.phone-shell .mobile-app-desktop-links a { color: #466584; font-size: 13px; font-weight: 800; text-decoration: none; white-space: nowrap; }
  body.phone-shell .mobile-app-desktop-links a:hover { color: var(--pm-phone-blue); }
  body.phone-shell .mobile-app-notification { grid-column: 4; }
  body.phone-shell .mobile-app-menu-panel { left: auto; right: 0; }
  body.phone-shell .mobile-app-bottom-nav { display: none; }
  body.phone-shell.tool-phone .sd-shell,
  body.phone-shell.tool-phone .dvs-shell,
  body.phone-shell.tool-phone .pl-shell { width: min(1180px, calc(100% - 56px)); min-height: calc(100vh - 74px); margin: 0 auto; padding: 26px 0 48px; overflow: visible; }
  body.phone-shell .sales-app-wrapper,
  body.phone-shell .dash-layout-container,
  body.phone-shell .screen-admin,
  body.phone-shell .stitch-creator-app { width: min(1180px, calc(100% - 56px)); min-height: calc(100vh - 74px); margin: 0 auto; overflow: visible; }
  body.phone-shell.sales-mode .sales-app-wrapper { padding-top: 24px; padding-bottom: 42px; }
  body.phone-shell.creator-shell .stitch-container { width: 100%; height: auto; min-height: calc(100vh - 74px); max-height: none; border: 1px solid var(--pm-phone-line); border-radius: 26px; box-shadow: var(--pm-phone-shadow); }
  /* تعيد هذه القواعد إعدادات لوحة الإدارة المتخصصة بعد قواعد الهاتف ذات الأولوية الأعلى. */
  body.phone-shell.dashboard-body .dash-layout-container { display: flex; width: 100%; max-width: none; min-height: 100vh; background: transparent; }
  body.phone-shell.dashboard-body .dash-sidebar { display: flex !important; }
  body.phone-shell.dashboard-body .dash-main-content { width: auto; max-width: none; min-height: auto; padding: 26px clamp(30px, 4vw, 68px) 54px; gap: 22px; }
  body.phone-shell.dashboard-body .dash-header-bar { display: flex; min-height: 76px; margin: 0; padding: 13px 20px; border: 1px solid #DFEAF5; border-radius: 18px; background: rgba(255,255,255,.90); }
  body.phone-shell.dashboard-body .dash-header-logo-link { display: none; }
  body.phone-shell.dashboard-body .dash-header-titles { text-align: right; }
  body.phone-shell.dashboard-body .dash-header-titles h1 { overflow: visible; font-size: 24px; white-space: normal; text-overflow: clip; }
  body.phone-shell.dashboard-body .dash-header-titles p { display: block; }
  body.phone-shell.dashboard-body .dash-expo-pill { display: flex; }
  body.phone-shell.dashboard-body .dash-user-pill { width: auto; height: auto; padding: 7px 11px; border-radius: 20px; }
  body.phone-shell.dashboard-body .dash-user-pill > span:not(.avatar-circle) { display: inline; }
  body.phone-shell.dashboard-body .dash-kpi-grid-5,
  body.phone-shell.dashboard-body .dash-kpi-grid-4 { display: grid; gap: 14px; }
  body.phone-shell.tool-phone .app-phone-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; margin-bottom: 22px; padding: 26px 30px; border-radius: 24px; }
  body.phone-shell.tool-phone .app-phone-intro h1 { font-size: 28px; }
  body.phone-shell.tool-phone .app-phone-intro p { max-width: 670px; font-size: 13px; }
  body.phone-shell.tool-phone .app-phone-intro-actions { width: 285px; margin: 0; }
  body.phone-shell.tool-phone .app-phone-action { min-height: 46px; font-size: 12px; }
  body.phone-shell.tool-phone.solar-determiner-body .sd-form-pane { grid-template-columns: minmax(360px, .82fr) minmax(500px, 1.18fr); align-items: start; gap: 22px; }
  body.phone-shell.tool-phone.solar-determiner-body .sd-grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  body.phone-shell.tool-phone.solar-determiner-body .sd-chat-pane { width: min(900px, 100%); min-height: 620px; margin: 0 auto; }
  body.phone-shell.tool-phone.dvs-body .dvs-main { max-width: none; }
  body.phone-shell.tool-phone.dvs-body .dvs-grid-2,
  body.phone-shell.tool-phone.dvs-body .dvs-hero-comparison { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body.phone-shell.tool-phone.dvs-body .dvs-chips-grid { display: flex; flex-wrap: wrap; gap: 8px; }
  body.phone-shell.tool-phone.dvs-body .dvs-chips-grid--wide { flex-direction: column; }
  body.phone-shell.tool-phone.dvs-body .page-assistant-panel { width: min(850px,100%); margin: 0 auto 20px; }
  body.phone-shell.tool-phone.dvs-body .page-assistant-messages { max-height: 390px; }
  body.phone-shell.tool-phone.pump-lab-body .pl-main { width: min(1020px,100%); margin: 0 auto; }
  body.phone-shell.tool-phone.pump-lab-body .pl-wizard-card { padding: 27px; border-radius: 24px; }
  body.phone-shell.tool-phone.pump-lab-body .pl-phone-section-head span { font-size: 20px; }
  body.phone-shell.tool-phone.pump-lab-body .pl-phone-section-head p { font-size: 12px; }
  body.phone-shell.tool-phone.pump-lab-body .pl-quick-presets { grid-template-columns: repeat(3, minmax(0,1fr)); margin-bottom: 20px; }
  body.phone-shell.tool-phone.pump-lab-body .pl-quick-presets button { min-height: 62px; font-size: 12px; }
  body.phone-shell.tool-phone.pump-lab-body .pl-form-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
  body.phone-shell.tool-phone.pump-lab-body .pl-chat-card { min-height: 620px; }
  body.phone-shell.tool-phone.pump-lab-body .pl-chat-messages { min-height: 500px; }
  .pm-site-notice { right: 28px; bottom: 28px; width: min(390px, calc(100% - 56px)); transform: translateY(14px); }
  .pm-site-notice.is-visible { transform: translateY(0); }
}

.pm-site-notice {
  position: fixed;
  right: 50%;
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 1000;
  width: min(calc(100% - 28px), 412px);
  padding: 11px 13px;
  transform: translate(50%, 14px);
  border: 1px solid #BFDBFE;
  border-radius: 14px;
  color: #164F86;
  background: #EFF8FF;
  box-shadow: 0 10px 24px rgba(14, 61, 111, .17);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  font: 700 12px/1.6 Cairo, "Segoe UI", sans-serif;
}
.pm-site-notice[data-tone="error"] { color: #9D2430; border-color: #F6C9C9; background: #FFF4F4; }
.pm-site-notice[data-tone="success"] { color: #21743B; border-color: #B9E7C2; background: #F0FDF4; }
.pm-site-notice.is-visible { opacity: 1; transform: translate(50%, 0); }

/* التطبيق صفحة قابلة للسحب على الهاتف: لا يسمح لأي بطاقة داخلية بحجز تمرير الشاشة. */
@media (max-width: 767px) {
  html:has(body.phone-shell.tool-phone),
  body.phone-shell.tool-phone {
    height: auto !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto;
    touch-action: pan-y;
  }
  body.phone-shell.tool-phone .pl-shell,
  body.phone-shell.tool-phone .sd-shell,
  body.phone-shell.tool-phone .dvs-shell {
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
    padding-bottom: calc(94px + env(safe-area-inset-bottom)) !important;
  }
  body.phone-shell.tool-phone .pl-main,
  body.phone-shell.tool-phone .sd-form-pane,
  body.phone-shell.tool-phone .dvs-main {
    min-height: 0 !important;
    overflow: visible !important;
  }
}

@media (max-width: 360px) {
  body.phone-shell .mobile-app-header { grid-template-columns: 40px minmax(136px, 1fr) 40px; height: 46px; }
  body.phone-shell .mobile-app-header-action { width: 40px; height: 40px; }
  body.phone-shell .mobile-app-header-action svg { width: 28px; height: 28px; }
  body.phone-shell .app-phone-intro h1 { font-size: 17px; }
  body.phone-shell .app-phone-intro-actions { grid-template-columns: 1fr; }
}
