/* 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}
}

/* WhatsApp CRM Mobile V3 — clean app-first workspace */
@media (max-width:767.98px){
  body:has(#inboxView.active){height:100dvh!important;overflow:hidden!important}
  #inboxView.active{position:fixed!important;top:68px!important;right:0!important;bottom:calc(82px + max(6px,env(safe-area-inset-bottom)))!important;left:0!important;width:100vw!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;overflow:hidden!important;background:#f6f8fb!important;z-index:20!important}
  #inboxView *{box-sizing:border-box}
  #inboxView .wa-main-panel{position:absolute!important;inset:0!important;display:flex!important;flex-direction:column!important;width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;overflow:hidden!important;background:#fff!important}
  #inboxView .wa-page-tabs{order:2!important;flex:0 0 54px!important;display:flex!important;align-items:center!important;gap:4px!important;width:100%!important;height:54px!important;min-height:54px!important;margin:0!important;padding:5px 10px!important;overflow-x:auto!important;overflow-y:hidden!important;white-space:nowrap!important;scrollbar-width:none!important;border-top:1px solid #edf1f5!important;border-bottom:0!important;background:#fff!important}
  #inboxView .wa-page-tabs::-webkit-scrollbar{display:none}
  #inboxView .wa-page-tab{flex:0 0 44px!important;display:grid!important;place-items:center!important;width:44px!important;height:42px!important;min-width:44px!important;min-height:42px!important;margin:0!important;padding:0!important;border-radius:12px!important;font-size:0!important}
  #inboxView .wa-page-tab i{font-size:20px!important;margin:0!important}
  #inboxView .wa-page-tab span{display:none!important}
  #inboxView .wa-page-tab.active{background:#eef7fb!important;color:#087aa5!important}
  #inboxView .wa-followup-panel.wa-inbox-panel{order:1!important;position:relative!important;display:block!important;flex:1 1 0!important;width:100%!important;height:auto!important;min-width:0!important;min-height:0!important;margin:0!important;padding:0!important;overflow:hidden!important;visibility:visible!important;opacity:1!important;background:#fff!important}
  #inboxView .wa-inbox-layout{position:absolute!important;inset:0!important;display:block!important;width:auto!important;height:auto!important;min-width:0!important;min-height:0!important;overflow:hidden!important}
  #inboxView .wa-conversation-column,#inboxView .wa-chat-column{position:absolute!important;inset:0!important;width:auto!important;height:auto!important;min-width:0!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;pointer-events:auto!important}
  #inboxView .wa-conversation-header{flex:0 0 66px!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:8px!important;width:100%!important;height:66px!important;min-height:66px!important;margin:0!important;padding:8px 12px!important;border-bottom:1px solid #edf1f5!important;background:#fff!important;overflow:hidden!important}
  #inboxView .wa-mobile-inbox-heading{display:flex!important;flex-direction:column!important;justify-content:center!important;min-width:0!important}
  #inboxView .wa-mobile-inbox-heading span{font-size:19px!important;font-weight:800!important;line-height:1.15!important;color:#142433!important}
  #inboxView .wa-mobile-inbox-heading small{margin-top:3px!important;font-size:12px!important;line-height:1.1!important;color:#758393!important}
  #inboxView .wa-conversation-title{display:none!important}
  #inboxView .wa-conversation-header-actions{display:flex!important;align-items:center!important;gap:4px!important;min-width:0!important}
  #inboxView .wa-list-collapse-toggle,#inboxView .wa-inbox-focus-toggle{display:none!important}
  #inboxView .wa-inbox-context-connection summary{display:grid!important;place-items:center!important;width:40px!important;height:44px!important;min-width:40px!important;padding:0!important;border-radius:12px!important}
  #inboxView .wa-inbox-context-connection summary strong,#inboxView .wa-inbox-context-connection summary .bi-chevron-down{display:none!important}
  #inboxView .wa-status-dot{width:10px!important;height:10px!important}
  #inboxView .wa-icon-button{display:grid!important;place-items:center!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;margin:0!important;padding:0!important;border-radius:12px!important}
  #inboxView .wa-icon-button i{font-size:20px!important}
  #inboxView .wa-conversation-tools{flex:0 0 auto!important;width:100%!important;min-width:0!important;margin:0!important;padding:10px 12px 8px!important;border-bottom:1px solid #edf1f5!important;background:#fff!important;overflow:hidden!important}
  #inboxView .wa-inbox-search{display:flex!important;width:100%!important;margin:0 0 8px!important}
  #inboxView .wa-inbox-search input{width:100%!important;height:48px!important;min-height:48px!important;padding-left:42px!important;font-size:16px!important;border-radius:14px!important}
  #inboxView .wa-quick-filters,#inboxView .wa-inbox-action-filters{display:flex!important;gap:6px!important;width:100%!important;max-width:100%!important;margin:0!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-quick-filters button,#inboxView .wa-inbox-action-filters button{flex:0 0 auto!important;min-width:auto!important;min-height:38px!important;padding:6px 12px!important;font-size:12px!important;white-space:nowrap!important;border-radius:11px!important}
  #inboxView .wa-inbox-action-filters{margin-top:6px!important}
  #inboxView .wa-filter-group-label{display:none!important}
  #inboxView .wa-advanced-filters:not(.hidden){max-height:140px!important;overflow-y:auto!important}
  #inboxView .wa-conversation-list{position:relative!important;display:block!important;flex:1 1 0!important;width:100%!important;height:auto!important;min-width:0!important;min-height:0!important;max-height:none!important;margin:0!important;padding:4px 0 14px!important;overflow-x:hidden!important;overflow-y:auto!important;visibility:visible!important;opacity:1!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;background:#fff!important}
  #inboxView .wa-conversation-item{display:grid!important;grid-template-columns:54px minmax(0,1fr)!important;gap:11px!important;width:100%!important;max-width:100%!important;min-height:82px!important;margin:0!important;padding:12px!important;border:0!important;border-bottom:1px solid #f0f3f6!important;border-radius:0!important;overflow:hidden!important;text-align:left!important;background:#fff!important}
  #inboxView .wa-conversation-item:active{background:#f5f8fb!important}
  #inboxView .wa-contact-avatar{width:54px!important;height:54px!important;min-width:54px!important;font-size:16px!important}
  #inboxView .wa-conversation-copy{min-width:0!important;max-width:100%!important;overflow:hidden!important}
  #inboxView .wa-conversation-top{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:8px!important;min-width:0!important}
  #inboxView .wa-conversation-top strong{min-width:0!important;font-size:17px!important;line-height:1.25!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #inboxView .wa-conversation-top time{font-size:11px!important;white-space:nowrap!important;color:#7d8995!important}
  #inboxView .wa-conversation-preview{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:8px!important;min-width:0!important;margin-top:3px!important}
  #inboxView .wa-conversation-preview small{min-width:0!important;font-size:13px!important;line-height:1.3!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #inboxView .wa-conversation-preview b{min-width:22px!important;height:22px!important;font-size:11px!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;background:#f6f8fb!important;transition:transform .2s ease!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}
  #inboxView .wa-chat-header{position:relative!important;flex:0 0 68px!important;width:100%!important;height:68px!important;min-height:68px!important;margin:0!important;padding:7px 10px 7px 60px!important;border-bottom:1px solid #e7edf3!important;background:#fff!important;overflow:hidden!important}
  #inboxView .wa-chat-header:before{left:10px!important;top:12px!important;width:44px!important;height:44px!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;width:100%!important;height:auto!important;min-height:0!important;margin:0!important;padding:14px 10px!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;background:#f6f8fb!important}
  #inboxView .wa-composer-zone{position:relative!important;flex:0 0 auto!important;width:100%!important;margin:0!important;padding:6px 8px calc(6px + env(safe-area-inset-bottom))!important;border-top:1px solid #e7edf3!important;background:#fff!important}
  #inboxView #waComposerInput{min-height:48px!important;max-height:104px!important;font-size:16px!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}
}


/* Mobile Auth V1 — native app-style sign-in */
@media (max-width: 767.98px) {
  body:has(#loginScreen:not(.hidden)) {
    width: 100%;
    min-width: 0;
    min-height: 100dvh;
    overflow-x: hidden;
    background: #f7f9fc;
  }

  #loginScreen.login-screen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    background: #f7f9fc;
    z-index: 1200;
  }

  #loginScreen .login-shell {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 100%;
    margin: 0;
    padding: 0;
    background: #f7f9fc;
  }

  #loginScreen .login-showcase {
    display: none !important;
  }

  #loginScreen .login-panel {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 100dvh;
    margin: 0;
    padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
    background: #f7f9fc;
  }

  #loginScreen .login-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 430px;
    min-width: 0;
    margin: 0 auto;
    padding: 12px 0 20px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  #loginScreen .login-mobile-brand {
    display: flex !important;
    align-items: center;
    gap: 12px;
    margin: 0 0 38px;
  }

  #loginScreen .login-mobile-brand .login-logo {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(18, 43, 67, .08);
    overflow: hidden;
  }

  #loginScreen .login-mobile-brand .login-logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
  }

  #loginScreen .login-mobile-brand strong {
    display: block;
    font-size: 21px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.3px;
    color: #142433;
  }

  #loginScreen .login-mobile-brand small {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #7a8998;
  }

  #loginScreen .login-heading {
    margin: 0 0 28px;
  }

  #loginScreen .login-secure-label {
    display: none;
  }

  #loginScreen .login-heading h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -.7px;
    color: #142433;
  }

  #loginScreen .login-heading p {
    margin: 9px 0 0;
    max-width: 320px;
    font-size: 15px;
    line-height: 1.5;
    color: #6f7e8d;
  }

  #loginScreen .login-field {
    display: block;
    width: 100%;
    margin: 0 0 18px;
  }

  #loginScreen .login-field > span:first-child {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    color: #314454;
  }

  #loginScreen .login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    height: 56px;
    min-height: 56px;
    padding: 0 14px;
    border: 1px solid #dce4eb;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(18, 43, 67, .025);
  }

  #loginScreen .login-input-wrap:focus-within {
    border-color: #2687aa;
    box-shadow: 0 0 0 3px rgba(38, 135, 170, .10);
  }

  #loginScreen .login-input-wrap > i {
    flex: 0 0 auto;
    margin-right: 11px;
    font-size: 20px;
    color: #7c8b99;
  }

  #loginScreen .login-input-wrap input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 16px !important;
    color: #142433;
  }

  #loginScreen .login-input-wrap input::placeholder {
    color: #9aa6b2;
  }

  #loginScreen .login-password-toggle,
  #loginScreen .login-refresh-button {
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0 -7px 0 6px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #526575;
  }

  #loginScreen .login-password-toggle i,
  #loginScreen .login-refresh-button i {
    font-size: 20px;
  }

  #loginScreen .login-password-tools {
    display: flex;
    justify-content: flex-end;
    margin: -8px 0 20px;
  }

  #loginScreen .login-text-button {
    min-height: 42px;
    padding: 7px 0;
    font-size: 14px;
    font-weight: 700;
  }

  #loginScreen .login-captcha-wrap {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    width: 100%;
  }

  #loginScreen .captcha-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 112px;
    height: 56px;
    min-height: 56px;
    padding: 0 7px 0 13px;
    border: 1px solid #dce4eb;
    border-radius: 16px;
    background: #eef3f7;
  }

  #loginScreen .captcha-row strong {
    font-size: 16px;
    white-space: nowrap;
    color: #263a4b;
  }

  #loginScreen .login-captcha-wrap .login-input-wrap {
    min-width: 0;
  }

  #loginScreen .login-submit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 56px;
    min-height: 56px;
    margin: 4px 0 0;
    padding: 0 20px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 800;
    touch-action: manipulation;
  }

  #loginScreen .login-submit-button i {
    font-size: 20px;
  }

  #loginScreen .login-hint:not(:empty) {
    margin: 12px 0 0;
    padding: 11px 13px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
  }

  #loginScreen .login-trust {
    margin: 20px 0 0;
    text-align: center;
    font-size: 12px;
    color: #7b8997;
  }

  #loginScreen .login-create-workspace {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 28px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid #e5ebf0;
    text-align: center;
    font-size: 14px;
  }

  #loginScreen .login-create-workspace a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 800;
  }

  #loginScreen .login-create-workspace small {
    flex: 0 0 100%;
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.4;
    color: #8996a3;
  }

  dialog.auth-dialog {
    width: calc(100% - 24px) !important;
    max-width: 430px !important;
    max-height: calc(100dvh - 24px) !important;
    margin: auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 22px !important;
    overflow: auto !important;
  }

  dialog.auth-dialog .auth-dialog-card {
    width: 100% !important;
    margin: 0 !important;
    padding: 24px 20px max(24px, env(safe-area-inset-bottom)) !important;
    border: 0 !important;
    border-radius: 22px !important;
  }

  dialog.auth-dialog input {
    min-height: 52px !important;
    font-size: 16px !important;
  }
}

@media (max-width: 359.98px) {
  #loginScreen .login-panel { padding-left: 16px; padding-right: 16px; }
  #loginScreen .login-mobile-brand { margin-bottom: 30px; }
  #loginScreen .login-heading h2 { font-size: 27px; }
  #loginScreen .login-captcha-wrap { grid-template-columns: 104px minmax(0, 1fr); }
  #loginScreen .captcha-row { width: 104px; padding-left: 10px; }
}


/* Mobile Auth V1.1 — enterprise centered visual hierarchy */
@media (max-width: 767.98px) {
  #loginScreen .login-card {
    align-items: stretch;
  }

  #loginScreen .login-mobile-brand {
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    margin-bottom: 34px;
    text-align: center;
  }

  #loginScreen .login-mobile-brand > span:last-child {
    display: block;
    width: 100%;
    text-align: center;
  }

  #loginScreen .login-mobile-brand strong,
  #loginScreen .login-mobile-brand small {
    width: 100%;
    text-align: center;
  }

  #loginScreen .login-mobile-brand strong {
    font-size: 22px;
    letter-spacing: -.45px;
  }

  #loginScreen .login-mobile-brand small {
    margin-top: 5px;
    font-size: 10px;
    letter-spacing: 2px;
  }

  #loginScreen .login-heading {
    width: 100%;
    margin-bottom: 30px;
    text-align: center;
  }

  #loginScreen .login-heading h2 {
    width: 100%;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    text-wrap: balance;
  }

  #loginScreen .login-heading p {
    max-width: 330px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    text-wrap: balance;
  }

  #loginScreen .login-field > span:first-child {
    text-align: left;
  }

  #loginScreen .login-input-wrap input {
    text-align: left;
  }

  #loginScreen .login-submit-button {
    text-align: center;
  }

  #loginScreen .login-hint {
    text-align: center;
  }

  #loginScreen .login-trust,
  #loginScreen .login-trust span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    text-align: center;
  }

  #loginScreen .login-create-workspace {
    line-height: 1.45;
  }

  #loginScreen .login-create-workspace > span,
  #loginScreen .login-create-workspace > a,
  #loginScreen .login-create-workspace > small {
    text-align: center;
  }
}


/* Mobile Auth V1.2 — balanced native-app vertical composition */
@media (max-width: 767.98px) {
  #loginScreen .login-panel {
    display: flex;
    align-items: stretch;
  }

  #loginScreen .login-card {
    flex: 1 1 auto;
    min-height: calc(100dvh - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
    padding-top: 6px;
    padding-bottom: 0;
  }

  #loginScreen .login-mobile-brand {
    margin-bottom: clamp(22px, 4.5dvh, 36px);
  }

  #loginScreen .login-heading {
    margin-bottom: clamp(22px, 3.8dvh, 30px);
  }

  #loginScreen .login-field {
    margin-bottom: 16px;
  }

  #loginScreen .login-password-tools {
    margin-bottom: 16px;
  }

  #loginScreen .login-trust {
    margin-top: auto;
    padding-top: clamp(24px, 4dvh, 40px);
  }

  #loginScreen .login-create-workspace {
    margin-top: 14px;
    padding-top: 16px;
  }
}

@media (max-width: 767.98px) and (max-height: 720px) {
  #loginScreen .login-panel {
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  #loginScreen .login-card {
    min-height: auto;
  }

  #loginScreen .login-mobile-brand {
    margin-bottom: 18px;
  }

  #loginScreen .login-heading {
    margin-bottom: 20px;
  }

  #loginScreen .login-heading h2 {
    font-size: 27px;
  }

  #loginScreen .login-heading p {
    margin-top: 6px;
  }

  #loginScreen .login-field {
    margin-bottom: 13px;
  }

  #loginScreen .login-password-tools {
    margin-bottom: 12px;
  }

  #loginScreen .login-trust {
    margin-top: 20px;
    padding-top: 0;
  }

  #loginScreen .login-create-workspace {
    margin-top: 10px;
    padding-top: 12px;
  }
}


/* Mobile account action — explicit logout in More sheet */
@media (max-width: 767.98px) {
  .mobile-more-account-actions {
    margin: 14px 16px max(14px, env(safe-area-inset-bottom));
    padding-top: 14px;
    border-top: 1px solid rgba(20, 36, 51, .09);
  }

  .mobile-more-account-actions .mobile-logout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid rgba(190, 55, 55, .18);
    border-radius: 15px;
    background: rgba(190, 55, 55, .055);
    color: #a52d2d;
    font-size: 15px;
    font-weight: 750;
    touch-action: manipulation;
  }

  .mobile-more-account-actions .mobile-logout-button i {
    font-size: 20px;
  }
}


/* WhatsApp CRM Mobile V4 — deterministic conversation viewport
   Keep the chat list as the only vertical scroller and remove inherited
   min-height/height constraints that can clip the final conversations. */
@media (max-width:767.98px){
  body:has(#inboxView.active){
    position:fixed!important;
    inset:0!important;
    width:100%!important;
    height:100dvh!important;
    min-height:0!important;
    overflow:hidden!important;
  }

  #appShell.app-shell:not(.hidden):has(#inboxView.active),
  #appShell.app-shell:not(.hidden):has(#inboxView.active)>.main{
    height:100dvh!important;
    min-height:0!important;
    max-height:100dvh!important;
    overflow:hidden!important;
  }

  #inboxView.active{
    top:68px!important;
    bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom))!important;
    height:auto!important;
    max-height:none!important;
    min-height:0!important;
    overflow:hidden!important;
  }

  #inboxView .wa-main-panel,
  #inboxView .wa-followup-panel.wa-inbox-panel,
  #inboxView .wa-inbox-layout,
  #inboxView .wa-conversation-column{
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
  }

  #inboxView .wa-main-panel{
    display:grid!important;
    grid-template-rows:minmax(0,1fr) 54px!important;
  }

  #inboxView .wa-followup-panel.wa-inbox-panel{
    position:relative!important;
    height:100%!important;
  }

  #inboxView .wa-inbox-layout{
    position:absolute!important;
    inset:0!important;
    height:auto!important;
  }

  #inboxView .wa-conversation-column{
    display:grid!important;
    grid-template-rows:66px auto minmax(0,1fr)!important;
    height:100%!important;
  }

  #inboxView .wa-conversation-header,
  #inboxView .wa-conversation-tools{
    min-width:0!important;
    max-width:100%!important;
  }

  #inboxView .wa-conversation-list{
    grid-row:3!important;
    align-self:stretch!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    padding-bottom:calc(18px + env(safe-area-inset-bottom))!important;
    overflow-y:scroll!important;
    overflow-x:hidden!important;
    overscroll-behavior-y:contain!important;
    touch-action:pan-y!important;
    scrollbar-gutter:stable!important;
  }

  #inboxView .wa-conversation-list>.wa-conversation-item:last-of-type{
    margin-bottom:8px!important;
  }
}

@media (max-width:767.98px) and (display-mode:standalone){
  #inboxView.active{
    top:calc(68px + env(safe-area-inset-top))!important;
  }
}


/* WhatsApp CRM Mobile V5 — feature navigation belongs at the top.
   The global app already owns the bottom navigation, so WhatsApp's local
   navigation is presented as a compact horizontally-scrollable top rail. */
@media (max-width:767.98px){
  #inboxView .wa-main-panel{
    grid-template-rows:58px minmax(0,1fr)!important;
  }

  #inboxView .wa-page-tabs{
    order:1!important;
    position:relative!important;
    z-index:8!important;
    flex:0 0 58px!important;
    width:100%!important;
    height:58px!important;
    min-height:58px!important;
    padding:7px 10px!important;
    gap:6px!important;
    border-top:0!important;
    border-bottom:1px solid #e7edf3!important;
    background:#fff!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x proximity!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-x!important;
  }

  #inboxView .wa-followup-panel.wa-inbox-panel{
    order:2!important;
  }

  #inboxView .wa-page-tab{
    flex:0 0 auto!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:7px!important;
    width:auto!important;
    min-width:46px!important;
    height:44px!important;
    min-height:44px!important;
    padding:0 12px!important;
    border-radius:13px!important;
    scroll-snap-align:start!important;
    font-size:12px!important;
    font-weight:700!important;
    white-space:nowrap!important;
  }

  #inboxView .wa-page-tab i{
    flex:0 0 auto!important;
    font-size:18px!important;
  }

  #inboxView .wa-page-tab span{
    display:inline!important;
    font-size:12px!important;
    line-height:1!important;
  }

  #inboxView .wa-page-tab.active{
    background:#eaf6fb!important;
    color:#087aa5!important;
    box-shadow:inset 0 0 0 1px rgba(8,122,165,.08)!important;
  }

  /* Keep the most-used Inbox tab immediately readable; secondary tools can
     be reached by a natural horizontal swipe instead of competing with the
     global bottom nav. */
  #inboxView .wa-page-tab:not(.active){
    color:#526273!important;
    background:#f7f9fb!important;
  }
}


/* WhatsApp CRM Mobile V6 — secondary feature content reflow.
   Desktop panels are dense workspaces; on mobile every selected WhatsApp
   feature becomes a single-column, independently scrollable app screen. */
@media (max-width:767.98px){
  #inboxView .wa-followup-panel:not(.wa-inbox-panel){
    order:2!important;
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:contain!important;
    background:#f6f8fb!important;
  }

  #inboxView .wa-followup-panel:not(.wa-inbox-panel)>*{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    border-radius:0!important;
  }

  #inboxView .wa-contacts-shell,
  #inboxView .wa-analytics-shell,
  #inboxView .wa-quick-reply-library,
  #inboxView .wa-automation-shell,
  #inboxView .wa-campaign-shell,
  #inboxView .wa-connection-overview{
    padding:12px!important;
    overflow-x:hidden!important;
  }

  #inboxView .wa-contacts-commandbar,
  #inboxView .wa-analytics-heading,
  #inboxView .wa-official-template-heading,
  #inboxView .wa-campaign-heading,
  #inboxView .wa-quick-reply-library-head,
  #inboxView .wa-automation-heading{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:10px!important;
    width:100%!important;
    min-width:0!important;
    padding:14px!important;
  }

  #inboxView .wa-contacts-commandbar-right,
  #inboxView .wa-contacts-heading-actions,
  #inboxView .wa-official-template-actions,
  #inboxView .wa-campaign-heading-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
  }

  #inboxView .wa-contacts-commandbar-right button,
  #inboxView .wa-contacts-heading-actions button,
  #inboxView .wa-official-template-actions button,
  #inboxView .wa-official-template-actions select,
  #inboxView .wa-campaign-heading-actions button,
  #inboxView .wa-quick-reply-library-head>button{
    width:100%!important;
    min-height:46px!important;
  }

  #inboxView .wa-analytics-command-bar,
  #inboxView .wa-quick-reply-toolbar{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    width:100%!important;
    padding:12px!important;
  }

  #inboxView .wa-analytics-command-bar label,
  #inboxView .wa-analytics-command-bar select,
  #inboxView .wa-analytics-command-bar input,
  #inboxView .wa-quick-reply-toolbar label,
  #inboxView .wa-quick-reply-toolbar select{
    width:100%!important;
    min-width:0!important;
  }

  #inboxView .wa-analytics-command-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
    width:100%!important;
  }

  #inboxView .wa-analytics-command-actions button{min-height:44px!important}

  #inboxView .wa-quick-reply-summary,
  #inboxView .wa-campaign-metrics,
  #inboxView .wa-official-template-summary{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
  }

  #inboxView .wa-quick-reply-summary>*,
  #inboxView .wa-campaign-metrics>*,
  #inboxView .wa-official-template-summary>*{
    min-width:0!important;
  }

  #inboxView .wa-automation-layout{
    display:block!important;
    width:100%!important;
    min-width:0!important;
  }

  #inboxView .wa-automation-navigation{
    width:100%!important;
    max-width:100%!important;
    margin:0 0 10px!important;
    overflow:hidden!important;
  }

  #inboxView .wa-automation-nav{
    display:flex!important;
    width:100%!important;
    gap:6px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scrollbar-width:none!important;
    -webkit-overflow-scrolling:touch!important;
  }
  #inboxView .wa-automation-nav::-webkit-scrollbar{display:none}
  #inboxView .wa-automation-nav-item{
    flex:0 0 auto!important;
    min-width:148px!important;
    min-height:48px!important;
  }

  #inboxView .wa-automation-form,
  #inboxView .wa-automation-form input,
  #inboxView .wa-automation-form select,
  #inboxView .wa-automation-form textarea{
    max-width:100%!important;
    min-width:0!important;
  }

  #inboxView .wa-connection-overview{
    display:block!important;
  }

  #inboxView .wa-connection-overview>section{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0 0 10px!important;
  }

  #inboxView .wa-embedded-signup-card{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:12px!important;
  }

  #inboxView .wa-embedded-signup-action,
  #inboxView .wa-embedded-signup-action button{
    width:100%!important;
  }

  #inboxView .wa-followup-panel:not(.wa-inbox-panel) table{
    min-width:680px;
  }

  #inboxView .wa-followup-panel:not(.wa-inbox-panel) .table-responsive,
  #inboxView .wa-followup-panel:not(.wa-inbox-panel) [class*="table-wrap"],
  #inboxView .wa-followup-panel:not(.wa-inbox-panel) [class*="table-scroll"]{
    max-width:100%!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }

  #inboxView .wa-followup-panel:not(.wa-inbox-panel) h3{
    font-size:20px!important;
    line-height:1.25!important;
  }

  #inboxView .wa-followup-panel:not(.wa-inbox-panel) p{
    max-width:100%!important;
    line-height:1.5!important;
  }

  #inboxView .wa-followup-panel:not(.wa-inbox-panel) input,
  #inboxView .wa-followup-panel:not(.wa-inbox-panel) select,
  #inboxView .wa-followup-panel:not(.wa-inbox-panel) textarea{
    font-size:16px!important;
  }
}


/* Mobile Header V7 — compact, information-dense app bar.
   Reuse existing workspace/network/notification elements instead of leaving
   the center/right side of the mobile header visually empty. */
@media (max-width:767.98px){
  .topbar{
    display:grid!important;
    grid-template-columns:40px minmax(0,1fr) auto auto!important;
    align-items:center!important;
    column-gap:8px!important;
    width:100%!important;
    min-height:60px!important;
    height:60px!important;
    padding:7px 10px!important;
    overflow:visible!important;
  }

  .sidebar-open-button{
    width:40px!important;
    height:40px!important;
    min-width:40px!important;
    border-radius:12px!important;
  }

  .topbar-title-block{
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
    min-width:0!important;
    height:44px!important;
    overflow:hidden!important;
  }

  .topbar-title-block .eyebrow{
    display:block!important;
    margin:0 0 2px!important;
    font-size:9px!important;
    line-height:1!important;
    font-weight:750!important;
    letter-spacing:.08em!important;
    color:#7a8998!important;
  }

  .topbar-title-block h1{
    max-width:100%!important;
    font-size:17px!important;
    line-height:1.15!important;
    font-weight:800!important;
  }

  .topbar-workspace-identity{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    padding:0!important;
    border:1px solid #e6ebf0!important;
    border-radius:12px!important;
    background:#f8fafc!important;
    overflow:hidden!important;
  }

  .topbar-workspace-identity>span:not(.topbar-workspace-logo){
    display:none!important;
  }

  .topbar-workspace-logo{
    display:grid!important;
    place-items:center!important;
    width:30px!important;
    height:30px!important;
    min-width:30px!important;
    margin:0!important;
    border-radius:9px!important;
    overflow:hidden!important;
  }

  .topbar-workspace-logo img{
    width:100%!important;
    height:100%!important;
    object-fit:contain!important;
  }

  .topbar-network-status{
    position:absolute!important;
    top:50%!important;
    right:52px!important;
    transform:translateY(-50%)!important;
    display:grid!important;
    place-items:center!important;
    width:16px!important;
    height:16px!important;
    min-width:16px!important;
    padding:0!important;
    margin:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
    pointer-events:auto!important;
  }

  .topbar-network-status .network-status-copy{
    display:none!important;
  }

  .topbar-network-status .network-status-dot{
    width:8px!important;
    height:8px!important;
    margin:0!important;
    box-shadow:0 0 0 3px #fff!important;
  }

  .topbar-notification{
    position:relative!important;
    min-width:40px!important;
  }

  .notification-button{
    width:40px!important;
    height:40px!important;
    min-width:40px!important;
    border-radius:12px!important;
  }

  .notification-button i{font-size:19px!important}

  .notification-menu{
    position:fixed!important;
    top:64px!important;
    left:10px!important;
    right:10px!important;
    width:auto!important;
    max-width:none!important;
    max-height:calc(100dvh - 150px)!important;
    overflow-y:auto!important;
  }
}

@media (max-width:359.98px){
  .topbar{grid-template-columns:38px minmax(0,1fr) 36px 38px!important;column-gap:5px!important;padding-left:8px!important;padding-right:8px!important}
  .topbar-title-block h1{font-size:16px!important}
  .topbar-workspace-identity{width:36px!important;height:36px!important;min-width:36px!important}
}


/* Mobile Header V7.1 — safe-area hotfix.
   V7 forced a fixed 60px header after the older standalone safe-area rule,
   which could place the app bar under the Android/iOS status area. */
@media (max-width:767.98px){
  .topbar{
    box-sizing:border-box!important;
    top:0!important;
    min-height:calc(60px + env(safe-area-inset-top))!important;
    height:calc(60px + env(safe-area-inset-top))!important;
    padding-top:calc(7px + env(safe-area-inset-top))!important;
    padding-bottom:7px!important;
  }

  .notification-menu{
    top:calc(64px + env(safe-area-inset-top))!important;
  }
}

@media (max-width:767.98px) and (display-mode:standalone){
  .topbar{
    min-height:calc(60px + env(safe-area-inset-top))!important;
    height:calc(60px + env(safe-area-inset-top))!important;
    padding-top:calc(7px + env(safe-area-inset-top))!important;
  }

  body.griya-standalone .main{
    min-height:calc(100dvh - 60px - env(safe-area-inset-top))!important;
  }

  body.griya-standalone .notification-menu{
    top:calc(64px + env(safe-area-inset-top))!important;
  }

  #inboxView.active{
    top:calc(60px + env(safe-area-inset-top))!important;
  }
}
