/* ==========================================================================
   Piston Tribe: the one mobile header + the badge + the bottom nav restyle
   Mockups: Plan/pt-pwa-header.html · Plan/pt-bottom-nav.html (30 Sep 2026) · brief Plan/pwa-header-brief.md

   - Below 900px `.pt-hd` IS the header: the theme's logo, the hamburger, the old icon rail, the back button, the
     account breadcrumb and the shop secondary nav all stand down. Above 900px `.pt-hd` is display:none and the
     desktop header is untouched.
   - `.pt-hd-mode[data-mode=app|web]`: both are in the markup; `html.pt-standalone` (set before first paint by
     pt-mobile-shell.php) picks one. PHP cannot see display-mode.
   - Tokens: --pt-* from css/header-footer-global.css. Accent blue is --pt-accent (#185FA5), not the mockup's #1D4ED8.
   - Badges (`.pt-badge`) are the ONLY rounded element on the site.
   ========================================================================== */

.pt-hd{display:none}
.pt-badge{
  position:absolute;top:4px;right:2px;
  min-width:18px;height:18px;padding:0 5px;border-radius:999px;
  background:var(--pt-badge);color:#fff;
  font-family:var(--pt-mono);font-variant-numeric:tabular-nums;font-size:10.5px;line-height:18px;font-weight:400;text-align:center;
  border:2px solid var(--pt-surface);box-sizing:content-box;pointer-events:none
}

@media (max-width:899px){
  /* ── the bar ─────────────────────────────────────────────────────────────── */
  .site-header .inside-header{padding:0!important;grid-template-columns:1fr!important}
  .site-header .inside-header > .pt-hd{display:block!important;grid-column:1 / -1;grid-row:1}
  .site-header .inside-header > .site-logo,
  .site-header .inside-header > .pt-hamburger,
  .site-header .inside-header > .pt-header-icons,
  .site-header .inside-header > .pt-appbar__backspace{display:none!important}
  .pt-hd{display:block;height:56px;background:var(--pt-surface);border-bottom:1px solid var(--pt-border);color:var(--pt-ink);
         width:100%;max-width:100%;min-width:0;flex:1 1 100%;box-sizing:border-box;overflow:hidden}   /* whatever the theme's header container is (grid on most pages, flex on the deal page), the bar is the viewport's width and the title truncates inside it */
  .pt-hd-mode{min-width:0}
  .pt-hd-wrap .pt-hd{position:fixed;top:0;left:0;right:0;z-index:9999}   /* the listing template, which has no site header */
  .pt-hd-mode{display:flex;align-items:center;height:55px;padding:0 6px;gap:0}
  html:not(.pt-standalone) .pt-hd-mode[data-mode="app"]{display:none}
  html.pt-standalone .pt-hd-mode[data-mode="web"]{display:none}
  .pt-hd-l,.pt-hd-r{display:flex;align-items:center;flex:0 0 auto}
  .pt-hd-spacer{flex:1;min-width:0}
  .pt-hd-tgt{position:relative;width:44px;height:44px;display:grid;place-items:center;color:var(--pt-ink);text-decoration:none;flex:0 0 auto}
  .pt-hd-tgt:hover,.pt-hd-tgt:focus{color:var(--pt-ink);text-decoration:none}
  .pt-hd-tgt:focus-visible{outline:2px solid var(--pt-accent);outline-offset:-4px}
  .pt-hd-tgt svg{width:24px;height:24px;display:block}
  .pt-hd-tgt--txt{width:auto;padding:0 10px;font-size:13.5px;font-weight:600;color:var(--pt-accent);white-space:nowrap}
  .pt-hd-tgt--txt:hover,.pt-hd-tgt--txt:focus{color:var(--pt-accent)}
  .pt-hd-tgt--avatar img{width:28px;height:28px;display:block;object-fit:cover;border-radius:0}
  .pt-hd-logo{flex:1;min-width:0;padding-left:6px;font-weight:800;font-size:14px;letter-spacing:.02em;color:var(--pt-ink);white-space:nowrap}
  .pt-hd-text{flex:1;min-width:0;padding-left:6px;font-size:17px;font-weight:600;color:var(--pt-ink)}
  .pt-hd-title{flex:1;min-width:0;padding-left:6px;font-size:17px;font-weight:600;line-height:1.15;color:var(--pt-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .pt-hd-title__t{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .pt-hd-title__s{display:block;font-size:11.5px;color:var(--pt-ink-3);font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .pt-hd-title__s:empty{display:none}
  .pt-hd-party{flex:1;min-width:0;display:flex;align-items:center;gap:10px;padding-left:4px;color:var(--pt-ink);text-decoration:none}
  .pt-hd-party:hover,.pt-hd-party:focus{color:var(--pt-ink);text-decoration:none}
  .pt-hd-party__av{width:40px;height:40px;flex:0 0 auto;object-fit:cover;background:var(--pt-border-strong);display:block;border-radius:0}
  .pt-hd-party__b{min-width:0;display:flex;flex-direction:column;gap:1px}
  .pt-hd-party__n{font-size:17px;font-weight:600;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .pt-hd-party__s{font-size:12px;color:var(--pt-ink-3);font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .pt-hd-title__s--btn{font:inherit;font-size:11.5px;color:var(--pt-ink-3);background:none;border:0;padding:0;margin:0;text-align:left;cursor:pointer;border-bottom:1px dotted var(--pt-ink-3);line-height:1.3}
  .pt-hd-title__s--btn:hover,.pt-hd-title__s--btn:focus,.pt-hd-title__s--btn:active{background:none;color:var(--pt-ink)}
  .pt-hd-search{flex:1;min-width:0;margin:0 8px;border:1px solid var(--pt-border-strong);background:var(--pt-surface-dim);padding:9px 10px;font-size:13px;color:var(--pt-ink-3);display:flex;gap:6px;align-items:center;text-decoration:none;border-radius:0}
  .pt-hd-search:hover,.pt-hd-search:focus{color:var(--pt-ink-3);text-decoration:none}
  .pt-hd-search svg{width:16px;height:16px;stroke:var(--pt-ink-3);flex:0 0 auto}
  .pt-hd-search span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

  /* ── the rows the bar replaces below 900px ───────────────────────────────── */
  .secondary-navigation,#pt-secondary-navigation{display:none!important}         /* shop sub-nav: a second bar */
  body.woocommerce-account nav.pt-account-breadcrumb{display:none!important}     /* the account title row: the bar carries title + back */
  .pt-listing-minimal-header{display:none!important}                              /* the listing page's own bar */
  .pt-dl > .pt-dl-crumb,.pt-dl .pt-dl-head > .pt-dl-h1{display:none!important}    /* Deals: the bar carries "Deals"; the Buying/Selling tabs stay */
  .pt-dl .pt-dl-sp > .pt-dl-util{display:none!important}                            /* …and the List/Board toggle (the bar's right control); Sort & filter stays in the page */
  .pt-chat-shell .pt-listing-banner{position:static!important;top:auto!important} /* the deal banner scrolls away: one sticky bar */
  .pt-chat-shell .pt-listing-banner .pt-gs-back{display:none!important}           /* only its back arrow goes (the bar has one); the deal summary row stays — it is the way into Deal details (Leon, 30 Sep 20:30) */
  /* the "WHERE THE MONEY IS" hover tooltip on the price/chip: a tap sticks :hover and the tip pushed the row (Leon 20:43 + 21:28).
     On phones the Deal details dialog IS the tap — no tooltip, ever. */
  .pt-chat-shell .pt-listing-banner .pt-lb-escrow .pt-lb-escrow__tip,.pt-chat-shell .pt-listing-banner .pt-lb-escrow:hover .pt-lb-escrow__tip,.pt-chat-shell .pt-listing-banner .pt-lb-escrow:focus .pt-lb-escrow__tip,.pt-chat-shell .pt-listing-banner .pt-lb-escrow:focus-within .pt-lb-escrow__tip{display:none!important;visibility:hidden!important;opacity:0!important}
  .pt-chat-shell .pt-listing-banner{overflow-x:clip}
  /* the row = the item (Leon's mockup 21:02): thumbnail · title / "■ You're buying · stage" · price / state chip; the party is in the bar */
  .pt-chat-shell .pt-listing-banner .pt-gs-identity{display:none!important}
  .pt-chat-shell .pt-listing-banner .pt-gs-titleblock .pt-lb-title{display:block;font-size:15px;font-weight:600;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--pt-ink)}
  .pt-chat-shell .pt-listing-banner .pt-gs-sideline{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--pt-ink-2);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .pt-chat-shell .pt-listing-banner .pt-gs-sideline__sq{width:8px;height:8px;background:var(--pt-amber-dot);flex:0 0 auto;display:inline-block}
  .pt-chat-shell .pt-listing-banner .pt-lb-escrow{display:flex!important;flex-direction:column-reverse!important;flex-wrap:nowrap!important;align-items:flex-end!important;gap:4px!important;flex:0 0 auto!important;width:auto!important;min-width:0!important;max-width:42%!important;padding:0!important}   /* price on top, state chip under it (the mockup) */
  .pt-chat-shell .pt-listing-banner .pt-lb-escrow__sub{display:none!important}
  .pt-chat-shell .pt-listing-banner .pt-gs-titleblock{flex:1 1 0%!important;min-width:0!important}
  .pt-chat-shell .pt-listing-banner .pt-lb-thumb-wrap,.pt-chat-shell .pt-listing-banner .pt-lb-thumb-wrap img{width:56px;height:42px;flex:0 0 auto;object-fit:cover}
  .pt-chat-shell .pt-listing-banner .pt-lb-escrow__value{font-size:17px;font-weight:600}
  .pt-chat-shell .pt-listing-banner .pt-lb-escrow__label{font-size:12.5px;padding:3px 8px;background:var(--pt-surface-dim);color:var(--pt-ink-2);border-radius:0}
  .pt-chat-shell .pt-listing-banner .pt-lb-escrow__label .pt-lb-escrow__dot{display:none}
  /* the seller line: the name never shrinks to nothing (it was "Su…" on Leon's phone); rating + reply time wrap under it */
  .pt-chat-shell .pt-listing-banner .pt-gs-identity{flex-wrap:wrap;row-gap:2px}
  .pt-chat-shell .pt-listing-banner .pt-gs-identity__link{flex:0 0 auto;max-width:100%}
  .pt-chat-shell .pt-listing-banner .pt-gs-identity__name{flex:0 1 auto;max-width:150px;min-width:0}
  .pt-chat-shell .pt-listing-banner .pt-gs-identity__avatar{flex:0 0 22px;width:22px;height:22px}

  /* App mode, Marketplace: the bar carries the search field, so the page's own title row + search row stand down
     until the bar's field is tapped (html.pt-search-open reveals the page field — it owns the autocomplete + radius). */
  html.pt-standalone:not(.pt-search-open) .pt-market-header{display:none!important}
  html.pt-standalone .pt-market-header .pt-header-text-group{display:none!important}   /* title, sub, "+ Create a listing" — Sell is a bottom tab, never duplicated above */
  html.pt-standalone .pt-market-header .pt-market-actions{min-width:0!important}
  html.pt-standalone .pt-market-archive-wrapper{padding-top:12px!important}        /* the 40px that cleared the old title row */
  html.pt-standalone.pt-search-open .pt-market-header{margin-bottom:4px}
  /* The push prompt sits above the bottom nav, never on it. */
  html.pt-standalone .pt-push-ask{bottom:calc(76px + env(safe-area-inset-bottom,0px))}

  /* App mode, inside a deal: the chat shell ends exactly at the bottom nav (64px + the home-indicator inset), and the
     composer's own home-indicator margin goes — the nav sits there now (Leon 20:35, "the input bar needs to come down"). */
  html.pt-standalone .pt-chat-shell.pt-is-offer,
  html.pt-standalone .pt-chat-shell.pt-is-offer.pt-inbox-collapsed{height:calc(100dvh - var(--pt-header-h,56px) - 64px - env(safe-area-inset-bottom,0px))!important;max-height:calc(100dvh - var(--pt-header-h,56px) - 64px - env(safe-area-inset-bottom,0px))!important}
  html.pt-standalone .pt-chat-shell .pt-footer-input{margin-bottom:0!important;padding-bottom:10px!important}   /* the input box ends 10px above the nav (Leon 21:16) */

  /* The Action Menu drawer (Leon 21:22): it opens under the bar and above the bottom nav, so its close X is never behind the
     header and its Done bar is never behind the nav. Web mode (no nav): under the bar only. */
  .pt-actions-drawer{top:var(--pt-header-h,56px)!important}
  html.pt-standalone .pt-actions-drawer{bottom:calc(64px + env(safe-area-inset-bottom,0px))!important}
  .pt-actions-drawer .pt-actions-drawer__panel{top:0!important;height:100%!important;max-height:100%!important}
  .pt-actions-drawer .pt-actions-drawer__foot{display:block!important}
  html.pt-standalone .pt-actions-drawer .pt-actions-drawer__foot{padding-bottom:12px!important}   /* the nav carries the home-indicator inset */

  /* ── bottom nav (app mode) — Plan/pt-bottom-nav.html "Flat, five equal tabs" ── */
  html.pt-standalone .pt-appbar{
    display:flex;position:fixed;left:0;right:0;bottom:0;z-index:9000;
    height:calc(64px + env(safe-area-inset-bottom,0px));padding:0 4px env(safe-area-inset-bottom,0px);
    background:var(--pt-surface);border-top:1px solid var(--pt-border);box-shadow:none
  }
  html.pt-standalone .pt-appbar__item{
    flex:1 1 0;min-width:0;min-height:44px;height:64px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;
    padding:9px 0 0;position:relative;color:var(--pt-ink-3);font-size:10.5px;letter-spacing:.01em;font-weight:400;text-decoration:none;background:transparent;border:0;border-radius:0;margin:0
  }
  html.pt-standalone .pt-appbar__item:hover,html.pt-standalone .pt-appbar__item:focus{color:var(--pt-ink-3);background:transparent;text-decoration:none}
  html.pt-standalone .pt-appbar__item.is-on{color:var(--pt-ink);font-weight:600}
  html.pt-standalone .pt-appbar__item.is-on::before{content:"";position:absolute;top:0;left:50%;width:28px;height:2px;background:var(--pt-ink);transform:translateX(-50%)}
  html.pt-standalone .pt-appbar__icon{position:relative;width:26px;height:26px;display:block;margin:0 auto 3px;background:transparent;border:0;border-radius:0}
  html.pt-standalone .pt-appbar__icon svg{width:26px;height:26px;display:block;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
  html.pt-standalone .pt-appbar__item.is-on .pt-appbar__icon svg{stroke-width:2}
  html.pt-standalone .pt-appbar__label{font-size:10.5px;line-height:1;display:block}
  /* Sell: plus-in-square, same size as the others — nothing raised, nothing rounded. Active = filled ink, plus in white. */
  html.pt-standalone .pt-appbar__item--primary{margin:0;transform:none}
  html.pt-standalone .pt-appbar__item--primary .pt-appbar__icon{width:26px;height:26px;background:transparent;color:inherit;margin:0 auto 3px;border-radius:0;box-shadow:none}
  html.pt-standalone .pt-appbar__item--primary.is-on .pt-appbar__icon svg rect{fill:var(--pt-ink);stroke:var(--pt-ink)}
  html.pt-standalone .pt-appbar__item--primary.is-on .pt-appbar__icon svg path{stroke:var(--pt-surface)}
  html.pt-standalone .pt-appbar .pt-badge{top:5px;left:calc(50% + 8px);right:auto}
  html.pt-standalone body{padding-bottom:calc(64px + env(safe-area-inset-bottom,0px))!important}
  html.pt-standalone.pt-kb-open .pt-appbar,html.pt-standalone.pt-photo-picker .pt-appbar{display:none}
  html.pt-standalone.pt-kb-open body,html.pt-standalone.pt-photo-picker body{padding-bottom:0!important}
}

@media (min-width:900px){ .pt-gs-sideline{display:none} }

/* ── /inbox/ — Messages + Alerts, one page, two tabs (all widths) ──────────────────────────
   Classes are pt-ibx-* : the legacy Messages list (rendered inside the Messages tab) already owns .pt-inbox-panel /
   .pt-inbox-card. The page offset is restated with !important like body.pt-app-page: on this custom route WP prints
   global-styles-inline-css (body{padding:0}) in the footer, after header-footer-global.css. */
body.pt-inbox-page{padding-top:var(--pt-header-h,72px)!important}
@media (max-width:1100px){ body.pt-inbox-page{padding-top:var(--pt-header-h,60px)!important} }
.pt-ibx{max-width:1080px;margin:0 auto;padding:16px 0 40px}
.pt-ibx-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.pt-ibx-h1{font-size:22px;font-weight:600;margin:0;letter-spacing:-.01em}
.pt-ibx-markall{font:inherit;font-size:13.5px;font-weight:600;color:var(--pt-accent);background:none;border:0;padding:8px 0;cursor:pointer}
.pt-ibx-markall:hover,.pt-ibx-markall:focus,.pt-ibx-markall:active{background:none;color:var(--pt-accent);text-decoration:underline}
.pt-ibx-sec{margin-top:18px;scroll-margin-top:calc(var(--pt-header-h,56px) + 8px)}
.pt-ibx-sec:first-of-type{margin-top:8px}
.pt-ibx-h2{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:600;margin:0 0 10px;padding:0;border:0;text-transform:none;letter-spacing:0;color:var(--pt-ink)}
.pt-badge--inline{position:static;display:inline-block;border-color:var(--pt-surface)}
body.pt-inbox-page .woocommerce-MyAccount-content h2{text-transform:none;letter-spacing:0}
body.pt-inbox-page .woocommerce-MyAccount-content h2.pt-ibx-h2{font-size:15px!important;font-weight:600!important;margin:0 0 10px!important;padding:0!important;border:0!important;text-transform:none!important;letter-spacing:0!important}
/* The Messages tab's legacy list, quietened to the design system on this page only: square, one border, no red
   (bins are ink-3, unread dot is ink), and no "Marketplace · offer conversations" promo — Deals is a tab of its own. */
body.pt-inbox-page .pt-offers-promo{display:none!important}
body.pt-inbox-page .pt-inbox-panel,body.pt-inbox-page .pt-inbox-search,body.pt-inbox-page .pt-inbox-card__avatar{border-radius:0!important}
body.pt-inbox-page .pt-inbox-panel,body.pt-inbox-page .pt-inbox-search{border-color:var(--pt-border-strong)!important}
body.pt-inbox-page .pt-inbox-card{border-bottom-color:var(--pt-border)!important}
body.pt-inbox-page .pt-inbox-card__delete,body.pt-inbox-page .pt-inbox-card__delete:hover,body.pt-inbox-page .pt-inbox-card__delete:focus,body.pt-inbox-page .pt-inbox-card__delete:active{color:var(--pt-ink-3)!important}
body.pt-inbox-page .pt-inbox-card__delete:hover,body.pt-inbox-page .pt-inbox-card__delete:focus{color:var(--pt-ink)!important}
body.pt-inbox-page .pt-inbox-card__unread-dot{background:var(--pt-ink)!important;border-radius:0!important}
body.pt-inbox-page .pt-inbox-card__time{color:var(--pt-ink-3)!important}
body.pt-inbox-page .pt-inbox-card__excerpt{color:var(--pt-ink-2)!important}
@media (max-width:899px){
  .pt-ibx{padding:4px 0 24px}
  .pt-ibx-head{display:none}      /* the bar carries "Inbox · N unread" and Mark all read below 900px */
}

/* ── APP SHELL (performance Job 2 part 2, 30 Sep 2026) ──────────────────────────────────────────────────────────────
   1. Cross-document view transitions: the bar and the bottom nav keep their place while the content crossfades — the
      shell stays painted while the page swaps (Chrome 126+, Safari 18.2+; older browsers simply navigate).
   2. Pending feedback within a frame of the tap: html.pt-nav-pending (js/pt-header.js) dims the content and runs a thin
      progress line under the bar, so a 0.5–0.8 s server round-trip never reads as a dead tap. Cleared on pageshow. */
@view-transition { navigation: auto; }
::view-transition-old(root){animation-duration:.12s}
::view-transition-new(root){animation-duration:.16s}
@media (max-width:899px){
  .pt-hd{view-transition-name:pt-hd}
  html.pt-standalone .pt-appbar{view-transition-name:pt-nav}
}
@media (prefers-reduced-motion:reduce){
  @view-transition { navigation: none; }
}
html.pt-nav-pending .site-content,html.pt-nav-pending #primary{opacity:.55;transition:opacity .12s ease}
html.pt-nav-pending::after{content:"";position:fixed;left:0;top:0;height:2px;width:0;background:var(--pt-ink);z-index:100000;animation:pt-nav-progress 1.4s cubic-bezier(.2,.7,.3,1) forwards}
@media (max-width:899px){ html.pt-nav-pending::after{top:55px} }
@keyframes pt-nav-progress{0%{width:0}60%{width:70%}100%{width:88%}}
.pt-appbar__item.is-pending,.pt-hd-tgt.is-pending{opacity:.6}
