/* GriyaCRM Mobile Sales Workspace — Phase 1 */
.mobile-bottom-nav,.mobile-more-sheet,.mobile-more-backdrop{display:none}
@media (max-width:767.98px){
  :root{--mobile-nav-height:72px}
  html,body{max-width:100%;overflow-x:hidden}
  body{overscroll-behavior-y:none;-webkit-tap-highlight-color:transparent}
  .app-shell:not(.hidden){min-height:100dvh}
  .sidebar{position:fixed!important;inset:0 auto 0 0;z-index:1060;width:min(88vw,340px);transform:translateX(-105%);transition:transform .22s ease;box-shadow:0 0 0 100vmax rgba(11,39,68,.24)}
  .sidebar.is-open,.sidebar.open{transform:translateX(0)}
  .main{width:100%;min-width:0;padding-bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 12px)}
  .topbar{position:sticky;top:0;z-index:1010;min-height:58px;padding:8px 14px;background:rgba(255,255,255,.96);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-bottom:1px solid rgba(15,23,42,.08)}
  .topbar-title-block .eyebrow,.topbar-workspace-identity,.topbar-network-status .network-status-copy{display:none!important}
  .topbar-title-block{min-width:0;flex:1}
  .topbar-title-block h1{font-size:18px!important;line-height:1.2;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sidebar-open-button{width:42px;height:42px;padding:0!important;border-radius:12px}
  .sidebar-open-button span{display:none}
  .notification-button{width:42px;height:42px}
  .view{padding-left:12px!important;padding-right:12px!important}
  .dashboard-command-bar{display:flex;flex-direction:column;align-items:stretch!important;gap:10px;padding:14px!important;border-radius:16px}
  .dashboard-command-context{min-width:0}
  .dashboard-command-controls{width:100%;display:flex;gap:8px}
  .dashboard-command-period{flex:1}
  .dashboard-command-time{display:none}
  table{font-size:13px}
  .table-responsive{margin-left:-12px;margin-right:-12px;padding-left:12px;padding-right:12px}
  input,select,textarea,button{font-size:16px}
  button,.button,.btn,.nav-tab{touch-action:manipulation}
  .mobile-bottom-nav{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;z-index:1050;left:8px;right:8px;bottom:max(8px,env(safe-area-inset-bottom));height:64px;padding:5px 4px;border:1px solid rgba(15,23,42,.09);border-radius:20px;background:rgba(255,255,255,.97);box-shadow:0 12px 36px rgba(15,23,42,.16);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
  .mobile-nav-item{position:relative;border:0;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;border-radius:15px;color:#64748b;font-size:10px;font-weight:650}
  .mobile-nav-item i{font-size:20px;line-height:1}
  .mobile-nav-item.active{color:#0b2744;background:#f1f5f9}
  .mobile-nav-item.mobile-nav-primary{margin:-15px 2px 0;height:58px;background:#0b2744;color:#fff;box-shadow:0 8px 20px rgba(11,39,68,.25)}
  .mobile-nav-item.mobile-nav-primary.active{background:#0b2744;color:#fff}
  .mobile-more-backdrop:not(.hidden){display:block;position:fixed;z-index:1070;inset:0;background:rgba(2,6,23,.34);backdrop-filter:blur(2px)}
  .mobile-more-sheet:not(.hidden){display:block;position:fixed;z-index:1080;left:8px;right:8px;bottom:max(8px,env(safe-area-inset-bottom));padding:8px 16px 22px;border-radius:24px;background:#fff;box-shadow:0 -18px 60px rgba(15,23,42,.22);animation:mobileSheetIn .2s ease-out}
  .mobile-sheet-handle{width:42px;height:4px;border-radius:999px;background:#cbd5e1;margin:0 auto 12px}
  .mobile-sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
  .mobile-sheet-head div{display:flex;flex-direction:column}
  .mobile-sheet-head small{font-size:11px;color:#64748b;text-transform:uppercase;letter-spacing:.08em}
  .mobile-sheet-head strong{font-size:18px;color:#0f172a}
  .mobile-sheet-head button{width:40px;height:40px;border:0;border-radius:12px;background:#f1f5f9}
  .mobile-more-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
  .mobile-more-grid button{border:1px solid #e2e8f0;background:#fff;min-height:76px;border-radius:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:#334155;font-size:11px;font-weight:650}
  .mobile-more-grid i{font-size:21px;color:#0b2744}
  dialog{max-width:calc(100vw - 20px)!important}
  @keyframes mobileSheetIn{from{transform:translateY(24px);opacity:.5}to{transform:none;opacity:1}}
}
@media (max-width:390px){.mobile-more-grid{grid-template-columns:repeat(3,1fr)}}
@media (prefers-reduced-motion:reduce){.sidebar,.mobile-more-sheet{transition:none!important;animation:none!important}}

/* Phase 2 — operational dashboard, lead cards, lead detail */
@media (max-width:767.98px){
  #dashboardView .dashboard-kpi-grid,#dashboardView .metric-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  #dashboardView .dashboard-kpi-card{min-width:0!important;padding:14px!important;border-radius:16px!important;text-align:left}
  #dashboardView .dashboard-kpi-card strong{font-size:20px!important;line-height:1.15}
  #dashboardView .dashboard-kpi-card small{font-size:11px;line-height:1.35}
  #dashboardView .dashboard-priority-item{display:grid!important;grid-template-columns:38px minmax(0,1fr) 32px!important;gap:8px!important;padding:12px!important;border-radius:14px}
  #dashboardView .dashboard-task-date{grid-column:2;font-size:11px}
  #dashboardView .dashboard-pipeline-overview,#dashboardView .dashboard-recent-activity{border-radius:16px!important}
  #leadsView table{display:block!important}
  #leadsView thead{display:none!important}
  #leadsView tbody{display:grid!important;gap:10px!important}
  #leadsView tbody tr.clickable-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:7px 10px!important;padding:14px!important;border:1px solid #e2e8f0!important;border-radius:18px!important;background:#fff!important;box-shadow:0 4px 16px rgba(15,23,42,.055)}
  #leadsView tbody tr.clickable-row td{display:none!important;border:0!important;padding:0!important;white-space:normal!important}
  #leadsView tbody tr.clickable-row td:nth-child(4),#leadsView tbody tr.clickable-row td:nth-child(5),#leadsView tbody tr.clickable-row td:nth-child(9),#leadsView tbody tr.clickable-row td:nth-child(12),#leadsView tbody tr.clickable-row td:nth-child(13){display:block!important}
  #leadsView tbody tr.clickable-row td:nth-child(4){grid-column:1;font-size:15px}
  #leadsView tbody tr.clickable-row td:nth-child(4) strong{font-size:16px;color:#0f172a}
  #leadsView tbody tr.clickable-row td:nth-child(4) small{color:#64748b}
  #leadsView tbody tr.clickable-row td:nth-child(9){grid-column:2;grid-row:1;text-align:right}
  #leadsView tbody tr.clickable-row td:nth-child(5){grid-column:1;color:#475569;font-size:12px}
  #leadsView tbody tr.clickable-row td:nth-child(12){grid-column:1;font-size:12px;color:#64748b}
  #leadsView tbody tr.clickable-row td:nth-child(12)::before{content:"Next follow-up · ";font-weight:700;color:#334155}
  #leadsView tbody tr.clickable-row td:nth-child(13){grid-column:1 / -1;margin-top:3px}
  #leadsView .row-actions{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:7px!important}
  #leadsView .row-actions button{min-height:40px!important;border-radius:11px!important;padding:7px!important}
  #leadsView .status-pill{font-size:10px!important;white-space:nowrap}
  #leadsView .table-responsive{overflow:visible!important}
  #leadsView .pagination{justify-content:center}
  #leadDialog[open]{width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;border:0!important;border-radius:0!important}
  #leadDialog[open] form,#leadDialog[open] .dialog-card,#leadDialog[open] .modal-content{min-height:100dvh}
  #leadDialog input,#leadDialog select,#leadDialog textarea{min-height:46px;border-radius:12px}
  #leadDialog textarea{min-height:92px}
  #leadDialog .dialog-actions,#leadDialog .modal-footer{position:sticky;bottom:0;z-index:3;background:#fff;padding-bottom:calc(12px + env(safe-area-inset-bottom));box-shadow:0 -8px 20px rgba(15,23,42,.07)}
}

/* Phase 3 — WhatsApp Inbox + Sales Planner */
@media (max-width:767.98px){
  #inboxView{padding:0!important}
  #inboxView .wa-main-panel{margin:0!important;border:0!important;border-radius:0!important;min-height:calc(100dvh - 58px - var(--mobile-nav-height))}
  #inboxView .wa-page-tabs{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none;padding:7px 10px;gap:5px}
  #inboxView .wa-page-tabs::-webkit-scrollbar{display:none}
  #inboxView .wa-page-tab{flex:0 0 auto;min-height:38px;padding:0 11px}
  #inboxView .wa-inbox-layout{display:block!important;position:relative;height:calc(100dvh - 58px - var(--mobile-nav-height) - 52px)!important;min-height:480px;overflow:hidden}
  #inboxView .wa-conversation-column,#inboxView .wa-chat-column{position:absolute!important;inset:0!important;width:100%!important;max-width:none!important;background:#fff}
  #inboxView .wa-conversation-column{z-index:2}
  #inboxView .wa-chat-column{z-index:3;transform:translateX(105%);transition:transform .2s ease}
  #inboxView .wa-inbox-layout.mobile-chat-open .wa-chat-column{transform:none}
  #inboxView .wa-inbox-layout.mobile-chat-open .wa-conversation-column{visibility:hidden}
  #inboxView .wa-contact-column{position:fixed!important;z-index:1090!important;top:58px!important;right:0!important;bottom:0!important;left:10%!important;width:auto!important;max-width:none!important}
  #inboxView .wa-conversation-header{min-height:52px;padding:7px 10px}
  #inboxView .wa-list-collapse-toggle,#inboxView .wa-inbox-focus-toggle{display:none!important}
  #inboxView .wa-conversation-tools{padding:8px 10px}
  #inboxView .wa-quick-filters,#inboxView .wa-inbox-action-filters{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  #inboxView .wa-quick-filters button,#inboxView .wa-inbox-action-filters button{flex:0 0 auto;white-space:nowrap}
  #inboxView .wa-conversation-list{height:calc(100% - 168px)!important;overflow-y:auto;-webkit-overflow-scrolling:touch}
  #inboxView .wa-chat-header{position:sticky;top:0;z-index:5;min-height:56px;padding-left:50px!important;background:#fff}
  #inboxView .wa-chat-header:before{content:"‹";position:absolute;left:8px;top:8px;width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:#f1f5f9;color:#0b2744;font-size:31px;line-height:1;cursor:pointer}
  #inboxView .wa-message-list{padding:12px 10px calc(142px + env(safe-area-inset-bottom))!important;overflow-y:auto;-webkit-overflow-scrolling:touch}
  #inboxView .wa-composer-zone{position:absolute!important;left:0;right:0;bottom:0;z-index:6;background:#fff;padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -8px 24px rgba(15,23,42,.07)}
  #inboxView .wa-composer{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;gap:6px!important;padding:7px 8px!important}
  #inboxView .wa-composer-toolbar{grid-column:1;display:flex;align-items:flex-end}
  #inboxView .wa-composer-toolbar>*:not(.wa-composer-menu-wrap):not(#waEmojiBtn){display:none!important}
  #inboxView .wa-attachment-label{display:none!important}
  #inboxView .wa-composer-field{grid-column:2}
  #inboxView #waComposerInput{font-size:16px!important;max-height:112px!important;min-height:42px!important}
  #inboxView .wa-send-button{grid-column:3;min-width:44px!important;width:44px!important;height:44px!important;border-radius:50%!important;padding:0!important}
  #inboxView .wa-send-button span{display:none}
  #inboxView .wa-composer-hint{display:none!important}

  #reminderView{padding-left:8px!important;padding-right:8px!important}
  #reminderView .sp-shell{gap:8px}
  #reminderView .sp-head{padding:12px!important;border-radius:16px}
  #reminderView .sp-head p:not(.eyebrow){display:none}
  #reminderView .sp-head h2{font-size:18px}
  #reminderView .sp-head-actions{position:fixed;z-index:1045;right:16px;bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 18px);width:auto!important}
  #reminderView .sp-head-actions button{width:52px!important;height:52px!important;min-width:52px!important;border-radius:50%!important;padding:0!important;box-shadow:0 8px 24px rgba(11,39,68,.22);font-size:0}
  #reminderView .sp-head-actions button i{font-size:20px}
  #reminderView .sp-head-actions .ghost-button{display:none}
  #reminderView .sp-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}
  #reminderView .sp-summary>*{min-width:0;padding:12px!important;border-radius:14px}
  #reminderView .sp-toolbar{display:block!important;padding:7px!important;overflow:hidden}
  #reminderView .sp-tabs{max-width:none!important;width:100%;overflow-x:auto;scrollbar-width:none}
  #reminderView .sp-tabs::-webkit-scrollbar{display:none}
  #reminderView .sp-tabs button{flex:0 0 auto;min-height:40px}
  #reminderView .sp-filter-menu{margin-top:7px}
  #reminderView .sp-card{padding:12px!important;border-radius:15px!important}
  #reminderView .sp-actions button{min-height:38px}
  #reminderView .sp-shell.is-calendar-mode .sp-panel{min-height:calc(100dvh - 150px)}
  #reminderView .sp-calendar-workspace{min-height:calc(100dvh - 190px)!important}
  #reminderView .sp-calendar-toolbar{padding:8px!important;gap:8px!important}
  #reminderView .sp-calendar-nav{display:grid!important;grid-template-columns:40px 1fr 40px!important}
  #reminderView .sp-calendar-nav>button:not(.sp-calendar-icon){grid-column:2;grid-row:1}
  #reminderView .sp-calendar-title{grid-column:1/-1!important;order:initial!important;margin:3px 0 0!important;font-size:16px!important;text-align:center}
  #reminderView .sp-calendar-view-switch{overflow:hidden}
  #reminderView .sp-calendar-view-switch button{min-height:40px}
  #reminderView .sp-dialog[open]{width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;border:0!important;border-radius:0!important}
  #reminderView .sp-form{min-height:100dvh}
  #reminderView .sp-form-grid{padding:14px!important}
  #reminderView .sp-form input,#reminderView .sp-form select,#reminderView .sp-form textarea{font-size:16px!important;min-height:46px!important}
  #reminderView .sp-form footer{position:sticky;bottom:0;z-index:4;padding-bottom:calc(13px + env(safe-area-inset-bottom));background:#fff}
}

/* Phase 4 — Pipeline + Property Catalog */
@media (max-width:767.98px){
  #pipelineView{padding-left:8px!important;padding-right:8px!important}
  #pipelineView .pipeline-toolbar,#pipelineView .pipeline-filter-toolbar{position:sticky;top:58px;z-index:8;background:#fff;border-radius:14px}
  #pipelineView .pipeline-context-main{display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;gap:9px!important;padding:12px!important}
  #pipelineView .pipeline-context-metrics{grid-column:1/-1;display:flex!important;overflow-x:auto;gap:6px;scrollbar-width:none}
  #pipelineView .pipeline-context-metrics span{flex:0 0 auto;white-space:nowrap}
  #pipelineView .pipeline-alignment-help{align-items:flex-start!important;padding:10px!important;font-size:11px}
  #pipelineView .pipeline-board{display:flex!important;overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x mandatory;gap:10px!important;padding:4px 4px 12px!important;scrollbar-width:none}
  #pipelineView .pipeline-board::-webkit-scrollbar{display:none}
  #pipelineView .pipeline-column{flex:0 0 calc(100vw - 32px)!important;width:calc(100vw - 32px)!important;min-width:0!important;max-width:none!important;scroll-snap-align:center;border-radius:16px!important}
  #pipelineView .pipeline-column-header{position:sticky;top:0;z-index:2;padding:11px!important;background:inherit}
  #pipelineView .pipeline-sales-card{border-radius:15px!important;padding:12px!important}
  #pipelineView .pipeline-drag-handle{display:none!important}
  #pipelineView .pipeline-card-actions{display:grid!important;grid-template-columns:2fr 1fr 1fr!important;gap:6px!important}
  #pipelineView .pipeline-card-actions button{min-height:40px!important;border-radius:10px!important}
  #pipelineView .pipeline-sales-focus{grid-template-columns:1fr!important;gap:7px!important}
  #pipelineView .pipeline-top-scrollbar{display:none!important}

  #propertyCatalogView{padding:0 8px!important}
  #propertyCatalogView .pcat-command{display:block!important;padding:14px!important;border-radius:16px}
  #propertyCatalogView .pcat-command-copy p{display:none}
  #propertyCatalogView .pcat-command-actions{display:flex!important;width:100%;margin-top:10px;gap:7px}
  #propertyCatalogView .pcat-command-actions button{flex:1;min-height:42px}
  #propertyCatalogView .pcat-tabs{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  #propertyCatalogView .pcat-tabs::-webkit-scrollbar{display:none}
  #propertyCatalogView .pcat-tab{flex:0 0 auto;white-space:nowrap}
  #propertyCatalogView .pcat-inventory-head{display:block!important;padding:14px!important}
  #propertyCatalogView .pcat-inventory-head>div:last-child{margin-top:10px}
  #propertyCatalogView .pcat-filters{display:flex!important;overflow-x:auto;gap:7px!important;scrollbar-width:none;padding-bottom:3px}
  #propertyCatalogView .pcat-filters::-webkit-scrollbar{display:none}
  #propertyCatalogView .pcat-filter{flex:0 0 min(72vw,250px)}
  #propertyCatalogView .pcat-inventory{grid-template-columns:1fr!important;gap:12px!important;padding:10px!important}
  #propertyCatalogView .pcat-card{border-radius:18px!important;overflow:hidden}
  #propertyCatalogView .pcat-cover{aspect-ratio:16/10!important;height:auto!important}
  #propertyCatalogView .pcat-body{padding:13px!important}
  #propertyCatalogView .pcat-title{font-size:17px!important}
  #propertyCatalogView .pcat-price{font-size:18px!important}
  #propertyCatalogView .pcat-card-footer{align-items:center!important}
  #propertyCatalogView .pcat-detail-button{min-height:40px!important}
  #propertyCatalogView .pcat-row{display:grid!important;grid-template-columns:92px minmax(0,1fr)!important;gap:10px!important;padding:10px!important;border-radius:15px}
  #propertyCatalogView .pcat-row-cover{width:92px!important;height:92px!important}
  #propertyCatalogView .pcat-row-main{min-width:0}
  #propertyCatalogView .pcat-row-meta,#propertyCatalogView .pcat-row-quality{display:none!important}
  #propertyCatalogView .pcat-row-price,#propertyCatalogView .pcat-row-actions{grid-column:2}
  #propertyCatalogView .pcat-detail-topbar{position:sticky;top:58px;z-index:7;display:flex!important;gap:6px;padding:8px!important;background:rgba(255,255,255,.96);backdrop-filter:blur(12px)}
  #propertyCatalogView .pcat-back-button{font-size:0;min-width:42px;width:42px;padding:0!important}
  #propertyCatalogView .pcat-back-button i{font-size:18px}
  #propertyCatalogView .pcat-detail-actions{margin-left:auto;display:flex;gap:6px}
  #propertyCatalogView .pcat-detail-actions .pcat-secondary{display:none}
  #propertyCatalogView .pcat-detail-layout{display:block!important}
  #propertyCatalogView .pcat-detail-main,#propertyCatalogView .pcat-detail-side{width:100%!important;max-width:none!important}
  #propertyCatalogView .pcat-detail-hero{min-height:0!important;aspect-ratio:16/10}
  #propertyCatalogView .pcat-detail-hero img{width:100%;height:100%;object-fit:cover}
  #propertyCatalogView .pcat-gallery-strip{display:flex!important;overflow-x:auto;gap:6px;padding:7px;scrollbar-width:none}
  #propertyCatalogView .pcat-gallery-thumb{flex:0 0 82px!important;width:82px!important;height:64px!important}
  #propertyCatalogView .pcat-detail-heading{display:block!important}
  #propertyCatalogView .pcat-detail-price{margin-top:10px;text-align:left!important}
  #propertyCatalogView .pcat-spec-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  #propertyCatalogView .pcat-detail-card{border-radius:16px!important}
  #propertyCatalogView .pcat-detail-card-body{padding:14px!important}
  #propertyCatalogView .pcat-dialog[open]{width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;border:0!important;border-radius:0!important}
}

/* Phase 5 — Site Plan, Payment Calculator, Marketing Tools */
@media (max-width:767.98px){
  #sitePlanView,#calculatorView,#marketingToolsView{padding-left:8px!important;padding-right:8px!important}
  #sitePlanView .sp-section-tabs{display:flex;overflow-x:auto;scrollbar-width:none}
  #sitePlanView .sp-section-tab{flex:1;min-height:42px;white-space:nowrap}
  #sitePlanView .sp-toolbar-card{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;padding:12px!important;border-radius:16px}
  #sitePlanView .sp-project-selector select{font-size:16px!important;min-height:46px}
  #sitePlanView .sp-project-meta{min-width:0}
  #sitePlanView .sp-toolbar-actions{display:flex!important;justify-content:space-between;overflow-x:auto}
  #sitePlanView .sp-viewer-tools{display:flex!important;flex:0 0 auto}
  #sitePlanView .sp-status-summary{display:flex!important;overflow-x:auto;gap:7px!important;scrollbar-width:none;padding-bottom:4px}
  #sitePlanView .sp-status-card{flex:0 0 128px!important;min-width:128px!important;border-radius:14px}
  #sitePlanView .sp-workspace-grid{display:flex!important;flex-direction:column!important;gap:10px}
  #sitePlanView .sp-viewer-panel{order:1;min-height:52dvh!important;border-radius:16px;overflow:hidden}
  #sitePlanView .sp-viewer{min-height:52dvh!important}
  #sitePlanView .sp-canvas{min-height:48dvh!important;touch-action:none}
  #sitePlanView .sp-legend{display:flex!important;overflow-x:auto;white-space:nowrap;gap:10px}
  #sitePlanView .sp-legend small{display:none}
  #sitePlanView .sp-inventory-panel{order:2;max-height:none!important;border-radius:16px}
  #sitePlanView .sp-unit-list{max-height:46dvh!important;overflow-y:auto;-webkit-overflow-scrolling:touch}
  #sitePlanView .sp-dialog[open]{width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;border:0!important;border-radius:0!important}
  #sitePlanView .sp-dialog-card{min-height:100dvh;overflow-y:auto;padding-bottom:calc(18px + env(safe-area-inset-bottom))}
  #sitePlanView .sp-dialog input,#sitePlanView .sp-dialog select,#sitePlanView .sp-dialog textarea{font-size:16px!important;min-height:46px}

  #calculatorView .pc-page-shell{gap:10px}
  #calculatorView .pc-intro-card{display:block!important;padding:14px!important;border-radius:16px}
  #calculatorView .pc-intro-card p{display:none}
  #calculatorView .pc-intro-card h2{font-size:18px!important}
  #calculatorView #pcResetBtn{margin-top:10px;min-height:40px}
  #calculatorView .pc-workspace-grid{display:flex!important;flex-direction:column!important;gap:10px}
  #calculatorView .pc-panel{border-radius:16px!important}
  #calculatorView .pc-panel-head{padding:12px!important}
  #calculatorView .pc-form-grid{grid-template-columns:1fr!important;padding:12px!important}
  #calculatorView .pc-form-wide{grid-column:auto!important}
  #calculatorView input,#calculatorView select{font-size:16px!important;min-height:46px}
  #calculatorView .pc-actions{position:sticky;bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));z-index:5;display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px;padding:8px!important;background:rgba(255,255,255,.96);backdrop-filter:blur(10px)}
  #calculatorView .pc-actions button{min-height:44px}
  #calculatorView #pcShareCardBtn{grid-column:1/-1}
  #calculatorView .pc-disclaimer{display:block;padding-bottom:12px}

  #marketingToolsView .marketing-tools-panel{border-radius:16px!important;overflow:hidden}
  #marketingToolsView .marketing-tools-commandbar{display:flex!important;align-items:center;padding:13px!important}
  #marketingToolsView .marketing-tools-command-copy p{display:none}
  #marketingToolsView #marketingToolsUploadBtn{margin-left:auto;min-width:44px;min-height:42px}
  #marketingToolsView #marketingToolsUploadBtn span{display:none}
  #marketingToolsView .marketing-tools-summary{display:flex!important;overflow-x:auto;gap:7px!important;scrollbar-width:none}
  #marketingToolsView .marketing-tools-summary>*{flex:0 0 145px}
  #marketingToolsView .marketing-tools-toolbar{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important;padding:10px!important}
  #marketingToolsView .marketing-tools-search{grid-column:1/-1}
  #marketingToolsView .marketing-tools-search input,#marketingToolsView .marketing-tools-toolbar select{font-size:16px!important;min-height:44px}
  #marketingToolsView .marketing-tools-refresh{min-height:44px}
  #marketingToolsView .marketing-tools-featured{overflow-x:auto;scrollbar-width:none}
  #marketingToolsView .marketing-tools-library-head{padding:10px!important}
  #marketingToolsView .marketing-tools-page-size{display:none!important}
  #marketingToolsView .marketing-tools-grid{grid-template-columns:1fr!important;gap:9px!important;padding:10px!important}
  #marketingToolEditorDialog[open],#marketingToolPreviewDialog[open]{width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;border:0!important;border-radius:0!important}
  #marketingToolEditorDialog .marketing-tools-dialog-shell,#marketingToolPreviewDialog .marketing-tools-preview-shell{min-height:100dvh!important;max-height:100dvh!important;border-radius:0!important}
  #marketingToolEditorDialog .marketing-tools-form-grid{grid-template-columns:1fr!important;padding:14px!important}
  #marketingToolEditorDialog .marketing-tools-wide{grid-column:auto!important}
  #marketingToolEditorDialog input,#marketingToolEditorDialog select,#marketingToolEditorDialog textarea{font-size:16px!important;min-height:46px}
  #marketingToolEditorDialog .marketing-tools-dialog-actions{position:sticky;bottom:0;padding-bottom:calc(12px + env(safe-area-inset-bottom));background:#fff}
}

/* Phase 6 — final mobile refinement & operational QA layer */
@media (max-width:767.98px){
  html{scroll-padding-bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 16px)}
  body{overscroll-behavior-y:none}
  button,a,input,select,textarea,[role="button"]{-webkit-tap-highlight-color:transparent}
  button:not(.mobile-nav-item):not(.wa-page-tab):not(.settings-tab),[role="button"]{touch-action:manipulation}
  .main{padding-bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 12px)!important}
  .topbar-network-status{display:none!important}
  .topbar-notification{margin-left:auto}
  .notification-menu{position:fixed!important;z-index:1200!important;top:58px!important;right:8px!important;left:8px!important;width:auto!important;max-height:min(70dvh,560px)!important;border-radius:16px!important;overflow:hidden}
  .notification-list{max-height:calc(min(70dvh,560px) - 70px)!important;overflow-y:auto;-webkit-overflow-scrolling:touch}
  .global-loading-toast{left:12px!important;right:12px!important;bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 12px)!important;width:auto!important;max-width:none!important}
  .global-loading-bar{position:fixed!important;top:0!important;left:0!important;right:0!important;z-index:1300!important}
  dialog[open]:not(.auth-dialog){overscroll-behavior:contain}
  dialog[open]:not(.auth-dialog) input,dialog[open]:not(.auth-dialog) select,dialog[open]:not(.auth-dialog) textarea{font-size:16px!important}
  body:has(dialog[open]){overflow:hidden}

  #settingsView{padding:0 8px!important}
  #settingsView .settings-layout{display:block!important}
  #settingsView .settings-menu-panel{border-radius:16px!important;overflow:hidden;margin-bottom:10px}
  #settingsView .settings-navigation-head{padding:12px!important}
  #settingsView .settings-tabbar{display:flex!important;overflow-x:auto;gap:6px!important;padding:8px!important;scrollbar-width:none}
  #settingsView .settings-tabbar::-webkit-scrollbar{display:none}
  #settingsView .settings-nav-group{display:contents!important}
  #settingsView .settings-nav-group-label{display:none!important}
  #settingsView .settings-tab{flex:0 0 auto!important;min-width:auto!important;min-height:42px!important;padding:0 12px!important;border-radius:12px!important}
  #settingsView .settings-tab>span{display:block}
  #settingsView .settings-tab small,#settingsView .settings-tab>i:last-child{display:none!important}
  #settingsView .settings-tab strong{white-space:nowrap;font-size:12px}
  #settingsView .settings-content-panel,#settingsView .settings-panel{border-radius:16px!important}
  #settingsView input,#settingsView select,#settingsView textarea{font-size:16px!important;min-height:44px}
  #settingsView .settings-form-grid{grid-template-columns:1fr!important}
  #settingsView .settings-form-grid>*{grid-column:auto!important}

  .mobile-more-sheet{max-height:min(78dvh,650px)!important;overflow-y:auto;-webkit-overflow-scrolling:touch}
  .mobile-more-grid button{min-height:76px!important}
  .mobile-bottom-nav{padding-bottom:max(6px,env(safe-area-inset-bottom))!important}
  .mobile-nav-item{min-height:52px}
  .mobile-nav-item i{font-size:19px}
  @media (display-mode:standalone){
    .mobile-bottom-nav{padding-bottom:max(10px,env(safe-area-inset-bottom))!important}
    .topbar{padding-top:env(safe-area-inset-top)!important;height:calc(58px + env(safe-area-inset-top))!important}
  }
  @media (prefers-reduced-motion:reduce){
    *,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}
  }
}

/* Phase 9 — installed/standalone app polish */
@media (max-width:767.98px) and (display-mode:standalone){
  html,body{min-height:100dvh}
  body.griya-standalone{overscroll-behavior:none}
  body.griya-standalone .main{min-height:calc(100dvh - 58px - env(safe-area-inset-top));}
  body.griya-standalone .mobile-bottom-nav{padding-bottom:max(10px,env(safe-area-inset-bottom));}
  body.griya-standalone .mobile-more-sheet{padding-bottom:calc(14px + env(safe-area-inset-bottom));}
  body.griya-standalone .notification-menu{top:calc(58px + env(safe-area-inset-top))!important}
}

/* Mobile readability + natural scrolling */
@media (max-width:767.98px){
  :root{--mobile-nav-height:78px}
  html{font-size:17px!important;overflow-y:auto!important;overscroll-behavior-y:auto!important}
  body{font-size:16px!important;line-height:1.5!important;overflow-y:auto!important;overscroll-behavior-y:auto!important;-webkit-overflow-scrolling:touch}
  .app-shell:not(.hidden),.main{height:auto!important;min-height:100dvh!important;overflow:visible!important}
  .view:not(#inboxView){height:auto!important;max-height:none!important;overflow:visible!important}
  .topbar{min-height:64px!important;padding:9px 14px!important}
  .topbar-title-block h1{font-size:21px!important}
  .sidebar-open-button,.notification-button{width:46px!important;height:46px!important;font-size:20px!important}
  .view{padding-left:14px!important;padding-right:14px!important}
  h1{font-size:24px} h2{font-size:21px} h3{font-size:18px}
  p,li,td,th,label,small{line-height:1.5}
  small{font-size:12px}
  .btn,button,.button{min-height:44px}
  .btn i,button i,.button i{font-size:18px}
  .mobile-bottom-nav{height:70px!important;left:7px!important;right:7px!important;padding:5px!important}
  .mobile-nav-item{font-size:11px!important;font-weight:700!important;gap:4px!important}
  .mobile-nav-item i{font-size:23px!important}
  .mobile-nav-item.mobile-nav-primary{height:64px!important}
  .mobile-more-sheet:not(.hidden){max-height:82dvh!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch}
  .mobile-more-grid{grid-template-columns:repeat(3,1fr)!important;gap:10px!important}
  .mobile-more-grid button{min-height:88px!important;font-size:12px!important}
  .mobile-more-grid i{font-size:26px!important}
  .dashboard-command-bar,.dashboard-kpi-card,.pipeline-sales-card,.pcat-card,.sp-head,.pc-panel,.marketing-tools-panel{font-size:15px}
  #dashboardView .dashboard-kpi-card strong{font-size:24px!important}
  #dashboardView .dashboard-kpi-card small{font-size:12px!important}
  #leadsView tbody tr.clickable-row td:nth-child(4){font-size:16px!important}
  #leadsView tbody tr.clickable-row td:nth-child(4) strong{font-size:18px!important}
  #leadsView tbody tr.clickable-row td:nth-child(5),#leadsView tbody tr.clickable-row td:nth-child(12){font-size:13px!important}
  #leadsView .status-pill{font-size:11px!important;padding:5px 8px!important}
  #inboxView .wa-page-tab{font-size:13px!important;min-height:42px!important}
  #inboxView .wa-conversation-list{font-size:15px}
  #inboxView .wa-chat-header{min-height:62px!important}
  #inboxView .wa-message-list{font-size:15px}
  #reminderView .sp-head h2{font-size:21px!important}
  #propertyCatalogView .pcat-title{font-size:19px!important}
  #propertyCatalogView .pcat-price{font-size:21px!important}
  #settingsView .settings-tab strong{font-size:13px!important}
}

.mobile-pull-refresh{display:none}
@media (max-width:767.98px){
  .mobile-pull-refresh{display:flex;position:fixed;z-index:1400;top:calc(env(safe-area-inset-top) + 5px);left:50%;transform:translate(-50%,calc(var(--pull-y,0px) - 58px));align-items:center;gap:8px;padding:9px 14px;border-radius:999px;background:rgba(255,255,255,.97);border:1px solid #e2e8f0;box-shadow:0 8px 26px rgba(15,23,42,.16);color:#475569;font-size:13px;font-weight:700;opacity:0;pointer-events:none;transition:opacity .12s ease}
  .mobile-pull-refresh.visible{opacity:1}
  .mobile-pull-refresh.ready{color:#0b2744}
  .mobile-pull-refresh.ready i{transform:rotate(180deg)}
  .mobile-pull-refresh.refreshing{transform:translate(-50%,12px)}
  .mobile-pull-refresh.refreshing i{animation:griyaPullSpin .75s linear infinite}
  @keyframes griyaPullSpin{to{transform:rotate(360deg)}}
}

/* Mobile root scroll hotfix — keep the viewport itself scrollable */
@media (max-width:767.98px){
  html{height:auto!important;min-height:100%!important;overflow-x:hidden!important;overflow-y:scroll!important;overscroll-behavior-y:auto!important}
  body{position:static!important;height:auto!important;min-height:100dvh!important;max-height:none!important;overflow-x:hidden!important;overflow-y:visible!important;overscroll-behavior-y:auto!important;touch-action:pan-y pinch-zoom!important}
  body:not(.mobile-sheet-open):not(:has(dialog[open])){overflow-y:visible!important}
  #appShell.app-shell:not(.hidden){position:relative!important;inset:auto!important;height:auto!important;min-height:100dvh!important;max-height:none!important;overflow:visible!important}
  #appShell>.main,.app-shell>.main{position:relative!important;height:auto!important;min-height:100dvh!important;max-height:none!important;overflow:visible!important;overflow-y:visible!important;touch-action:pan-y pinch-zoom!important}
  main,.main-content,.content-shell,.view.active:not(#inboxView){height:auto!important;max-height:none!important;overflow-y:visible!important;touch-action:pan-y pinch-zoom!important}
  .view.active:not(#inboxView){min-height:calc(100dvh - 64px - var(--mobile-nav-height))!important;padding-bottom:24px!important}
  body.mobile-sheet-open{overflow:hidden!important}
  body:has(dialog[open]){overflow:hidden!important}
}

/* Mobile WhatsApp inbox — maximize visible chat list */
@media (max-width:767.98px){
  #inboxView{height:calc(100dvh - 64px - var(--mobile-nav-height))!important;min-height:0!important;overflow:hidden!important}
  #inboxView .wa-main-panel{height:100%!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
  #inboxView .wa-page-tabs{flex:0 0 auto!important;min-height:46px!important;padding:4px 8px!important}
  #inboxView .wa-inbox-layout{flex:1 1 auto!important;height:auto!important;min-height:0!important;overflow:hidden!important}
  #inboxView .wa-conversation-column{display:flex!important;flex-direction:column!important;min-height:0!important;overflow:hidden!important}
  #inboxView .wa-conversation-header{flex:0 0 auto!important;min-height:52px!important;padding:5px 9px!important}
  #inboxView .wa-conversation-tools{flex:0 0 auto!important;padding:6px 9px!important}
  #inboxView .wa-inbox-search input{min-height:42px!important;font-size:16px!important}
  #inboxView .wa-inbox-filter-toolbar{margin-top:5px!important}
  #inboxView .wa-quick-filters{gap:5px!important}
  #inboxView .wa-quick-filters button{min-height:36px!important;padding:5px 10px!important;font-size:12px!important}
  #inboxView .wa-inbox-action-filters{margin-top:5px!important;gap:5px!important}
  #inboxView .wa-inbox-action-filters button{min-height:34px!important;padding:4px 9px!important;font-size:12px!important}
  #inboxView .wa-filter-group-label{display:none!important}
  #inboxView .wa-conversation-list{flex:1 1 0!important;height:auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-y:contain!important;touch-action:pan-y!important;padding-bottom:12px!important}
  #inboxView .wa-conversation-item{width:100%!important;min-height:72px!important;padding:10px 11px!important;display:grid!important;grid-template-columns:48px minmax(0,1fr)!important;gap:10px!important;text-align:left!important}
  #inboxView .wa-contact-avatar{width:48px!important;height:48px!important;min-width:48px!important;font-size:16px!important}
  #inboxView .wa-conversation-copy{min-width:0!important;overflow:hidden!important}
  #inboxView .wa-conversation-top{display:flex!important;align-items:center!important;gap:8px!important}
  #inboxView .wa-conversation-top strong{min-width:0!important;flex:1!important;font-size:16px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #inboxView .wa-conversation-top time{flex:0 0 auto!important;font-size:11px!important}
  #inboxView .wa-conversation-preview{display:flex!important;align-items:center!important;gap:8px!important;min-width:0!important}
  #inboxView .wa-conversation-preview small{display:block!important;min-width:0!important;flex:1!important;font-size:13px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #inboxView .wa-conversation-preview b{flex:0 0 auto!important}
  #inboxView .wa-conversation-context{max-width:100%!important;overflow-x:auto!important;flex-wrap:nowrap!important;scrollbar-width:none!important}
  #inboxView .wa-conversation-context::-webkit-scrollbar{display:none}
  #inboxView .wa-mini-label,#inboxView .wa-assignee-mini{flex:0 0 auto!important;white-space:nowrap!important}
  #inboxView .wa-load-more-button{width:calc(100% - 18px)!important;margin:10px 9px!important;min-height:44px!important}
  #inboxView .wa-list-end{padding:14px 10px calc(14px + env(safe-area-inset-bottom))!important}
}

/* Mobile app header — compact, stable, app-like */
@media (max-width:767.98px){
  .topbar{
    position:sticky!important;top:0!important;z-index:1035!important;
    display:grid!important;grid-template-columns:48px minmax(0,1fr) 48px!important;
    align-items:center!important;gap:8px!important;
    width:100%!important;height:auto!important;min-height:64px!important;
    padding:8px 12px!important;margin:0!important;
    background:rgba(255,255,255,.98)!important;
    border-bottom:1px solid rgba(15,23,42,.08)!important;
    box-shadow:0 4px 18px rgba(15,23,42,.05)!important;
    overflow:visible!important;
  }
  .sidebar-open-button{
    grid-column:1!important;width:46px!important;height:46px!important;min-width:46px!important;
    margin:0!important;padding:0!important;border-radius:14px!important;
    display:grid!important;place-items:center!important;
  }
  .sidebar-open-button i{font-size:25px!important;line-height:1!important}
  .sidebar-open-button span{display:none!important}
  .topbar-title-block{
    grid-column:2!important;min-width:0!important;width:100%!important;
    display:flex!important;flex-direction:column!important;justify-content:center!important;
    align-items:flex-start!important;gap:1px!important;overflow:hidden!important;
  }
  .topbar-title-block .eyebrow{display:block!important;margin:0!important;font-size:10px!important;line-height:1.1!important;font-weight:750!important;letter-spacing:.08em!important;text-transform:uppercase!important;color:#94a3b8!important}
  .topbar-title-block h1{
    width:100%!important;margin:0!important;font-size:20px!important;line-height:1.2!important;
    font-weight:750!important;color:#0f172a!important;white-space:nowrap!important;
    overflow:hidden!important;text-overflow:ellipsis!important;
  }
  .topbar-workspace-identity,.topbar-network-status{display:none!important}
  .topbar-notification{
    grid-column:3!important;position:relative!important;display:flex!important;
    align-items:center!important;justify-content:flex-end!important;margin:0!important;
    width:48px!important;min-width:48px!important;
  }
  .notification-button{
    width:46px!important;height:46px!important;min-width:46px!important;margin:0!important;padding:0!important;
    border-radius:14px!important;display:grid!important;place-items:center!important;
  }
  .notification-button i{font-size:21px!important;line-height:1!important}
  .notification-badge{top:4px!important;right:3px!important;min-width:17px!important;height:17px!important;font-size:9px!important}
  .notification-menu{
    top:calc(64px + env(safe-area-inset-top))!important;right:8px!important;left:8px!important;
    width:auto!important;max-width:none!important;
  }
}
@media (max-width:359.98px){
  .topbar{grid-template-columns:44px minmax(0,1fr) 44px!important;padding-left:8px!important;padding-right:8px!important;gap:6px!important}
  .sidebar-open-button,.notification-button{width:42px!important;height:42px!important;min-width:42px!important}
  .topbar-title-block h1{font-size:18px!important}
}
@media (max-width:767.98px) and (display-mode:standalone){
  .topbar{padding-top:calc(8px + env(safe-area-inset-top))!important;min-height:calc(64px + env(safe-area-inset-top))!important}
}

/* WhatsApp mobile layout v2 — single, authoritative master/detail geometry */
@media (max-width:767.98px){
  #inboxView{padding:0!important;height:calc(100dvh - 64px - var(--mobile-nav-height))!important;min-height:0!important;overflow:hidden!important;background:#f8fafc}
  #inboxView .wa-main-panel{height:100%!important;min-height:0!important;margin:0!important;border:0!important;border-radius:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;background:#fff}
  #inboxView .wa-page-tabs{flex:0 0 44px!important;min-height:44px!important;height:44px!important;padding:4px 8px!important;gap:5px!important;overflow-x:auto!important;overflow-y:hidden!important;white-space:nowrap!important}
  #inboxView .wa-page-tab{min-height:36px!important;height:36px!important;padding:0 11px!important;font-size:12px!important}
  #inboxView .wa-inbox-layout{position:relative!important;display:block!important;flex:1 1 0!important;width:100%!important;height:auto!important;min-height:0!important;overflow:hidden!important}
  #inboxView .wa-conversation-column,#inboxView .wa-chat-column{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-width:0!important;max-width:none!important;min-height:0!important;margin:0!important;border:0!important;background:#fff!important}
  #inboxView .wa-conversation-column{z-index:2!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;visibility:visible!important}
  #inboxView .wa-chat-column{z-index:3!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;transform:translate3d(100%,0,0)!important;visibility:hidden!important;pointer-events:none!important;transition:transform .2s ease,visibility 0s linear .2s!important}
  #inboxView .wa-inbox-layout.mobile-chat-open .wa-conversation-column{visibility:hidden!important;pointer-events:none!important}
  #inboxView .wa-inbox-layout.mobile-chat-open .wa-chat-column{transform:translate3d(0,0,0)!important;visibility:visible!important;pointer-events:auto!important;transition:transform .2s ease!important}
  #inboxView .wa-conversation-header{flex:0 0 52px!important;height:52px!important;min-height:52px!important;padding:5px 10px!important;overflow:hidden!important}
  #inboxView .wa-conversation-tools{flex:0 0 auto!important;padding:7px 10px 6px!important;border-bottom:1px solid #eef2f7!important;overflow:hidden!important}
  #inboxView .wa-inbox-search{margin:0!important}
  #inboxView .wa-inbox-search input{height:42px!important;min-height:42px!important}
  #inboxView .wa-quick-filters,#inboxView .wa-inbox-action-filters{display:flex!important;overflow-x:auto!important;overflow-y:hidden!important;flex-wrap:nowrap!important;scrollbar-width:none!important;touch-action:pan-x!important}
  #inboxView .wa-quick-filters::-webkit-scrollbar,#inboxView .wa-inbox-action-filters::-webkit-scrollbar{display:none}
  #inboxView .wa-advanced-filters:not(.hidden){max-height:150px!important;overflow-y:auto!important}
  #inboxView .wa-conversation-list{position:relative!important;flex:1 1 0!important;width:100%!important;height:0!important;min-height:0!important;max-height:none!important;padding:0 0 calc(10px + env(safe-area-inset-bottom))!important;margin:0!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;touch-action:pan-y!important}
  #inboxView .wa-conversation-item{box-sizing:border-box!important;border-radius:0!important;border-left:0!important;border-right:0!important;margin:0!important}
  #inboxView .wa-chat-header{position:relative!important;top:auto!important;flex:0 0 62px!important;height:62px!important;min-height:62px!important;padding:6px 8px 6px 54px!important;border-bottom:1px solid #e9eef5!important;overflow:hidden!important}
  #inboxView .wa-chat-header:before{left:8px!important;top:10px!important;width:40px!important;height:40px!important}
  #inboxView .wa-service-window:not(.hidden){flex:0 0 auto!important;margin:0!important;border-radius:0!important}
  #inboxView .wa-message-list{position:relative!important;flex:1 1 0!important;height:0!important;min-height:0!important;max-height:none!important;padding:12px 10px!important;margin:0!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;touch-action:pan-y!important}
  #inboxView .wa-composer-zone{position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;flex:0 0 auto!important;width:100%!important;padding:5px 6px calc(5px + env(safe-area-inset-bottom))!important;margin:0!important;border-top:1px solid #e9eef5!important;box-shadow:none!important;background:#fff!important}
  #inboxView .wa-composer{padding:0!important;align-items:end!important}
  #inboxView #waComposerInput{min-height:44px!important;max-height:104px!important}
  #inboxView .wa-contact-column{top:calc(64px + env(safe-area-inset-top))!important;bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom))!important;left:8%!important;overflow-y:auto!important}
}

/* Mobile UX scale + Home→WhatsApp stabilization */
@media (max-width:767.98px){
  :root{--mobile-nav-height:82px}
  html{font-size:18px!important}
  body{font-size:17px!important;line-height:1.48!important}
  .view:not(#inboxView){padding-left:12px!important;padding-right:12px!important}
  h1{font-size:26px!important} h2{font-size:23px!important} h3{font-size:20px!important}
  small{font-size:13px!important}
  .btn,button,.button{min-height:48px}
  .btn i,button i,.button i{font-size:20px}

  .topbar{grid-template-columns:52px minmax(0,1fr) 52px!important;min-height:68px!important;padding:8px 10px!important}
  .sidebar-open-button,.notification-button{width:50px!important;height:50px!important;min-width:50px!important}
  .sidebar-open-button i{font-size:28px!important}.notification-button i{font-size:24px!important}
  .topbar-title-block .eyebrow{font-size:11px!important}
  .topbar-title-block h1{font-size:22px!important}
  .notification-menu{top:calc(68px + env(safe-area-inset-top))!important}

  .mobile-bottom-nav{height:76px!important;bottom:max(6px,env(safe-area-inset-bottom))!important;padding:5px 4px!important}
  .mobile-nav-item{min-width:0!important;font-size:12px!important;line-height:1.05!important;gap:4px!important;padding:4px 2px!important}
  .mobile-nav-item i{font-size:27px!important}
  .mobile-nav-item.mobile-nav-primary{height:68px!important}
  .mobile-more-grid button{min-height:96px!important;font-size:13px!important}
  .mobile-more-grid i{font-size:30px!important}

  #dashboardView{min-width:0!important;overflow-x:hidden!important}
  #dashboardView .dashboard-command-bar{width:100%!important;min-width:0!important;box-sizing:border-box!important;overflow:hidden!important}
  #dashboardView .dashboard-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;width:100%!important}
  #dashboardView .dashboard-kpi-card{min-width:0!important;padding:14px 12px!important}
  #dashboardView .dashboard-kpi-card strong{font-size:27px!important;line-height:1.15!important}
  #dashboardView .dashboard-kpi-card small{font-size:13px!important}
  #dashboardView button i,#dashboardView .dashboard-command-icon i{font-size:21px!important}

  #leadsView,#reminderView{min-width:0!important;overflow-x:hidden!important}
  #leadsView tbody tr.clickable-row{min-width:0!important}
  #leadsView tbody tr.clickable-row td:nth-child(4) strong{font-size:19px!important}
  #leadsView tbody tr.clickable-row td:nth-child(5),#leadsView tbody tr.clickable-row td:nth-child(12){font-size:14px!important}
  #leadsView .status-pill{font-size:12px!important}
  #reminderView .sp-head h2{font-size:23px!important}

  #inboxView{height:calc(100dvh - 68px - var(--mobile-nav-height))!important;max-width:100vw!important;overflow:hidden!important}
  #inboxView .wa-main-panel,#inboxView .wa-inbox-layout,#inboxView .wa-conversation-column,#inboxView .wa-chat-column{max-width:100%!important;min-width:0!important}
  #inboxView .wa-page-tabs{flex-basis:48px!important;height:48px!important;min-height:48px!important}
  #inboxView .wa-page-tab{height:40px!important;min-height:40px!important;font-size:13px!important}
  #inboxView .wa-conversation-header{height:58px!important;min-height:58px!important;flex-basis:58px!important}
  #inboxView .wa-conversation-header button i{font-size:21px!important}
  #inboxView .wa-inbox-search input{height:46px!important;min-height:46px!important;font-size:17px!important}
  #inboxView .wa-quick-filters button,#inboxView .wa-inbox-action-filters button{font-size:13px!important;min-height:38px!important}
  #inboxView .wa-conversation-item{min-height:82px!important;padding:12px!important;grid-template-columns:54px minmax(0,1fr)!important;gap:11px!important}
  #inboxView .wa-contact-avatar{width:54px!important;height:54px!important;min-width:54px!important;font-size:18px!important}
  #inboxView .wa-conversation-top strong{font-size:18px!important}
  #inboxView .wa-conversation-top time{font-size:12px!important}
  #inboxView .wa-conversation-preview small{font-size:14px!important}
  #inboxView .wa-conversation-preview b{min-width:22px!important;height:22px!important;font-size:11px!important}
  #inboxView .wa-mini-label,#inboxView .wa-assignee-mini{font-size:11px!important}
  #inboxView .wa-chat-header{height:68px!important;min-height:68px!important;flex-basis:68px!important;padding-left:60px!important}
  #inboxView .wa-chat-header:before{width:44px!important;height:44px!important;top:12px!important;font-size:34px!important}
  #inboxView .wa-chat-header strong{font-size:17px!important}
  #inboxView .wa-chat-header small{font-size:12px!important}
  #inboxView .wa-message-list{font-size:16px!important;padding:14px 10px!important}
  #inboxView .wa-message-list button i,#inboxView .wa-composer-zone button i{font-size:21px!important}
  #inboxView #waComposerInput{min-height:48px!important;font-size:17px!important}
  #inboxView .wa-send-button{width:48px!important;height:48px!important;min-width:48px!important}
  #inboxView .wa-contact-column{top:calc(68px + env(safe-area-inset-top))!important}
}
@media (max-width:359.98px){
  html{font-size:17px!important}
  body{font-size:16px!important}
  .topbar{grid-template-columns:46px minmax(0,1fr) 46px!important}
  .sidebar-open-button,.notification-button{width:44px!important;height:44px!important;min-width:44px!important}
  .topbar-title-block h1{font-size:20px!important}
  #dashboardView .dashboard-kpi-card strong{font-size:24px!important}
  #inboxView .wa-conversation-item{grid-template-columns:50px minmax(0,1fr)!important;padding:10px 9px!important}
  #inboxView .wa-contact-avatar{width:50px!important;height:50px!important;min-width:50px!important}
}

/* WhatsApp mobile emergency visibility fix — remove zero-height list collapse */
@media (max-width:767.98px){
  #inboxView .wa-inbox-layout{
    display:grid!important;
    grid-template-rows:minmax(0,1fr)!important;
    height:100%!important;
    min-height:0!important;
  }
  #inboxView .wa-conversation-column{
    height:100%!important;
    min-height:0!important;
    display:grid!important;
    grid-template-rows:auto auto minmax(0,1fr)!important;
  }
  #inboxView .wa-conversation-list{
    display:block!important;
    position:relative!important;
    width:100%!important;
    height:100%!important;
    min-height:120px!important;
    max-height:none!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    visibility:visible!important;
    opacity:1!important;
  }
  #inboxView .wa-conversation-list>.wa-conversation-item,
  #inboxView .wa-conversation-list>button{
    visibility:visible!important;
    opacity:1!important;
  }
  #inboxView .wa-inbox-layout:not(.mobile-chat-open) .wa-conversation-column{
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
  }
  #inboxView .wa-inbox-layout:not(.mobile-chat-open) .wa-chat-column{
    visibility:hidden!important;
    pointer-events:none!important;
  }
}

/* WhatsApp mobile full-screen viewport fix */
@media (max-width:767.98px){
  body:has(#inboxView.active){
    height:100dvh!important;
    min-height:100dvh!important;
    overflow:hidden!important;
  }
  body:has(#inboxView.active) #appShell.app-shell:not(.hidden),
  body:has(#inboxView.active) #appShell>.main,
  body:has(#inboxView.active) .app-shell>.main{
    height:100dvh!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  #inboxView.active{
    position:fixed!important;
    top:68px!important;
    left:0!important;
    right:0!important;
    bottom:calc(82px + max(6px,env(safe-area-inset-bottom)))!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    padding:0!important;
    margin:0!important;
    overflow:hidden!important;
    z-index:20!important;
  }
  #inboxView.active .wa-main-panel{
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
  }
  #inboxView.active .wa-inbox-layout{
    height:auto!important;
    min-height:0!important;
    flex:1 1 0!important;
  }
  #inboxView.active .wa-conversation-column,
  #inboxView.active .wa-chat-column{
    top:0!important;
    bottom:0!important;
    height:auto!important;
    min-height:0!important;
  }
  #inboxView.active .wa-conversation-list{
    height:auto!important;
    min-height:0!important;
    align-self:stretch!important;
  }
}
@media (max-width:767.98px) and (display-mode:standalone){
  #inboxView.active{
    top:calc(68px + env(safe-area-inset-top))!important;
  }
}

/* Property Listing mobile app-style detail — mirror WhatsApp master/detail feel */
@media (max-width:767.98px){
  #propertyCatalogView{min-width:0!important;overflow-x:hidden!important}
  #propertyCatalogView .pcat-card,
  #propertyCatalogView .pcat-row{cursor:pointer!important;-webkit-tap-highlight-color:transparent}
  #propertyCatalogView .pcat-card:active,
  #propertyCatalogView .pcat-row:active{transform:scale(.995)}
  #propertyCatalogView .pcat-shell.pcat-detail-mode{
    position:fixed!important;
    top:68px!important;
    left:0!important;
    right:0!important;
    bottom:calc(82px + max(6px,env(safe-area-inset-bottom)))!important;
    z-index:25!important;
    display:block!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    padding:0!important;
    margin:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    background:#f8fafc!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
  }
  #propertyCatalogView .pcat-shell.pcat-detail-mode>.pcat-command,
  #propertyCatalogView .pcat-shell.pcat-detail-mode>.pcat-tabs{display:none!important}
  #propertyCatalogView .pcat-shell.pcat-detail-mode #pcatContent{width:100%!important;min-height:100%!important;margin:0!important;padding:0 0 18px!important}
  #propertyCatalogView .pcat-detail-topbar{
    position:sticky!important;top:0!important;z-index:8!important;
    min-height:58px!important;margin:0!important;padding:8px 10px!important;
    border-radius:0!important;border-left:0!important;border-right:0!important;
  }
  #propertyCatalogView .pcat-back-button{width:46px!important;min-width:46px!important;height:46px!important;border-radius:14px!important}
  #propertyCatalogView .pcat-back-button i{font-size:22px!important}
  #propertyCatalogView .pcat-detail-layout{margin:0!important;padding:0 10px 14px!important}
  #propertyCatalogView .pcat-detail-heading h1{font-size:22px!important;line-height:1.25!important}
  #propertyCatalogView .pcat-detail-price{font-size:23px!important}
  #propertyCatalogView .pcat-detail-actions button{min-height:46px!important}
}
@media (max-width:767.98px) and (display-mode:standalone){
  #propertyCatalogView .pcat-shell.pcat-detail-mode{top:calc(68px + env(safe-area-inset-top))!important}
}
