/* InventoryRoad compact app chrome + phone navigation. */
.mobile-more-button,
.mobile-more-backdrop,
.mobile-more-sheet,
.mobile-app-back{display:none}

/* Remove the retired Incoming tab everywhere. Incoming now lives in Appraisals. */
.nav>a[href="#inventory"]{display:none!important}

/* Use the persistent brand bar once; do not repeat InventoryRoad as a dashboard heading. */
body.dashboard-route #pageHeader{display:none!important}
body.dashboard-route .page-shell{padding-top:10px!important}
.topbar-inner{min-height:58px;padding-left:18px;padding-right:18px}
.page-shell{padding-top:18px}
.page-header{margin-bottom:14px}
.page-header h1{font-size:25px}

/* Nine-stage appraisal lifecycle stays readable without consuming a tall block. */
.status-workflow{overflow:hidden}
.status-workflow-steps{
  display:grid!important;
  grid-template-columns:repeat(9,minmax(112px,1fr))!important;
  overflow-x:auto;
  overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
.status-step{
  min-width:112px;
  min-height:62px;
  padding:9px 10px!important;
  display:grid!important;
  grid-template-columns:24px minmax(0,1fr);
  grid-template-rows:auto auto;
  column-gap:7px;
  align-items:center;
}
.status-step>span{grid-row:1/3}
.status-step>b{font-size:11px;line-height:1.15;white-space:normal}
.status-step>small{font-size:9px;line-height:1.2;color:#6b7280;white-space:normal}
.status-step.complete>small,.status-step.active>small{color:inherit;opacity:.75}
.status-workflow-head{gap:10px!important;padding:10px 12px!important}
.status-workflow-head label{margin:0!important}
.status-workflow>[data-acquisition-membership]{margin:8px 12px 10px!important;font-size:12px}

.ir-merge-chip.unmatched{font-weight:850}

@media (max-width:760px){
  .topbar-inner{justify-content:flex-start;min-height:50px;padding:7px 10px}
  .brand{font-size:14px}
  .userbox{display:none!important}

  .mobile-app-back:not([hidden]){
    display:flex;
    flex:0 0 auto;
    min-width:44px;
    min-height:40px;
    margin:0 1px 0 -4px;
    padding:0 6px 0 2px;
    border:0;
    border-radius:10px;
    background:transparent;
    color:var(--dealer-blue,#234b73);
    align-items:center;
    justify-content:center;
    gap:1px;
    font-weight:800;
    cursor:pointer;
  }

  .mobile-app-back:active{
    background:#eaf2f8;
  }

  .mobile-app-back-chevron{
    font-size:34px;
    line-height:28px;
    font-weight:400;
    transform:translateY(-1px);
  }

  .mobile-app-back-label{
    font-size:12px;
    line-height:1;
  }

  body.mobile-standalone .topbar{
    padding-top:env(safe-area-inset-top);
  }

  body.mobile-dashboard .page-shell{padding-top:6px!important}

  /* Physical Inventory starts with the action most staff use: continue an open count. */
  .pi-open-counts-card .table-wrap{
    width:100%!important;
    margin-left:0!important;
    overflow:visible!important;
    border:0!important;
  }

  .pi-open-counts-card .data-table{
    min-width:0!important;
    width:100%!important;
    display:block;
  }

  .pi-open-counts-card .data-table thead{
    display:none;
  }

  .pi-open-counts-card .data-table tbody{
    display:grid;
    gap:9px;
  }

  .pi-open-counts-card .data-table tr{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:6px 10px;
    padding:12px;
    border:1px solid var(--dealer-line,var(--line));
    border-radius:12px;
    background:#fff;
  }

  .pi-open-counts-card .data-table td{
    display:block;
    position:static!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }

  .pi-open-counts-card .data-table td:nth-child(1){
    grid-column:1;
    grid-row:1 / span 2;
  }

  .pi-open-counts-card .data-table td:nth-child(2){
    grid-column:2;
    grid-row:1;
    text-align:right;
    font-weight:800;
  }

  .pi-open-counts-card .data-table td:nth-child(3){
    grid-column:2;
    grid-row:2;
    text-align:right;
  }

  .pi-open-counts-card .data-table td:nth-child(4){
    grid-column:1 / -1;
    grid-row:3;
    margin-top:4px;
  }

  .pi-open-counts-card .pi-continue-count{
    width:100%;
    min-height:48px;
    font-size:15px!important;
    font-weight:900;
    letter-spacing:.02em;
  }

  .pi-open-counts-card .pi-open-count-empty{
    display:block;
  }

  .pi-open-counts-card .pi-open-count-empty td{
    text-align:left!important;
    padding:4px 0!important;
  }

  .nav{
    overflow:visible!important;
    justify-content:space-around;
  }

  /* Four primary destinations + More. New Appraisal lives in More on phones. */
  .nav>a.btn.primary{display:none!important}

  .nav>a,
  .nav>a.btn,
  .mobile-more-button{
    flex:1 1 20%!important;
    min-width:0!important;
    max-width:none!important;
  }

  .mobile-more-button{
    display:flex;
    min-height:52px;
    border:0;
    border-radius:10px;
    background:transparent;
    color:#425466;
    padding:6px 4px;
    align-items:center;
    justify-content:center;
    flex-direction:column;
    gap:1px;
    line-height:1.1;
    font-size:11px!important;
    font-weight:700;
    cursor:pointer;
  }

  .mobile-more-button.active,
  .mobile-more-button[aria-expanded="true"]{
    background:#eaf2f8;
    color:var(--dealer-blue,#234b73);
  }

  .mobile-more-dots{
    font-size:17px;
    line-height:13px;
    letter-spacing:1px;
    font-weight:900;
  }

  .mobile-more-backdrop{
    display:block;
    position:fixed;
    inset:0;
    z-index:180;
    width:100%;
    height:100%;
    border:0;
    padding:0;
    background:rgba(15,23,42,.42);
    -webkit-backdrop-filter:blur(2px);
    backdrop-filter:blur(2px);
  }

  .mobile-more-sheet{
    display:block;
    position:fixed;
    left:8px;
    right:8px;
    bottom:calc(8px + env(safe-area-inset-bottom));
    z-index:190;
    max-height:min(70dvh,560px);
    overflow:auto;
    background:#fff;
    border:1px solid var(--dealer-line,var(--line));
    border-radius:18px;
    box-shadow:0 20px 60px rgba(15,23,42,.28);
    padding:8px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .mobile-more-backdrop[hidden],
  .mobile-more-sheet[hidden]{display:none!important}

  .mobile-sheet-handle{
    width:42px;
    height:5px;
    border-radius:999px;
    background:#d0d7de;
    margin:2px auto 8px;
  }

  .mobile-sheet-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    min-height:44px;
    padding:0 2px 6px;
  }

  .mobile-sheet-head strong{font-size:18px}

  .mobile-sheet-close{
    width:40px;
    height:40px;
    min-height:40px!important;
    border:0;
    border-radius:50%;
    background:#eef1f4;
    color:#25384a;
    font-size:26px!important;
    line-height:1;
  }

  .mobile-sheet-links{
    display:grid;
    gap:8px;
  }

  .mobile-sheet-links a{
    display:grid;
    gap:3px;
    padding:13px 14px;
    min-height:62px;
    border:1px solid #d7e0e7;
    border-radius:12px;
    background:#f8fafc;
  }

  .mobile-sheet-links a span{
    font-size:15px;
    font-weight:800;
    color:#173a5e;
  }

  .mobile-sheet-links a small{
    font-size:12px;
    line-height:1.35;
    color:#6b7b88;
  }

  .mobile-signout{
    width:100%;
    min-height:46px;
    margin-top:10px;
    border:1px solid #c8d0d8;
    border-radius:10px;
    background:#fff;
    color:#374151;
    font-weight:800;
  }

  body.mobile-sheet-open{overflow:hidden}

  .status-workflow-head{display:grid!important;grid-template-columns:1fr!important;align-items:stretch!important}
  .status-workflow-head select,.status-workflow-head input{width:100%!important}
  .status-workflow-steps{display:flex!important;padding:0!important;scroll-snap-type:x proximity}
  .status-step{flex:0 0 128px!important;min-width:128px!important;min-height:66px;scroll-snap-align:start}

  /* Reduce perceived jumpiness when route content changes. */
  #pageContent{
    min-height:55dvh;
    contain:layout style;
  }

  #pageContent>.card,
  #pageContent>.grid,
  #pageContent>.pi-stack,
  #pageContent>.appraisal-workbench{
    animation:mobile-enter .14s ease-out both;
  }

  @keyframes mobile-enter{
    from{opacity:.72;transform:translateY(2px)}
    to{opacity:1;transform:none}
  }

  @media (prefers-reduced-motion:reduce){
    #pageContent>.card,
    #pageContent>.grid,
    #pageContent>.pi-stack,
    #pageContent>.appraisal-workbench{animation:none}
  }
}
