/* Android layout only. Existing desktop tables and supplier workflows are untouched. */
.dpma-mobile-bar,.dpma-mobile-backdrop,.dpma-mobile-close,.dpma-mobile-chat-back{display:none}
.dpma-install-dialog{box-sizing:border-box;width:min(440px,calc(100vw - 24px));max-height:85dvh;overflow:auto;border:1px solid var(--line);border-radius:16px;padding:24px;background:var(--white);color:var(--ink)}
.dpma-install-dialog::backdrop{background:rgba(0,0,0,.6)}
.dpma-install-dialog h2{margin-top:0}.dpma-install-dialog p,.dpma-install-dialog li{line-height:1.6}.dpma-install-dialog button{min-height:44px}
@media(max-width:700px){
  html,body{min-width:0!important;width:100%;max-width:100%;overflow-x:hidden}
  body{display:block!important;margin:0}
  .dpma-mobile-bar{box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:8px;position:sticky;top:0;z-index:900;width:100%;padding:8px 12px;padding-top:max(8px,env(safe-area-inset-top));background:#153a39;color:#fff;border-bottom:1px solid #41645c}
  .dpma-mobile-bar strong{font-size:17px;white-space:nowrap}.dpma-mobile-bar small{font-size:11px;color:#d4e9e3}
  .dpma-mobile-bar>div{display:grid;gap:2px;flex:1}.dpma-mobile-bar button{min-width:44px;min-height:44px;border:1px solid #587c70;border-radius:9px;background:#21483e;color:#fff;font:600 14px 'Segoe UI',sans-serif;cursor:pointer;padding:8px 12px}
  body.auth-loading .dpma-mobile-bar,body.auth-required .dpma-mobile-bar{display:none}
  body>aside{box-sizing:border-box;position:fixed;inset:0 auto 0 0;z-index:1100;width:min(310px,88vw);max-width:88vw;height:100dvh;padding:14px 16px max(18px,env(safe-area-inset-bottom));transform:translateX(-105%);visibility:hidden;overflow-y:auto;transition:transform .18s ease,visibility .18s}
  body.dpma-mobile-menu-open>aside{transform:translateX(0);visibility:visible}
  body.dpma-mobile-menu-open{overflow:hidden}
  .dpma-mobile-close{display:block;margin-left:auto;min-width:44px;min-height:44px;background:#21483e;color:#fff;border:1px solid #587c70;border-radius:8px;font-size:23px}
  .dpma-mobile-backdrop{position:fixed;inset:0;z-index:1050;width:100%;height:100dvh;border:0;border-radius:0;background:rgba(0,0,0,.6)}
  body.dpma-mobile-menu-open .dpma-mobile-backdrop{display:block}
  body>aside .brand{margin-bottom:10px;padding-bottom:10px}body>aside .brand img{height:90px}body>aside .brand-copy{display:block;font-size:10px}
  body>aside nav button,body>aside .nav-group-label,body>aside nav button.nav-emphasis,body>aside .nav-group-label.nav-emphasis,body>aside .simec-nav-toggle,body>aside .perfilor-nav-toggle{justify-content:flex-start!important;font-size:16px!important;min-height:44px;padding:11px 12px!important;width:100%;margin-left:0}
  body>aside .simec-nav-children button,body>aside .perfilor-nav-children button,body>aside .jal-nav-children button{font-size:14px!important;padding-left:28px!important}
  body>aside .simec-nav-toggle i,body>aside .perfilor-nav-toggle i{display:block}
  body>aside .user{flex-wrap:wrap;padding:16px 6px}body>aside .user div{display:block;min-width:0}body>aside .user button{min-height:44px}
  body>main{margin-left:0!important;width:100%!important;min-width:0!important;max-width:100%;padding:14px 12px 32px;padding-bottom:max(32px,env(safe-area-inset-bottom))}
  main>header{padding:16px;margin-bottom:16px;gap:10px;flex-wrap:wrap}main>header h1{font-size:23px;overflow-wrap:anywhere}main>header p{font-size:13px;line-height:1.5}
  main .page,main .grid,main .grid>*,main article,main .metrics,main .metric{min-width:0;max-width:100%;box-sizing:border-box}
  main .grid{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
  main .metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metric{padding:14px!important}.metric b{font-size:25px}.metric span{font-size:12px;overflow-wrap:anywhere}
  main .contact-reminders:not([hidden]){grid-template-columns:minmax(0,1fr);gap:10px;padding:12px;margin:0 0 16px}.contact-reminders ul{display:grid;grid-template-columns:minmax(0,1fr);max-height:160px}.contact-reminders li{min-width:0;overflow-wrap:anywhere}.contact-reminders button{width:100%}
  main button,main .upload,main select{min-height:44px;touch-action:manipulation}main input:not([type=checkbox]):not([type=radio]),main select,main textarea,dialog input,dialog select,dialog textarea{font-size:16px!important;box-sizing:border-box}
  main .toolbar,main .order-filters,main .client-list-filters,main .perfilor-billing-toolbar,main .billing-month-toolbar,main .simec-order-toolbar{display:flex;flex-direction:column;align-items:stretch;gap:10px;min-width:0;width:100%}
  main .toolbar>input,main .order-filters>input,main .order-filters label,main .client-toolbar>input,main .perfilor-billing-toolbar label,main .billing-month-toolbar label,main .client-list-filters label{min-width:0!important;max-width:100%;width:100%;flex-basis:auto}
  main .toolbar input,main .toolbar select,main .order-filters input,main .order-filters select,main .perfilor-billing-toolbar input,main .perfilor-billing-toolbar select{width:100%;min-width:0!important;box-sizing:border-box}
  main .table-wrap{display:block;box-sizing:border-box;min-width:0!important;max-width:100%;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  main .table-wrap table th:nth-child(n),main .table-wrap table td:nth-child(n){position:static!important;left:auto!important;box-shadow:none!important}
  main .person{min-width:0;flex-wrap:wrap}main .person>div{min-width:0;overflow-wrap:anywhere}main .article-head{gap:10px;flex-wrap:wrap}
  dialog{box-sizing:border-box;max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 20px);overflow:auto;margin:auto;padding:16px}
  dialog form,dialog #fields{min-width:0;max-width:100%}dialog .form-grid,dialog .simec-quote-grid{grid-template-columns:minmax(0,1fr)!important}dialog .actions{display:flex;flex-wrap:wrap;gap:8px}
  .login-screen{box-sizing:border-box;padding:16px}.login-card{box-sizing:border-box;width:100%;padding:22px;gap:14px}.login-card img{height:150px}.login-card input{font-size:16px}
  #inbox.page{overflow:visible;padding:0}#inbox .inbox{display:block!important;box-sizing:border-box;min-width:0!important;width:100%!important;max-width:100%!important;height:auto!important;min-height:65dvh;resize:none;overflow:hidden;scrollbar-gutter:auto}
  #inbox .conversation-sidebar{min-width:0;max-width:100%;max-height:none;overflow:auto;max-height:75dvh;border-right:0;scrollbar-gutter:auto}
  #inbox .conversation-sidebar .conversation-item{grid-template-columns:36px minmax(0,1fr) auto;padding:13px 10px;gap:8px;box-sizing:border-box}
  #inbox .chat{display:none;min-width:0!important;width:100%;min-height:0;overflow:visible;scrollbar-gutter:auto}
  #inbox[data-mobile-chat=true] .conversation-sidebar{display:none}#inbox[data-mobile-chat=true] .chat{display:block}
  #inbox .conversation-resize-handle,#inbox #conversationResizeHandle,#inbox .message-resize-handle{display:none!important}
  #inbox #chatContent:not([hidden]){display:flex;flex-direction:column;min-width:0!important;width:100%;height:auto;min-height:65dvh}
  #inbox .chat-head{position:static;min-width:0!important;max-width:100%;padding:12px;flex-wrap:wrap;align-items:flex-start;gap:10px}
  #inbox .chat-head>div{min-width:0;max-width:100%}#inbox #chatName{font-size:17px;overflow-wrap:anywhere}#inbox #chatChannel,#inbox #chatHistoryInfo{overflow-wrap:anywhere;white-space:normal}
  .dpma-mobile-chat-back{display:block;align-self:flex-start;margin:8px 10px;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:var(--white);color:var(--ink);font-size:14px;min-height:44px}
  #inbox .chat-messages{min-width:0!important;max-width:100%;max-height:55dvh;min-height:180px;overflow:auto;scrollbar-gutter:auto;padding:12px 10px}
  #inbox .bubble{max-width:100%;overflow-wrap:anywhere}#inbox .chat-media{max-width:100%}#inbox .reply-box{position:static;min-width:0!important;width:100%;box-sizing:border-box;height:auto;overflow:visible;padding:10px;display:block}
  #inbox .reply-composer{display:flex;flex-wrap:wrap;min-width:0;width:100%;height:auto;gap:8px}#inbox .reply-tools{flex:1 1 100%;flex-wrap:wrap;max-width:100%;gap:8px}#inbox .reply-paste-hint{display:none}
  #inbox #replyBody{flex:1 1 100%;width:100%;min-width:0;min-height:94px;max-height:220px}#inbox #replySendButton{position:static;flex:1 1 100%;width:100%;min-height:46px}#inbox .emoji-picker{max-width:100%;box-sizing:border-box}
  #toast{left:12px!important;right:12px!important;max-width:calc(100vw - 24px);bottom:16px;box-sizing:border-box}
}
@media(prefers-reduced-motion:reduce){body>aside{transition:none}}

/* v202: keep the existing records and controls; change only their mobile layout. */
.dpma-mobile-tabs,.dpma-mobile-reminders-toggle,.dpma-mobile-chat-options,.dpma-mobile-details,.dpma-mobile-client-name,.dpma-mobile-filter-toggle{display:none}
@media(max-width:700px){
  [hidden]{display:none!important}
  body{padding-bottom:70px}
  body>main{padding:10px 10px 88px!important}
  .dpma-mobile-bar{min-height:60px;padding:7px 10px;gap:6px}
  .dpma-mobile-bar>div{min-width:0}.dpma-mobile-bar strong{overflow:hidden;text-overflow:ellipsis;font-size:16px}
  .dpma-mobile-bar small{font-size:10px}.dpma-mobile-bar button{padding:7px 10px}
  .dpma-mobile-tabs{position:fixed;bottom:0;left:0;right:0;z-index:950;display:flex;gap:4px;padding:5px 6px max(5px,env(safe-area-inset-bottom));background:#153a39;border-top:1px solid #41645c;box-sizing:border-box}
  .dpma-mobile-tabs button{display:flex;flex:1;min-width:0;min-height:54px;align-items:center;justify-content:center;flex-direction:column;gap:3px;margin:0!important;padding:5px 2px!important;background:transparent;color:#d9eee7;border:0;border-radius:9px;font:600 12px 'Segoe UI',sans-serif;touch-action:manipulation}
  .dpma-mobile-tabs button span{font-size:12px!important;line-height:16px;font-weight:600}
  .dpma-mobile-tabs i{font-size:20px}.dpma-mobile-tabs button[aria-current=page]{color:#fff;background:#28654f}
  body.auth-loading .dpma-mobile-tabs,body.auth-required .dpma-mobile-tabs{display:none}
  main>header{padding:12px;margin-bottom:10px}main>header h1{font-size:21px;margin:0 0 4px}main>header p{margin:0}
  main>header{display:none}
  #clients .client-list-heading p{display:none}#clients .client-list-heading h2{font-size:19px;margin:0 0 8px}
  #clients .client-importance-tabs{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;max-width:100%}
  #clients .client-importance-tabs button{flex:0 0 auto;font-size:13px;white-space:nowrap}
  #clients .client-toolbar:not(.dpma-mobile-filters-open)>[data-mobile-filter-extra=true]{display:none!important}
  .dpma-mobile-filter-toggle{display:block;background:transparent;color:var(--ink);border:1px solid var(--line);border-radius:9px;font-size:14px;padding:8px}
  main .contact-reminders:not(.dpma-mobile-reminders-expanded){display:none!important}
  .dpma-mobile-reminders-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;margin:0 0 12px;padding:10px 12px;border:1px solid #746238;border-radius:10px;background:#332d1d;color:#ffe2a0;font-size:14px;text-align:left;min-height:44px}
  .dpma-mobile-reminders-toggle::after{content:'+';font-size:20px}.dpma-mobile-reminders-toggle[aria-expanded=true]::after{content:'−'}
  main .contact-reminders>div,main .contact-reminders small,main .contact-reminders li{min-width:0;white-space:normal;overflow-wrap:anywhere}
  main .metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px}.metric{padding:10px!important}.metric b{font-size:23px!important}.metric span{font-size:12px}
  main .task{flex-wrap:wrap;gap:10px;padding:12px!important}main .task>div{min-width:0;flex:1 1 190px}main .task b,main .task small{white-space:normal;overflow-wrap:anywhere}
  main input[type=checkbox]{width:22px;height:22px;flex-shrink:0}
  main .toolbar,main .client-list-heading,.simec-document-import-head,.simec-quote-head,.simec-quote-submit,.simec-quote-saved-head{flex-wrap:wrap;min-width:0;gap:10px}
  main .toolbar>*,main .simec-quote-submit>*{max-width:100%;box-sizing:border-box}
  main .client-importance-tabs{display:flex;flex-wrap:wrap;gap:6px}
  main .simec-quote-submit button{width:100%;justify-content:center}
  main .simec-document-import,main .simec-quote-form,main .simec-quote-saved{padding:10px!important}
  main fieldset{min-inline-size:0;padding:10px!important}main fieldset label{min-width:0}
  main .table-wrap,main .table-scroll{max-width:100%;overflow-x:auto;scrollbar-gutter:auto}
  main table.dpma-mobile-cards{display:block;width:100%!important;min-width:0!important;max-width:100%;table-layout:auto}
  main table.dpma-mobile-cards thead,main table.dpma-mobile-cards tbody{display:block;width:100%}
  main table.dpma-mobile-cards thead tr{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}
  main table.dpma-mobile-cards thead th{display:none}
  main table.dpma-mobile-cards thead th.dpma-mobile-table-control{display:flex;align-items:center;min-width:0!important;max-width:100%;padding:8px!important;border:1px solid var(--line);border-radius:8px}
  main table.dpma-mobile-cards tbody tr{display:block;width:100%;box-sizing:border-box;border:1px solid var(--line);border-radius:12px;margin:0 0 12px;overflow:hidden;background:var(--white)}
  main table.dpma-mobile-cards tbody tr td:nth-child(n){display:block;position:static!important;left:auto!important;box-sizing:border-box;width:100%!important;min-width:0!important;max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere;padding:9px 12px!important;border:0;border-bottom:1px solid var(--line)}
  main table.dpma-mobile-cards tbody td[data-mobile-label]::before{content:attr(data-mobile-label);display:block;margin-bottom:5px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
  main table.dpma-mobile-cards tbody td input:not([type=checkbox]),main table.dpma-mobile-cards tbody td select,main table.dpma-mobile-cards tbody td textarea{width:100%!important;min-width:0!important;max-width:100%!important}
  main table.dpma-mobile-cards tbody td button{max-width:100%;margin:3px 3px 3px 0;white-space:normal}
  main table.dpma-mobile-cards .client-actions,main table.dpma-mobile-cards .proposal-actions{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
  main #clientRows tr:not([data-mobile-expanded=true]) td[data-mobile-secondary=true]{display:none!important}
  .dpma-mobile-details{display:inline-block;font-size:13px;color:var(--ink);background:transparent;border:1px solid var(--line);border-radius:8px;padding:8px}
  #clientRows .inline-client-name:disabled{display:none!important}
  #clientRows .inline-client-name:disabled+.dpma-mobile-client-name{display:block;font-size:16px;line-height:1.5;overflow-wrap:anywhere}
  #clientRows tr:not([data-mobile-expanded=true]) .inline-phones{height:62px;min-height:62px}
  #bottomTableScrollbar{display:none!important}
  body.dpma-mobile-inbox{height:var(--dpma-mobile-height,100dvh);padding-bottom:0;overflow:hidden}
  body.dpma-mobile-inbox>main{height:calc(var(--dpma-mobile-height,100dvh) - var(--dpma-mobile-navigation-height,126px));min-height:0;padding:0 8px!important;overflow:hidden}
  body.dpma-mobile-inbox main>header,body.dpma-mobile-inbox #contactReminders,body.dpma-mobile-inbox .dpma-mobile-reminders-toggle{display:none!important}
  body.dpma-mobile-inbox #inbox,body.dpma-mobile-inbox #inbox .inbox{height:100%!important;min-height:0!important;max-height:100%;margin:0;padding:0}
  body.dpma-mobile-inbox #inbox .conversation-sidebar{height:100%;max-height:100%;min-height:0;overscroll-behavior:contain}
  #inbox .conversation-search{flex-wrap:wrap;gap:8px;padding:10px}
  #inbox .conversation-search input{flex:1 1 calc(100% - 44px);width:auto}
  #inbox .conversation-search .conversation-new-contact{flex:1 1 100%;margin:0;min-height:38px;font-size:13px}
  #inbox .conversation-search button:not(.conversation-new-contact){margin-left:0}
  #inbox .conversation-item p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  #inbox .chat{height:100%;max-height:100%}
  #inbox #chatContent:not([hidden]){height:100%;max-height:100%;min-height:0;display:flex;flex-direction:column;overflow:hidden}
  .dpma-mobile-chat-back{flex:0 0 auto;min-height:38px;margin:5px 8px;padding:5px 10px}
  #inbox .chat-head{flex:0 0 auto;padding:7px 10px;gap:6px}
  #inbox .chat-head>div:first-child{width:100%}
  #inbox #chatName{font-size:15px;margin:0 0 3px;line-height:1.3}
  #inbox #chatChannel{font-size:12px}#inbox #chatHistoryInfo{display:none}
  .dpma-mobile-chat-options{display:block;min-height:30px!important;padding:5px 8px;font-size:12px;background:transparent;color:var(--ink);border:1px solid var(--line);border-radius:7px}
  #inbox .dpma-mobile-chat-actions:not(.dpma-mobile-actions-expanded){display:none!important}
  #inbox .dpma-mobile-chat-actions.dpma-mobile-actions-expanded{display:flex;flex-wrap:wrap;gap:6px}
  #inbox .chat-messages{flex:1 1 auto;min-height:40px;max-height:none;overflow:auto;overscroll-behavior:contain;padding:10px}
  #inbox .reply-box{flex:0 0 auto;padding:6px;max-height:45%;overflow:auto}
  #inbox .reply-composer{display:grid;grid-template-columns:minmax(0,1fr) 76px;grid-template-areas:'tools tools' 'body send';gap:6px}
  #inbox .reply-tools{grid-area:tools;min-height:0;gap:5px}#inbox .reply-tools button,#inbox .reply-tools .upload{min-height:34px;padding:5px 8px}
  #inbox #replyBody{grid-area:body;min-height:48px;max-height:110px;height:48px;resize:none}
  #inbox #replySendButton{grid-area:send;min-height:48px;align-self:end;padding:8px}
  #inbox .emoji-picker{grid-column:1/-1;max-height:160px;overflow:auto}
  #toast{bottom:78px!important}
}
