/* Shared small-screen layout. Keep desktop grids and every application action. */
.mobile-public-menu,.mobile-table-sort{display:none}
.mobile-cell-value{min-width:0}
@media(max-width:900px){
  .table-wrap:has(>.mobile-records){overflow:visible;border:0;background:transparent;border-radius:0}
  table.mobile-records{display:block;width:100%;min-width:0!important;border-spacing:0}
  .mobile-records thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .mobile-records tbody{display:grid;gap:14px;width:100%}
  .mobile-records tbody tr{display:block;background:#fff!important;border:1px solid var(--line,#dce7e2);border-radius:14px;padding:8px 14px;box-shadow:0 3px 12px #12503c05}
  .mobile-records tbody td{display:grid;grid-template-columns:90px minmax(0,1fr);align-items:start;gap:12px;padding:11px 0!important;border:0!important;border-bottom:1px solid #edf2ef!important;font-size:17px!important;line-height:1.6;white-space:normal!important;direction:rtl;text-align:start;overflow-wrap:anywhere;min-width:0}
  .mobile-records tbody td::before{content:attr(data-label);font-size:15px;color:#698176;font-weight:600;line-height:1.65}
  .mobile-records tbody td:last-child{border-bottom:0!important}
  .mobile-records .mobile-cell-value{max-width:100%;overflow-wrap:anywhere;white-space:normal;line-height:1.6}
  .mobile-cell-value .btn{white-space:normal;min-height:42px;margin:3px 0;font-size:16px}
  .mobile-cell-value .row-actions{display:flex;flex-wrap:wrap;gap:6px}
  .mobile-cell-value input,.mobile-cell-value select{max-width:100%;min-width:0;width:100%}
  .mobile-records td.mobile-record-empty{display:block;text-align:center}
  .mobile-records td.mobile-record-empty::before{display:none}
  .mobile-table-sort{display:flex;flex-wrap:wrap;gap:8px;padding:0 0 12px}
  .mobile-table-sort button{font-size:16px;min-height:40px;padding:6px 12px;border:1px solid var(--line,#dce7e2);border-radius:9px;background:#fff;color:var(--ink,#16372c)}
}
@media(max-width:700px){
  body{min-width:320px}
  .owner-main,.content,.public-main,.customer-main,.customer-panel,.customer-auth,.surface,.ref-panel,.modal-body,.page-heading>div,.section-heading>*,.ref-panel-head>*,.topbar-start,.header-actions{min-width:0}
  .page-heading,.ref-topline{margin-bottom:18px!important}
  .page-heading{align-items:flex-start;flex-direction:column;gap:14px}
  .page-heading h1,.shell .content .page-heading h1,.reference-owner .owner-main>.page-heading h1,.ref-topline h1{font-size:28px;line-height:1.4;overflow-wrap:anywhere}
  .page-heading p,.ref-topline p{font-size:17px;line-height:1.6}
  .page-heading>.btn,.page-heading>.actions{width:100%}
  .btn{white-space:normal;line-height:1.4;min-height:44px}
  .icon-btn{width:44px;height:44px;flex:none}
  .section-heading,.ref-panel-head{flex-wrap:wrap;align-items:flex-start;gap:8px 12px}
  .section-heading h2,.ref-panel-head h2{font-size:22px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
  .section-heading h2 svg,.ref-panel-head h2 svg{flex:none}
  .section-heading>span,.ref-panel-head>a{font-size:15px;line-height:1.5}
  .section-heading>span{width:100%}
  .toolbar,.owner-filters,.advanced-filters{display:grid;grid-template-columns:minmax(0,1fr);width:100%;gap:10px}
  .toolbar>*,.owner-filters>*,.advanced-filters>*{min-width:0;max-width:100%;width:100%}
  input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:17px!important;max-width:100%;min-width:0}
  .actions,.row-actions,.account-controls .actions{flex-wrap:wrap;gap:8px}
  .actions>.btn{flex:1;min-width:110px}
  .field{line-height:1.6}
  .detail-grid,.form-grid,.staff-profile-grid .detail-grid{grid-template-columns:minmax(0,1fr)!important;gap:12px}
  .detail-grid>div,.detail-grid strong,.staff-profile-hero p,.customer-order p,.message-bubble,.conversation-row{overflow-wrap:anywhere;min-width:0}
  .reference-owner .owner-header{padding:8px 12px;gap:8px;min-height:72px;height:auto}
  .reference-owner .owner-header>.brand{font-size:23px;min-width:0;flex:1}
  .reference-owner .owner-header>.brand small{font-size:12px;line-height:1.3}
  .reference-owner .header-actions{margin:0;gap:8px}
  .reference-owner .owner-bell{width:40px;height:44px;flex:none}
  .reference-owner .owner-bell i{display:none}
  .reference-owner .owner-bell .nav-count{position:absolute;top:0;inset-inline-end:-2px;display:grid;place-items:center;min-width:20px;height:20px;border:2px solid #fff;border-radius:20px;background:#df4259;color:#fff;font:700 12px Arial,sans-serif;padding:0 3px;margin:0;line-height:1}
  .reference-owner .owner-profile-avatar{width:32px;height:32px;font-size:16px}
  .reference-owner .owner-main,.shell .content{padding:20px 14px 32px}
  .reference-owner .owner-sidebar,.shell .sidebar{max-width:calc(100vw - 52px);height:calc(100dvh - 72px);overscroll-behavior:contain}
  .ref-toolbar{gap:12px;margin:16px 0 20px}
  .ref-company-tabs{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
  .ref-company-tab{height:auto;min-height:44px;padding:10px 12px;font-size:17px;line-height:1.4}
  .ref-company-tab span{white-space:normal;overflow-wrap:anywhere}
  .ref-company-tab svg{flex:none}
  .ref-period{min-width:0;width:100%;min-height:44px;font-size:17px;height:auto}
  .ref-period select{width:auto!important}
  .ref-metrics,.shell .metrics,.owner-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .ref-metric,.shell .metric,.owner-summary .metric{position:relative;padding:16px!important;min-height:152px;display:flex;flex-direction:column;gap:12px}
  .ref-metric>i{position:absolute;top:14px;inset-inline-end:14px;width:28px;height:28px;border-radius:9px}
  .ref-metric>i svg{width:17px;height:17px}
  .ref-metric-copy{width:100%}
  .ref-metric-copy>span{display:block;padding-inline-end:30px;font-size:17px;min-height:48px;line-height:1.4}
  .ref-metric-copy strong,.shell .metric strong,.owner-summary .metric strong{font-size:30px;white-space:normal;overflow-wrap:anywhere;line-height:1.3;margin:4px 0}
  .ref-metric-copy small,.shell .metric small{font-size:14px;line-height:1.5}
  .shell .metric-top,.owner-summary .metric-top{font-size:16px;line-height:1.5;min-height:48px;align-items:flex-start;gap:8px}
  .shell .metric-top i,.owner-summary .metric-top i{font-size:16px;padding:2px 6px;flex:none}
  .ref-alert-title b{white-space:normal;font-size:17px;line-height:1.5}
  .ref-alert-title small{font-size:14px;line-height:1.5}
  .ref-alert{padding:12px}
  .ref-activity-row{display:grid;grid-template-columns:34px minmax(0,1fr) 28px;gap:10px;padding:12px 0}
  .ref-activity-row strong,.ref-activity-row small{white-space:normal;overflow:visible;text-overflow:clip;line-height:1.5}
  .ref-activity-row strong{font-size:17px}.ref-activity-row small{font-size:14px}
  .ref-activity-row time{display:block;grid-column:2/-1;white-space:normal;font-size:13px;direction:rtl;line-height:1.5}
  .shell .topbar{padding:10px 12px;gap:10px;height:auto;min-height:72px}
  .shell .topbar-start{flex:1;gap:8px}
  .shell .location-label{display:block;min-width:0;font-size:16px;line-height:1.4;overflow-wrap:anywhere}
  .shell .topbar-actions{flex:none;gap:0}
  .shell .user-dot{width:32px;height:32px}
  .employee-dashboard-grid{grid-template-columns:minmax(0,1fr)}
  .shell .pipeline{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;overflow:visible;padding:0}
  .shell .pipeline-column{min-width:0;width:100%;padding:14px;border-radius:12px}
  .shell .pipeline-head{font-size:19px;gap:12px;margin-bottom:12px}
  .shell .pipeline-card{padding:14px;margin-top:10px;line-height:1.5}
  .shell .pipeline-card b{display:block;font-size:18px;overflow-wrap:anywhere}
  .shell .pipeline-card small{font-size:15px;white-space:normal;overflow-wrap:anywhere}
  .staff-request-card,.conversation-row,.customer-order{flex-direction:column;align-items:stretch;padding:16px;line-height:1.6}
  .staff-request-card .actions{width:100%}
  .staff-profile-hero{align-items:flex-start;padding:18px;gap:12px}
  .staff-profile-hero>div{min-width:0;max-width:100%}
  .customer-auth,.customer-panel{padding:18px;max-width:100%}
  .customer-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .customer-metrics>div{min-width:0}
  .customer-metrics strong{font-size:28px}
  .customer-phone-control{width:100%}
  .customer-notification>div{align-items:flex-start;line-height:1.6}
  .shade{padding:10px;padding-top:max(10px,env(safe-area-inset-top));padding-bottom:max(10px,env(safe-area-inset-bottom))}
  .modal{width:100%!important;max-width:100%!important;max-height:calc(100dvh - 20px);border-radius:16px;overflow:auto;overscroll-behavior:contain}
  .modal-head{gap:12px;align-items:flex-start;padding:14px 16px;background:#fff;z-index:2}
  .modal-head h2{flex:1;min-width:0;margin:0;font-size:23px;line-height:1.5;overflow-wrap:anywhere}
  .modal-head .icon-btn{flex:none;width:44px;height:44px}
  .modal-body{padding:18px 16px;overflow-wrap:anywhere}
  .modal-body .actions{position:static}
  .modal-body img{max-width:100%;object-fit:contain}
  #toast{max-width:calc(100vw - 24px);white-space:normal;overflow-wrap:anywhere;line-height:1.6}
  .isolated-demo-notice,.demo-banner{font-size:14px;line-height:1.5;padding:10px 12px;margin-bottom:16px}
  /* Customer catalogue: compact navigation and a single, legible search column. */
  .public-page .public-header{border-radius:0}
  .public-page .public-nav{padding:12px 14px;gap:10px}
  .public-page .public-nav .brand{font-size:20px;line-height:1.4;min-width:0;max-width:100%}
  .public-page .public-nav .brand>span{min-width:0;overflow-wrap:anywhere}
  .public-page .public-nav .brand small{font-size:13px}
  .public-page .public-nav-actions{display:flex;gap:8px;flex-wrap:wrap}
  .public-page .public-nav-actions .btn{min-height:42px;font-size:16px;padding:8px 12px;flex:1}
  .hamad-public .hamad-nav{padding:0 14px;background:#fff}
  .mobile-public-menu{display:flex;width:100%;justify-content:space-between;align-items:center;border:0;background:transparent;color:var(--portal-deep);padding:10px 0;min-height:46px;font-size:17px;font-weight:700}
  .hamad-public .hamad-nav>div{display:none;padding:0 0 12px;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .hamad-public .hamad-nav.is-open>div{display:grid}
  .hamad-public .hamad-nav a{background:#faf7f7;border-radius:8px;min-height:44px;font-size:16px;padding:10px;line-height:1.4}
  .public-page .public-main{padding:22px 14px 36px}
  .catalog-intro{position:relative;display:block;padding:0;margin-bottom:18px}
  .catalog-intro>div:first-child{width:100%;padding:0}
  .catalog-intro h1{font-size:29px!important;padding-inline-end:90px;line-height:1.4;margin:6px 0 10px}
  .catalog-intro p{font-size:18px;line-height:1.6}
  .catalog-total{position:absolute;top:28px;inset-inline-end:0;min-width:0;padding:0 10px;border:0;background:#faf7f7;border-radius:10px;margin:0;text-align:center}
  .catalog-total strong{font-size:23px;display:inline;margin-inline-end:4px;line-height:1.6}
  .catalog-total span{font-size:13px;display:inline;margin:0}
  .catalog-tools{padding:12px;border-radius:14px}
  .catalog-search-row{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
  .catalog-search{width:100%;gap:7px;padding-inline:8px;flex-basis:auto}
  .catalog-search input{padding:10px 0;font-size:16px!important}
  .catalog-search>svg{width:18px;height:18px}
  .catalog-search .icon-btn{width:32px;height:40px}
  .public-page .catalog-reset{justify-self:start;min-height:40px;padding:6px 10px;font-size:15px}
  .catalog-tools:has(#catalog-active-filters:empty) .catalog-reset{display:none}
  .catalog-filter-panel{margin-top:10px;padding-top:10px}
  .catalog-filter-panel>summary{font-size:17px;min-height:40px}
  .catalog-filter-grid{grid-template-columns:minmax(0,1fr);gap:14px}
  .catalog-filter-grid label:last-child{grid-column:auto}
  .catalog-results-head{flex-direction:row;flex-wrap:wrap;align-items:center;gap:10px;margin:18px 0}
  .catalog-results-head p{width:100%;font-size:16px;line-height:1.5}
  .catalog-results-head label{width:100%;justify-content:space-between;font-size:16px}
  .catalog-results-head select{flex:1;width:auto;max-width:200px;min-height:44px}
  .public-page .candidate-grid{gap:18px}
  .catalog-card .candidate-info{padding:18px}
  .catalog-card-heading>div{min-width:0}
  .public-page .catalog-card h3{font-size:24px;overflow-wrap:anywhere}
  .catalog-facts{gap:14px;padding:14px}
  .catalog-facts dd{font-size:18px;line-height:1.5}
  .catalog-card .card-actions{flex-wrap:wrap;align-items:center}
  .catalog-comparison-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:12px;inset-inline:12px;bottom:max(12px,env(safe-area-inset-bottom))}
  .catalog-comparison-bar>div{grid-column:1}
  .catalog-comparison-bar>.icon-btn{grid-column:2;grid-row:1;width:40px;height:40px}
  .catalog-comparison-bar>.btn{grid-column:1/-1;grid-row:2;width:100%;min-height:44px}
  .public-page:has(.catalog-comparison-bar){padding-bottom:160px}
  .catalog-detail-actions .btn{min-width:120px;white-space:normal}
}
@media(max-width:360px){
  .ref-metrics,.shell .metrics,.owner-summary{grid-template-columns:minmax(0,1fr)}
  .ref-metric,.shell .metric,.owner-summary .metric{min-height:0}
  .ref-metric-copy>span,.shell .metric-top{min-height:0}
  .ref-metric-copy strong,.shell .metric strong{font-size:29px}
  .mobile-records tbody td{grid-template-columns:minmax(0,1fr);gap:4px}
  .reference-owner .owner-profile{display:none}
  .catalog-intro h1{font-size:26px!important;padding-inline-end:82px}
}
