/* Shared business pages, presented for touch screens. Desktop rules stay in style.css. */
.mobile-navigation,.mobile-filter-toggle,.mobile-row-toggle { display:none; }
@media (max-width:900px) {
  html { scroll-padding-top:80px; }
  body { -webkit-text-size-adjust:100%; }
  button,a,input,select,textarea { touch-action:manipulation; }
  .btn,.form-control,.submission-status-option { min-height:44px; }
  .form-control { font-size:16px; }
  textarea.form-control { min-height:96px; }
  input[type=checkbox],input[type=radio] { width:18px;height:18px;flex-shrink:0; }
  .app-header { position:sticky;top:0;min-height:54px;padding:10px 16px;background:#fff; }
  .app-header strong { display:block;font-size:17px;line-height:1.5; }
  .app-header small { display:none; }
  .app-shell:not(.password-required)>.app-header .account,.sidebar { display:none; }
  .workspace { padding:12px 16px calc(90px + env(safe-area-inset-bottom));margin:0;min-width:0; }
  .workspace.wide { padding-bottom:30px; }
  .page-location { margin-bottom:6px;font-size:11px; }
  .page-heading,.section-head { gap:12px;flex-wrap:wrap; }
  .page-heading { margin-bottom:12px; }
  .page-heading h1 { font-size:22px; }
  .page-heading p { font-size:13px;line-height:1.7; }
  .page-heading>div,.section-head>div { min-width:0; }
  .page-heading>.actions,.section-head>.actions,.actions { flex-wrap:wrap; }
  .page-heading>.actions { justify-content:flex-start; }
  .page-heading>.actions>button,.page-heading>button { white-space:normal; }
  .mobile-navigation { display:block; }
  .mobile-tabbar { position:fixed;left:0;right:0;bottom:0;z-index:8;display:flex;padding:5px 8px calc(5px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#fff; }
  .mobile-tabbar>button { position:relative;flex:1;min-width:0;min-height:58px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:5px 2px;border:0;background:transparent;color:#667c8d;font-size:11px; }
  .mobile-tabbar svg { display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round; }
  .mobile-tabbar>button[aria-current=page],.mobile-tabbar>button.selected { color:var(--navy);background:#edf3f7;border-radius:6px;font-weight:600; }
  .mobile-tab-icon { position:relative; }
  .mobile-tab-icon .unread-count { position:absolute;left:15px;top:-5px;min-width:17px;height:17px;font-size:10px;border:2px solid white;padding:0 4px;box-sizing:content-box; }
  .mobile-menu-backdrop { position:fixed;inset:0;z-index:35;background:#16293c80;display:flex;align-items:flex-end; }
  .mobile-menu { width:100%;max-height:88vh;max-height:88dvh;display:flex;flex-direction:column;background:var(--wash);border-radius:16px 16px 0 0;padding-bottom:env(safe-area-inset-bottom); }
  .mobile-menu>header { display:flex;justify-content:space-between;align-items:center;gap:12px;padding:22px 20px 16px;border-bottom:1px solid var(--line); }
  .mobile-menu h2 { margin:0;font-size:22px; }
  .mobile-menu header p { margin:7px 0 0;font-size:13px;color:var(--muted); }
  .mobile-menu-close { align-self:flex-start;width:44px;height:44px;border:1px solid var(--line);border-radius:50%;background:white;color:var(--ink);font-size:28px;line-height:1; }
  .mobile-menu-content { padding:0 20px 24px;overflow:auto;overscroll-behavior:contain; }
  .mobile-menu h3 { margin:20px 0 10px;font-size:12px;color:var(--muted);font-weight:400; }
  .mobile-menu-items { display:grid;grid-template-columns:1fr 1fr;background:#fff;border:1px solid var(--line);border-radius:6px;overflow:hidden; }
  .mobile-menu-items button { display:flex;justify-content:space-between;align-items:center;gap:6px;min-height:54px;padding:13px 12px;border:0;border-bottom:1px solid #edf1f4;background:transparent;text-align:left;color:var(--ink);font-size:13px; }
  .mobile-menu-items button:nth-child(odd) { border-right:1px solid #edf1f4; }
  .mobile-menu-items button span { color:#7c93a5;font-size:20px; }
  .mobile-menu-items button[aria-current=page] { background:#eaf2f7;color:var(--navy);font-weight:600; }
  .ledger-page { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px; }
  .ledger-page>.page-heading,.ledger-page>.ledger-exchange { margin:0;align-self:center; }
  .ledger-page>.page-heading h1 { margin:0; }
  .ledger-page>.page-heading p { display:none; }
  .ledger-page>.ledger-exchange { gap:6px; }
  .ledger-exchange .btn { padding:8px;font-size:12px; }
  .ledger-page>.filters,.ledger-page>.count,.ledger-page>.table-wrap { grid-column:1/-1; }
  .ledger-filters { display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px 12px;border-radius:6px; }
  .ledger-filters label,.ledger-filters .search { width:100%;min-width:0; }
  .ledger-filters .search { grid-column:1/-1; }
  .ledger-filters label:not(.search) { display:none; }
  .ledger-filters.filters-expanded label { display:block; }
  .ledger-filters.filters-expanded .inline-check { display:flex;grid-column:1/-1; }
  .mobile-filter-toggle { display:block;min-height:44px;border:1px solid #c5d1dc;background:#fff;color:var(--navy);border-radius:4px; }
  .mobile-filter-toggle span { margin-left:6px;font-size:12px; }
  .count { margin-bottom:8px;padding-top:10px; }
  .ledger-page>.count { margin:0;padding:0;font-size:12px; }
  .table-wrap:has(>.mobile-table) { overflow:visible;border:0;background:transparent; }
  .table.mobile-table { display:block;width:100%;min-width:0;background:transparent; }
  .mobile-table thead { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
  .mobile-table tbody { display:block; }
  .mobile-table tbody tr { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:12px;padding:8px 12px;margin-bottom:8px;border:1px solid var(--line);border-radius:6px;background:white; }
  .table.mobile-table td { display:block;width:auto;min-width:0!important;max-width:none;padding:5px 0;border:0;overflow-wrap:anywhere;white-space:normal;font-size:13px;line-height:1.5;grid-column:auto; }
  .mobile-table td[data-label]:before { content:attr(data-label);display:block;margin-bottom:2px;color:var(--muted);font-size:11px;font-weight:400; }
  .table.mobile-table td:first-child { position:relative;grid-column:1/-1;font-size:15px;font-weight:600;padding:7px 0; }
  .table.mobile-table tr[data-mobile-expanded]>td:first-child { min-height:44px;padding-right:84px; }
  .mobile-table td:first-child:before { display:none; }
  .table.mobile-table td:last-child { grid-column:1/-1; }
  .mobile-table td:last-child:has(button):before { display:none; }
  .mobile-row-toggle { display:block;position:absolute;right:-4px;top:0;min-height:44px;min-width:80px;border:0;background:transparent;color:var(--navy);font-size:12px;font-weight:400; }
  .mobile-row-toggle:focus-visible { outline:2px solid var(--navy);outline-offset:-2px; }
  .table.mobile-table tr[data-mobile-expanded=false]>td[data-mobile-secondary] { display:none; }
  .table.mobile-table tr[data-mobile-expanded=true]>td[data-mobile-secondary] { background:#f5f8fa;padding:6px; }
  .mobile-table .empty { padding:24px 0!important;font-size:14px!important;font-weight:400!important;border:0!important; }
  .mobile-table .submission-actions,.mobile-table .account-actions { display:flex;flex-wrap:wrap;gap:8px; }
  .mobile-table .action-button { width:auto;min-width:94px;height:auto;min-height:44px;padding:8px 12px; }
  .mobile-table .btn-link { min-height:44px;padding:10px 14px;background:#f0f5f8;border:1px solid #d3e0e9;border-radius:4px;white-space:normal; }
  .mobile-table small,.missing-summary { max-width:none;overflow-wrap:anywhere;margin-top:3px; }
  .table.ledger-table td:nth-child(2),.table.ledger-table td:nth-child(4) { grid-column:1/-1;padding:2px 0; }
  .ledger-table td:nth-child(2):before,.ledger-table td:nth-child(4):before,.ledger-table td:nth-child(6):before { display:none; }
  .ledger-table td:nth-child(2) { color:var(--muted); }
  .ledger-table td:nth-child(2) small { display:inline;margin-left:8px; }
  .table.ledger-table td:nth-child(6),.table.ledger-table td:last-child { grid-column:auto;align-self:center; }
  .ledger-table td:last-child { text-align:right; }
  .ledger-table tr[data-mobile-expanded=false] .missing-summary { display:none; }
  .ledger-table tr[data-mobile-expanded=true]>td { order:1; }
  .ledger-table tr[data-mobile-expanded=true]>td[data-mobile-secondary] { order:2; }
  .ledger-table tr[data-mobile-expanded=true]>td:nth-child(6),.ledger-table tr[data-mobile-expanded=true]>td:last-child { order:3; }
  .toolbar,.module-toolbar { gap:12px;flex-wrap:wrap; }
  .module-toolbar label,.module-search { min-width:0;max-width:none;width:100%; }
  .submission-status-options { gap:6px; }
  .submission-status-option { min-width:0;padding:0 12px; }
  .dialog-backdrop { padding:0;align-items:stretch; }
  .edit-dialog,.edit-dialog.compact { width:100%;max-width:none;max-height:100vh;max-height:100dvh;box-shadow:none; }
  .edit-dialog>header { padding:14px 16px;flex-shrink:0; }
  .edit-dialog>header h2 { font-size:19px;line-height:1.5; }
  .dialog-body { padding:18px 16px;flex:1;min-height:0;overscroll-behavior:contain; }
  .edit-dialog>footer { padding:12px 16px calc(12px + env(safe-area-inset-bottom));flex-shrink:0;gap:8px;background:#fff; }
  .edit-dialog>footer .btn { flex:1;white-space:normal;min-width:80px; }
  .field-grid,.record-grid,.task-fields,.task-projects,.permission-checks { grid-template-columns:minmax(0,1fr); }
  .record-grid>div { padding:14px 16px; }
  .record-grid dt { margin-bottom:5px; }
  .member-row { padding:4px 12px; }
  .tabs,.credit-tabs { overflow:auto;gap:14px;margin:14px 0 20px; }
  .tabs button,.credit-tabs button { white-space:nowrap;min-height:44px; }
  .overview-counts { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .overview-counts button { padding:14px; }
  .overview-counts strong { font-size:28px;margin:5px 0; }
  .overview-counts button:last-child { grid-column:1/-1; }
  .overview-work-links,.review-strip { flex-wrap:wrap;gap:10px; }
  .overview-work-links>.btn { flex:1;white-space:normal; }
  .review-strip { padding:14px; }
  .review-strip button { width:100%;flex:auto;min-width:0; }
  .distribution-grid { grid-template-columns:minmax(0,1fr); }
  .module-panel { padding:16px; }
  .notice-row { padding:16px;gap:10px;flex-direction:column; }
  .notice-tracking { flex-direction:row;flex-wrap:wrap; }
  .scope-options,.comparison { grid-template-columns:1fr; }
  .project-scope-search { flex-wrap:wrap;gap:8px; }
  .project-scope-search label { flex:1 1 100%; }
  .inspection-file,.attachment-list>div { flex-wrap:wrap;gap:8px; }
  .inspection-file>span { flex:1 1 100%; }
  .regulatory-facts,.enterprise-counts { gap:14px; }
  .regulatory-project-choice { grid-template-columns:1fr; }
  .regulatory-template-list>div { gap:10px;flex-wrap:wrap; }
  .credit-check-summary { grid-template-columns:1fr;gap:12px;padding:14px; }
  .credit-detail,.regulatory-detail { padding:16px; }
  .busy-bar { bottom:calc(82px + env(safe-area-inset-bottom));top:auto;right:16px;max-width:calc(100% - 32px);font-size:13px; }
  .permission-feedback { top:80px; }
  .login-layout { border:0;min-height:100vh;min-height:100dvh; }
  .login-intro { padding:30px 24px 26px; }
  .login-intro h1 { font-size:26px;margin:18px 0 8px; }
  .login-intro p { font-size:12px;letter-spacing:2px;margin:0; }
  .district { font-size:12px; }
  .login-box { padding:28px 24px; }
  .login-box h2 { font-size:22px; }
  .login-box form { margin-top:22px; }
  .login-box .btn-block { min-height:48px;font-size:16px; }
  .workspace>.narrow { padding:18px; }
}
@media (min-width:600px) and (max-width:900px) and (max-height:500px) {
  .app-header { position:static;min-height:40px;padding:8px 16px; }
  .app-header strong { font-size:16px; }
  .workspace { padding-top:6px; }
  .page-location { display:none; }
  .ledger-page { gap:4px; }
  .ledger-page>.page-heading h1 { font-size:20px; }
  .ledger-filters:not(.filters-expanded) { grid-template-columns:minmax(0,1fr) 112px 80px;padding:6px 10px; }
  .ledger-filters:not(.filters-expanded) .search { grid-column:auto; }
  .ledger-filters:not(.filters-expanded) .search-label { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%); }
  .ledger-filters:not(.filters-expanded) .search input { margin-top:0; }
  .mobile-tabbar { padding:2px 8px calc(2px + env(safe-area-inset-bottom)); }
  .mobile-tabbar>button { min-height:46px;flex-direction:row;gap:8px; }
  .mobile-tabbar svg { width:20px;height:20px; }
}
