.sidebar{overflow-y:auto}
[hidden]{display:none!important}
.profile{display:none}
.scan-button:disabled{cursor:not-allowed;opacity:.82}
.scan-button:disabled>span{background:#edf3f6;color:#77909d}

@media(max-width:900px){
  .sidebar{width:min(286px,86vw);height:100dvh;padding-bottom:calc(20px + env(safe-area-inset-bottom))}
  .topbar{padding:env(safe-area-inset-top) 20px 0;min-height:72px;height:calc(72px + env(safe-area-inset-top))}
  .view{padding-bottom:calc(36px + env(safe-area-inset-bottom))}
}

@media(max-width:620px){
  .crumb{min-width:0}
  .crumb span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .hero-heading,.page-title{display:grid;align-items:start;gap:18px}
  .hero-heading .primary,.page-title>.primary{width:100%}
  .hero-heading h1,.page-title h1{font-size:28px;line-height:1.15}
  .trip-banner{padding:24px 20px}
  .topbar .primary.small{width:42px;height:42px;padding:0}
  .toast{left:16px;right:16px;bottom:calc(16px + env(safe-area-inset-bottom));text-align:center}
}

/* Mobile usability hardening: keep controls reachable without browser zoom. */
@media(max-width:760px){
  html{font-size:16px;-webkit-text-size-adjust:100%}
  body{overflow-x:hidden}
  main{min-width:0}
  .view{width:100%;padding:24px 16px calc(32px + env(safe-area-inset-bottom))}
  .topbar{padding-left:16px;padding-right:16px;gap:8px}
  .top-actions{gap:8px}
  .top-actions .secondary{display:none}
  .icon-button,.topbar .primary.small{min-width:44px;min-height:44px}
  .hero-heading,.page-title{margin-bottom:22px}
  .hero-heading>div,.page-title>div{min-width:0}
  .hero-heading p,.page-title p{line-height:1.5}
  .trip-banner{gap:20px;border-radius:18px;padding:22px 18px}
  .trip-banner:after{display:none}
  .trip-progress{justify-content:flex-start;min-width:0}
  .trip-progress strong{overflow-wrap:anywhere}
  .scan-button{width:100%;min-height:76px}
  .metric-grid,.dashboard-grid{gap:14px}
  .metric,.panel{padding:18px}
  .activity-row{grid-template-columns:38px minmax(0,1fr);gap:10px;padding:14px 0}
  .activity-row>div:last-child,.activity-row>strong:last-child{grid-column:2;text-align:left}
  .merchant-icon{width:38px;height:38px}
  .toolbar{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .toolbar input{grid-column:1/-1;width:100%}
  .toolbar select,.toolbar button{width:100%;min-width:0;min-height:46px}
  .selection-summary{grid-column:1/-1;max-width:none}
  .table-wrap{width:100%;max-width:100%;overflow:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
  .table-wrap table{min-width:760px}
  .receipt-select>span{min-width:250px}
  .receipt-financial-summary{font-size:12px;line-height:1.45}
  .cloud-account{position:static!important;inset:auto!important;width:auto!important;max-width:none!important;margin:12px 0 0!important;transform:none!important;z-index:auto!important}
  .sidebar-bottom{padding-bottom:env(safe-area-inset-bottom)}
  .modal-backdrop{align-items:end;padding:0;background:rgba(3,31,47,.64)}
  .modal{width:100%!important;max-width:none!important;max-height:calc(100dvh - env(safe-area-inset-top))!important;border-radius:20px 20px 0 0;padding:24px 16px calc(16px + env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain}
  .modal-close{position:sticky;float:right;top:0;right:0;z-index:8;width:44px;height:44px;border-radius:50%;background:rgba(255,255,255,.94)}
  .modal h2{font-size:22px;padding-right:46px}
  .modal-actions{position:sticky!important;left:0;right:0;bottom:calc(-16px - env(safe-area-inset-bottom))!important;display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:22px -16px -16px!important;padding:22px 16px calc(16px + env(safe-area-inset-bottom))!important;background:linear-gradient(180deg,rgba(255,255,255,0),var(--paper) 22%);z-index:7}
  .modal-actions button{width:100%;min-height:48px;padding:12px 10px}
  .receipt-scanner-modal,.receipt-evidence-modal,.bulk-package-modal{width:100%!important;max-height:calc(100dvh - env(safe-area-inset-top))!important;padding:24px 16px calc(16px + env(safe-area-inset-bottom))!important}
  .receipt-scanner-modal .upload-zone{padding:18px 12px}
  .receipt-section{grid-template-columns:44px minmax(0,1fr)}
  .receipt-section small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .long-receipt-note{align-items:stretch;flex-direction:column}
  .long-receipt-note button{width:100%;min-height:44px}
  .evidence-split,.receipt-evidence-modal .evidence-split,.selected-evidence-grid{grid-template-columns:1fr!important}
  .receipt-evidence-images img{max-height:55dvh}
  .digital-receipt,.evidence-details{padding:16px}
  .evidence-details table,.intelligence-review table,.package-items{min-width:720px}
  .evidence-audit-grid{grid-template-columns:1fr!important}
  .package-summary-grid{grid-template-columns:1fr 1fr}
}

@media(max-width:430px){
  .view{padding-left:12px;padding-right:12px}
  .hero-heading h1,.page-title h1{font-size:26px}
  .trip-banner{padding:20px 16px}
  .ring{width:68px;height:68px}
  .toolbar{grid-template-columns:1fr}
  .toolbar input,.selection-summary{grid-column:auto}
  .modal-actions{grid-template-columns:1fr}
  .evidence-totals,.package-summary-grid{grid-template-columns:1fr!important}
  .account-identity{padding:12px}
}
