/* Floating mobile navigation; desktop retains its existing sidebar. */
@media (max-width:899px) {
 /* Let WebKit own the document height and scroll range, including installed mode. */
 html { height:auto; min-height:100%; }
 /* The top bar already fills the iPhone status-bar area; a second copy of that space on the page showed as a pale
    band ("fog") above it. Only the bar reserves it now. */
 :root { padding-top:0!important; }
 body { position:static!important; height:auto!important; min-height:100%; overflow:visible; display:block; padding-top:0!important; }
 .stage { display:block; }
 .app { container-type:normal; overflow:visible; }
 .shell { height:auto; display:block; }
 .top { position:sticky; top:0; z-index:30; min-height:calc(62px + env(safe-area-inset-top,0px)); height:auto; flex-wrap:wrap; padding-top:calc(8px + env(safe-area-inset-top,0px)); padding-bottom:8px; }
 /* The job inbox must not widen the layout viewport and displace modal controls. */
 .top [data-job-inbox-button] { flex-basis:100%; height:32px; }
 .view { overflow:visible; }
 .scrim,.sheet,.toast,.tray { position:fixed; }
 /* The compare tray sits just above the floating bottom bar (64px tall, lifted by the home-indicator inset), and above it
    in stacking order, so its Compare button is never hidden. The page gets room to scroll its last row clear of the tray. */
 .tray { bottom:calc(max(12px,env(safe-area-inset-bottom,0px)) + 72px); z-index:26; }
 .app:has(.tray) #view { padding-bottom:calc(150px + env(safe-area-inset-bottom,0px)); }
 .sheet { max-height:90dvh; }
 .sh-body { overscroll-behavior-y:contain; }
 body:has(.sheet) { overflow:hidden; }
 .msgs,.threadpane,.thread { height:auto; overflow:visible; }

 .bottom {
  position:fixed;
  left:12px;
  right:12px;
  bottom:max(12px,env(safe-area-inset-bottom,0px));
  z-index:25;
  height:64px;
  padding:6px;
  gap:4px;
  border:1px solid var(--line);
  border-radius:36px;
  background:var(--surface);
  box-shadow:0 4px 20px rgba(15,45,35,.15);
  align-items:center;
 }
 .bottom button {
  min-width:0;
  height:50px;
  border-radius:26px;
  font-size:0;
  gap:0;
  color:var(--ink);
 }
 .bottom button svg { width:25px; height:25px; }
 .bottom button[aria-current="page"] { background:var(--pine-soft); color:var(--pine); }
 .bottom .postbtn .ring {
  width:44px;
  height:44px;
  border-radius:50%;
  margin:0;
  box-shadow:none;
 }
 .bottom .badge { font-size:11px; top:0; }
 #view { padding-bottom:calc(84px + env(safe-area-inset-bottom,0px)); scroll-padding-bottom:calc(84px + env(safe-area-inset-bottom,0px)); }
}

/* Long job titles and filenames must fit their cards on narrow screens. */
[data-act="job-thread"], [data-act="job-view-file"] {
 max-width:100%; white-space:normal; overflow-wrap:anywhere; height:auto; min-height:46px;
}
[data-job-close-bar] { position:sticky; top:0; z-index:1; background:var(--surface); }

/* Attachment previews participate in the bubble's height, not a fixed-height button. */
[data-job-timeline] [data-act="job-view-photo"] {
 display:block; width:fit-content; max-width:100%; height:auto; padding:0; margin:8px 0;
}
[data-job-timeline] [data-act="job-view-photo"] img {
 width:auto; height:auto; object-fit:contain;
}
[data-job-timeline] [data-act="job-view-file"] { display:block; margin:8px 0; }

/* Home Screen app on iPhone (iOS 26.1 and later): the system blurs whatever sits behind the clock, which fogged the top
   bar. A solid strip in the top bar's color, fixed behind the clock, makes iOS show that color instead. Only in the
   installed app; Safari is handled by matching the page background. */
@media (display-mode: standalone) and (max-width:899px) {
 body::before { content:""; position:fixed; top:0; left:0; right:0; height:env(safe-area-inset-top,0px); background:var(--top-color,#17372E); z-index:31; pointer-events:none; }
}
