/* Screen-only adaptations: preserve financial workflows and printed documents. */
#enterprise-gateway .gateway-wrap { max-width:1280px;padding-inline:32px; }
#enterprise-gateway .gateway-grid { grid-template-columns:repeat(5,minmax(0,1fr));gap:16px; }
#enterprise-gateway .gateway-card { min-width:0;overflow-wrap:anywhere; }
#enterprise-gateway .gateway-card-bottom { min-height:48px; }
#app-shell main, #app-shell main :is(section,.grid,.glass-panel),
.owner-workspace > *, .acc-layout > *, .acc-workspace { min-width:0; }
#app-shell :is(input,select,textarea) { max-width:100%; }
/* Every table keeps scrolling within its own panel, including generated reports. */
#app-shell div:has(> table), .acc-modal div:has(> table),
.profit-table-scroll, .owner-audit-scroll { min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch; }
@media (min-width:640px) and (max-width:1024px) {
 #enterprise-gateway .gateway-wrap { padding-inline:24px; }
 #enterprise-gateway .gateway-grid { grid-template-columns:repeat(2,minmax(0,1fr));gap:20px; }
 .metric-strip { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (min-width:768px) and (max-width:1024px) {
 #enterprise-gateway .gateway-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:767px) {
 #app-shell table:has(tr > :nth-child(6)), .acc-modal table:has(tr > :nth-child(6)),
 .profit-table-scroll table { min-width:720px; }
 #app-shell div > table tr > :first-child,
 .acc-modal div > table tr > :first-child,
 .profit-table-scroll table tr > :first-child {
  position:sticky;left:0;z-index:1;background:#f1f5f9;color:#243247;
  min-width:72px;max-width:180px;overflow-wrap:anywhere;box-shadow:2px 0 0 #cbd5e1;
 }
 #app-shell div > table thead tr > :first-child,
 .profit-table-scroll thead tr > :first-child { z-index:2;background:#e2e8f0; }
 #app-shell table :is(th,td) { padding:10px; }
 #app-shell table :is(input,select) { min-width:88px; }
 .owner-workspace { grid-template-columns:minmax(0,1fr); }
 .erp-navbar > *, .erp-brand, .erp-brand > div { min-width:0;max-width:100%; }
 .erp-brand h1 { overflow-wrap:anywhere; }
 .erp-brand > div > .flex { flex-wrap:wrap; }
 #toastContainer { right:16px;left:16px;max-width:calc(100% - 32px); }
 :is(.acc-modal,dialog) { max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow-y:auto; }
}
@media (max-width:639px) {
 #enterprise-gateway .gateway-wrap { padding:24px 16px; }
 #enterprise-gateway .gateway-grid { grid-template-columns:minmax(0,1fr);gap:16px;padding-block:24px; }
 #enterprise-gateway .gateway-card { padding:24px; }
 #enterprise-gateway .gateway-card-bottom { width:100%;font-size:16px;padding:14px 16px;border-radius:12px; }
 #enterprise-gateway .gateway-language { margin-left:0; }
 #enterprise-gateway .gateway-profile { padding:12px; }
 #enterprise-gateway .gateway-top { gap:16px; }
 #app-shell main { padding:16px;gap:20px; }
 .owner-kpis, .metric-strip { grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
 .owner-kpi, .metric-strip > * { min-width:0;padding:12px; }
 .owner-kpi-value, .metric-strip [id], #acc-desks .acc-desk strong {
  font-size:18px;font-weight:900;line-height:1.5;letter-spacing:-.04em;
  overflow-wrap:normal;white-space:normal;max-width:100%;overflow-x:auto;
 }
 /* Long values remain available in full through local horizontal scrolling. */
 .owner-kpi-value, .metric-strip [id] { white-space:nowrap; }
 #app-shell form .grid:not(table .grid), .acc-modal form .grid,
 .receipt-controls, .acc-form-grid, .tax-settlement-form { grid-template-columns:minmax(0,1fr);gap:12px; }
 #app-shell form .grid > *, .acc-modal form .grid > * { grid-column:auto; }
 #app-shell form > .flex, #app-shell form .flex:has(> button),
 .receipt-actions, .acc-actions { flex-direction:column;align-items:stretch;gap:12px; }
 #app-shell form :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea),
 .acc-modal :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) {
  width:100%;min-height:48px;font-size:16px;
 }
 #app-shell form button:not(table button), .owner-submit,
 .owner-approvals button, .acc-float-actions button, .acc-modal form button:not(table button), .receipt-actions button {
  width:100%;min-height:48px;padding:14px 16px;font-size:16px;border-radius:12px;
  white-space:normal;justify-content:center;margin-left:0;
 }
 .owner-action-tabs { grid-template-columns:minmax(0,1fr); }
 .owner-action-tabs button { min-height:48px;font-size:14px; }
 #app-shell table button, .acc-modal table button { min-height:44px;white-space:normal; }
 .acc-suite nav button, .domain-nav-btn { flex-shrink:0;min-height:44px; }
 #app-shell { padding-bottom:env(safe-area-inset-bottom,0px); }
 html body #erp-header { padding-top:max(12px,env(safe-area-inset-top,0px)); }
}
@media (hover:none) {
 #enterprise-gateway .gateway-card:hover { transform:none; }
}

/* Stage 1 keeps identifiers compact and the pending queue in a single table. */
#s1-returned .kyc-active-queue { min-width:640px;border-collapse:collapse;background:#fff;color:#334155; }
#s1-returned .kyc-active-queue th { background:#f1f5f9;color:#475569;font-weight:700;letter-spacing:.04em; }
#s1-returned .kyc-active-queue :is(th,td) { padding:14px 16px;border-bottom:1px solid #e2e8f0;vertical-align:middle; }
#s1-returned .kyc-active-queue strong { color:#0f172a;overflow-wrap:anywhere; }
#s1-returned .kyc-active-queue tbody tr:hover { background:#f8fafc; }
#s1-returned .kyc-pending-status { display:inline-block;padding:5px 9px;border:1px solid #fde68a;border-radius:999px;background:#fffbeb;color:#92400e;font-weight:600; }
#s1-returned .kyc-open-lab { display:inline-block;white-space:nowrap;border-radius:8px;padding:9px 12px;background:#047857;color:#fff;font-weight:700; }
#s1-returned .kyc-open-lab:hover { background:#065f46; }
#s1-returned .kyc-queue-page { padding:8px 12px;border:1px solid #94a3b8;border-radius:8px; }
#s1-returned .kyc-queue-page:disabled { opacity:.4;cursor:default; }
#s1-returned button:focus-visible { outline:2px solid #10b981;outline-offset:3px; }
