/* WHS Customer Portal — Phase 5B.
   Same Phase 4 tokens as the back-office, but a distinct customer surface:
   photos first, softer statuses, fluid to 390px, no table chrome on phones. */

/* Inter, self-hosted. A variable font, so ONE file covers 100-900 — the
   prototype's own port learned that after downloading ten near-identical
   files. No @import, no CDN, nothing fetched from a third party: the brief
   rules it out, and a client portal showing damage photographs is the last
   place to make an exception. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Re-skinned to the tokens the marketing theme already ships, so the portal
   and the site a client arrives from are plainly the same product. Taken from
   themes/whs/assets/css/prototype.css rather than re-invented. Only the token
   block changed: every p-* class name, and therefore every template and every
   capability check, is untouched. */
:root {
  --bg: #F4F6F8; --surface: #FFFFFF; --inset: #F2F4F6;
  --border: #E3E7EB; --border-strong: #C4CCD4;
  --ink: #111418; --text: #2b323a; --text-2: #5a6570; --muted: #9aa7b4;
  --accent: #183650; --accent-hover: #12293d; --accent-soft: #E4EAF0;
  --danger: #B23B2E; --danger-soft: #F6DFDA;
  --status-awaiting-bg: #F1E9D9; --status-awaiting-text: #79601F;
  --status-instock-bg: #DEEDE4; --status-instock-text: #20603F;
  --status-onlist-bg: #DEE9F4; --status-onlist-text: #28567F;
  --status-delivered-bg: #E7EAEE; --status-delivered-text: #4E565F;
  --status-damage-bg: #F6DFDA; --status-damage-text: #96311F;
  --r-control: 8px; --r-chip: 6px; --r-card: 12px; --r-thumb: 6px; --r-pill: 9999px;
  --shadow-card: 0 1px 3px rgba(20, 23, 28, 0.06);
  --focus-ring: 0 0 0 2px #183650, 0 0 0 5px rgba(24, 54, 80, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px; line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-chip); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- shell ---------- */
.p-head {
  background: var(--ink); color: #fff;
  padding: 12px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.p-head__brand { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #D6DBE1; }
.p-head__spacer { margin-left: auto; }
.p-head__client { display: flex; align-items: center; gap: 9px; font-weight: 700; color: #fff; }
.p-head__avatar {
  width: 30px; height: 30px; border-radius: var(--r-pill); background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; flex: none;
}
.p-head__signout {
  background: none; border: 1px solid #3A4048; color: #D6DBE1;
  border-radius: var(--r-control); min-height: 44px; padding: 0 16px;
  display: inline-flex; align-items: center;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.p-head__signout:hover { background: #2A2F36; color: #fff; }

.p-wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }
.p-title { font-size: 24px; font-weight: 800; color: var(--ink); margin: 0 0 4px; letter-spacing: -0.2px; }
.p-sub { color: var(--text-2); margin: 0 0 20px; }

/* ---------- controls ---------- */
.p-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.p-search { position: relative; flex: 1 1 240px; max-width: 420px; }
.p-search input {
  width: 100%; min-height: 44px; padding: 0 14px 0 38px;
  border: 1px solid var(--border-strong); border-radius: var(--r-control);
  background: var(--surface); font: inherit; color: var(--text);
}
.p-search__icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.p-select {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: var(--r-control); background: var(--surface); font: inherit;
  font-weight: 600; color: var(--text); cursor: pointer;
}
.p-tabs { display: inline-flex; background: var(--inset); border-radius: var(--r-control); padding: 3px; gap: 3px; }
/* 44px everywhere: the portal is customer-facing and fully fluid to 390 (Phase 7 §90). */
.p-tabs a {
  min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center;
  border-radius: var(--r-chip); font-size: 13px; font-weight: 700;
  color: var(--text-2); text-decoration: none;
}
.p-tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.p-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; min-height: 44px; }

/* ---------- list ---------- */
.p-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
.p-group { padding: 14px 18px 6px; font-size: 13px; font-weight: 700; color: var(--text-2); border-top: 1px solid var(--border); }
.p-group:first-child { border-top: 0; }

/* D-040: the count column fits its header, "Pcs/boxes" (about 70px in
   capitals), as the back office's does. */
.p-thead {
  display: grid; grid-template-columns: 64px minmax(0, 1.6fr) 1.1fr 76px 96px 132px;
  gap: 12px; align-items: center; padding: 10px 18px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted);
}
.p-row {
  display: grid; grid-template-columns: 64px minmax(0, 1.6fr) 1.1fr 76px 96px 132px;
  gap: 12px; align-items: center; padding: 12px 18px;
  border-bottom: 1px solid var(--border); text-decoration: none; color: inherit;
}
.p-row:last-child { border-bottom: 0; }
.p-row:hover { background: #F7F9FB; }
.p-row__thumb { width: 56px; height: 56px; border-radius: var(--r-thumb); object-fit: cover; background: var(--inset); flex: none; }
.p-row__ph { width: 56px; height: 56px; border-radius: var(--r-thumb); background: var(--inset); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.p-row__name { font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.p-row__meta { display: none; color: var(--text-2); font-size: 13px; }
.p-row__num { font-variant-numeric: tabular-nums; }
.p-row__chev { display: none; color: var(--muted); }

/* ---------- status + damage ---------- */
.p-status {
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px;
  border-radius: var(--r-chip); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.p-status--arrived { background: var(--status-awaiting-bg); color: var(--status-awaiting-text); }
.p-status--storage { background: var(--status-instock-bg); color: var(--status-instock-text); }
.p-status--out { background: var(--status-onlist-bg); color: var(--status-onlist-text); }
.p-status--delivered { background: var(--status-delivered-bg); color: var(--status-delivered-text); }
.p-dmg {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px;
  border-radius: var(--r-chip); background: var(--status-damage-bg); color: var(--status-damage-text);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}

/* ---------- footer / states ---------- */
.p-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; color: var(--text-2); font-size: 13px; }
.p-more {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--border-strong); border-radius: var(--r-control);
  background: var(--surface); color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.p-empty { padding: 56px 24px; text-align: center; }
.p-empty__art { color: var(--border-strong); margin-bottom: 12px; }
.p-empty__title { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.p-empty__body { color: var(--text-2); max-width: 460px; margin: 0 auto 16px; }

/* ---------- item detail ---------- */
.p-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration: none; }
.p-detail { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.p-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.p-gallery a { display: block; padding: 0; border: 0; background: none; cursor: pointer; position: relative; border-radius: var(--r-thumb); overflow: hidden; }
.p-gallery a:first-child { grid-column: span 2; grid-row: span 2; }
.p-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--inset); }
.p-gallery__dmg { position: absolute; left: 6px; bottom: 6px; background: var(--status-damage-text); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 4px; letter-spacing: 0.5px; }
.p-gallery__more { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; background: var(--inset); color: var(--text-2); font-weight: 800; }
.p-facts { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 18px; }
.p-facts h1 { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0 0 10px; letter-spacing: -0.2px; }
.p-facts__desc { margin: 0 0 12px; color: var(--text-2, #3f4752); line-height: 1.5; overflow-wrap: anywhere; }
.p-facts dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 16px 0 0; }
.p-facts dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.p-facts dd { margin: 0; font-weight: 600; color: var(--text); }
.p-note { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.p-damage { margin-top: 14px; padding: 12px 14px; background: var(--status-damage-bg); border-radius: var(--r-chip); color: var(--status-damage-text); font-size: 13px; }
/* D-042: a note from the warehouse — information, not a warning. */
.p-clientnote { margin-top: 14px; padding: 12px 14px; background: var(--inset); border-radius: var(--r-chip); font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.p-clientnote p { margin: 4px 0 0; }
.p-notemark { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }

/* ---------- lightbox ---------- */
.p-lb { position: fixed; inset: 0; z-index: 90; background: rgba(12, 14, 18, 0.94); display: flex; flex-direction: column; }
.p-lb[hidden] { display: none; }
.p-lb__bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; color: #E7EAEE; font-size: 13px; font-weight: 600; }
.p-lb__bar a, .p-lb__bar button { color: #E7EAEE; background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; min-width: 44px; text-decoration: none; }
.p-lb__stage { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 8px 24px; min-height: 0; }
.p-lb__stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.p-lb__nav { background: rgba(255,255,255,0.08); border: 0; color: #fff; width: 48px; height: 48px; border-radius: var(--r-pill); font-size: 22px; cursor: pointer; flex: none; }

/* ---------- login ---------- */
.p-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.p-auth__card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 28px; }
.p-auth__brand { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.p-auth__title { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0 0 18px; }
.p-field { margin-bottom: 14px; }
.p-field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.p-field input {
  width: 100%; min-height: 44px; padding: 0 12px; font: inherit; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-control); background: var(--surface);
}
.p-field__pw { position: relative; }
.p-field__pw input { padding-right: 64px; }
.p-show { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--accent); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; min-height: 44px; min-width: 44px; padding: 0 10px; }
.p-btn {
  width: 100%; min-height: 44px; border: 0; border-radius: var(--r-control);
  background: var(--accent); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.p-btn:hover { background: var(--accent-hover); }
.p-alert { background: var(--danger-soft); color: #8C2F24; border-radius: var(--r-chip); padding: 11px 13px; font-size: 13px; margin-bottom: 16px; }
.p-alert--ok { background: var(--status-instock-bg); color: var(--status-instock-text); }
.p-auth__aside { color: var(--text-2); font-size: 12.5px; margin-top: 14px; }

/* ---------- responsive: fluid to 390 (Phase 7 §90) ---------- */
@media (max-width: 900px) {
  .p-detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .p-wrap { padding: 18px 14px 56px; }
  .p-thead { display: none; }
  /* Card rows: photo · name+meta · status · chevron — no table chrome on phones */
  .p-row { grid-template-columns: 56px minmax(0, 1fr) auto 16px; gap: 12px; padding: 12px 14px; }
  .p-row__project, .p-row__qty, .p-row__received { display: none; }
  .p-row__meta { display: block; }
  .p-row__chev { display: inline; }
  /* Stack the status and the damage badge on a phone. Side by side they took
     some 250px of a 390px screen and left the item name a column narrow enough
     to break "Console table" letter by letter. */
  .p-row__status { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
  .p-gallery { grid-template-columns: repeat(3, 1fr); }
  .p-controls { gap: 8px; }
  .p-search { flex: 1 1 100%; max-width: none; }
  .p-tabs { flex: 1 1 auto; }
  .p-tabs a { flex: 1; justify-content: center; padding: 0 10px; }
}
@media (max-width: 480px) {
  /* Give the group toggle its own line rather than crowding the tab strip. */
  .p-tabs { flex: 1 1 100%; }
  .p-toggle { flex: 1 1 100%; }
}
@media (max-width: 420px) {
  .p-title { font-size: 21px; }
  .p-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .p-row__thumb, .p-row__ph { width: 44px; height: 44px; }
  .p-row__chev { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =========================================================================
   Application shell — the prototype's five-item sidebar.

   One set of markup for both layouts: above 900px it is a fixed rail, below
   it becomes a bottom bar. A second copy for mobile would be a second thing
   to keep in step, and the one that drifts is always the one nobody looks at.
   ========================================================================= */

.p-skip {
  position: absolute; left: -9999px; top: 0; z-index: 30;
  background: var(--surface); color: var(--accent); padding: 10px 16px;
  border: 1px solid var(--border-strong); border-radius: 0 0 var(--r-control) 0; font-weight: 700;
}
.p-skip:focus { left: 0; }

.p-app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }

.p-nav {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--border);
}
.p-nav__brand {
  font-size: 15px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.2px; padding: 4px 10px 14px;
}
.p-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.p-nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-control);
  color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14px;
}
.p-nav__item:hover { background: var(--inset); color: var(--ink); }
.p-nav__item.is-active { background: var(--accent-soft); color: var(--accent); }
.p-nav__icon { width: 20px; height: 20px; flex: none; }

.p-nav__foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.p-nav__client { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 0 4px; }
.p-nav__avatar {
  width: 30px; height: 30px; flex: none; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
}
.p-nav__name {
  font-size: 13px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.p-nav__signout {
  display: block; padding: 8px 10px; border-radius: var(--r-control);
  color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 600;
}
.p-nav__signout:hover { background: var(--inset); color: var(--ink); }

.p-main { max-width: 1180px; width: 100%; padding: 28px 28px 64px; }

.p-pagehead { margin-bottom: 22px; }
.p-pagehead__title { font-size: 26px; font-weight: 800; color: var(--ink); margin: 0; letter-spacing: -0.3px; }
.p-pagehead__lede { color: var(--text-2); margin: 6px 0 0; max-width: 56ch; }

/* ---------- dashboard ---------- */

.p-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.p-stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: 16px 18px; display: grid; gap: 2px;
}
.p-stat--warn { background: var(--status-awaiting-bg); border-color: #E2D3B2; }
.p-stat__label { font-size: 12px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }
.p-stat--warn .p-stat__label { color: var(--status-awaiting-text); }
.p-stat__value { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1.15; font-variant-numeric: tabular-nums; }
.p-stat--warn .p-stat__value { color: var(--status-awaiting-text); }
.p-stat__sub { font-size: 12.5px; color: var(--text-2); }

.p-card + .p-card, .p-stats + .p-card { margin-top: 18px; }
.p-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.p-card__title { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0; }
.p-card__action { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.p-card__action:hover { text-decoration: underline; }

.p-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; padding: 16px 18px 18px; }
.p-tile {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; background: var(--surface);
}
.p-tile:hover { border-color: var(--border-strong); }
.p-tile__img { width: 100%; height: 132px; object-fit: cover; display: block; background: var(--inset); }
.p-tile__ph {
  height: 132px; display: grid; place-items: center;
  background: var(--inset); color: var(--muted); font-size: 26px;
}
.p-tile__body { padding: 11px 12px 13px; display: grid; gap: 5px; }
.p-tile__name { font-weight: 700; color: var(--ink); font-size: 13.5px; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.p-tile__meta { font-size: 12.5px; color: var(--text-2); }
.p-tile__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }

.p-list { list-style: none; margin: 0; padding: 0; }
.p-list__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; gap: 12px; align-items: center;
  padding: 14px 18px; border-top: 1px solid var(--border); text-decoration: none; color: inherit;
}
.p-list li:first-child .p-list__row { border-top: 0; }
.p-list__row:hover { background: var(--inset); }
.p-list__name { font-weight: 600; color: var(--ink); }
.p-list__meta { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- account ---------- */

.p-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; padding: 18px; }
.p-kv dt { font-size: 12px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }
.p-kv dd { margin: 4px 0 0; color: var(--ink); font-weight: 600; }
.p-contact { padding: 18px; }
.p-contact__line { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.p-contact__line a { color: var(--accent); text-decoration: none; }
.p-contact__line a:hover { text-decoration: underline; }
.p-btn--quiet {
  width: auto; display: inline-flex; align-items: center; padding: 0 18px;
  background: var(--surface); color: var(--accent); border: 1px solid var(--border-strong);
  text-decoration: none;
}
.p-btn--quiet:hover { background: var(--inset); }

/* ---------- exports ---------- */

.p-exports { display: inline-flex; gap: 8px; margin-left: auto; }
.p-export {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 13px;
  border: 1px solid var(--border-strong); border-radius: var(--r-control);
  background: var(--surface); color: var(--accent);
  font-size: 13px; font-weight: 700; text-decoration: none;
}
.p-export:hover { background: var(--inset); }
.p-foot__note { font-size: 12.5px; color: var(--text-2); max-width: 46ch; text-align: right; }

/* ---------- the shell, narrow ---------- */

@media (max-width: 900px) {
  .p-app { grid-template-columns: minmax(0, 1fr); }
  .p-main { padding: 20px 16px 96px; }

  /* The same nav element, pinned to the bottom. Five targets, so they fit. */
  .p-nav {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    height: auto; flex-direction: row; align-items: center; gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--border);
    box-shadow: 0 -1px 4px rgba(20, 23, 28, 0.06); z-index: 20;
  }
  .p-nav__brand, .p-nav__name, .p-nav__signout { display: none; }
  .p-nav__list { flex-direction: row; flex: 1; justify-content: space-around; }
  .p-nav__item {
    flex-direction: column; gap: 3px; padding: 6px 4px; min-width: 60px;
    font-size: 11px; font-weight: 700; text-align: center;
  }
  .p-nav__foot { margin: 0; padding: 0 6px 0 2px; border-top: 0; }

  .p-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .p-stat { padding: 12px 11px; }
  .p-stat__value { font-size: 23px; }
  .p-stat__label { font-size: 10.5px; letter-spacing: 0.2px; }
  .p-kv { grid-template-columns: minmax(0, 1fr); }
  .p-exports { margin-left: 0; }
  .p-foot__note { text-align: left; }
}

@media (max-width: 420px) {
  .p-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
  .p-tile__img, .p-tile__ph { height: 104px; }
}

/* Sign-out is hidden from the rail on a phone, so the Account page carries a
   real one. Nothing lives only in the sidebar. */

/* ---------- windows of 200: the pager ---------- */

.p-pager {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 18px 16px; border-top: 1px solid var(--border);
}
.p-pager__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.p-pager__list a, .p-pager__here, .p-pager__step {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 11px;
  border-radius: var(--r-control); font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums; text-decoration: none;
}
.p-pager__list a, .p-pager__step { border: 1px solid var(--border-strong); color: var(--accent); background: var(--surface); }
.p-pager__list a:hover, .p-pager__step:hover { background: var(--inset); }
.p-pager__here { background: var(--accent); color: #fff; border: 1px solid var(--accent); }

/* ---------- exports: the count on the button, the cap beside it ---------- */

.p-export__n { font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.p-capnote {
  margin: -6px 0 14px; padding: 10px 13px; border-radius: var(--r-chip);
  background: var(--status-awaiting-bg); color: var(--status-awaiting-text); font-size: 13px;
}

@media (max-width: 900px) {
  .p-pager { padding: 12px 12px 14px; }
}

/* Outside production only (WHS_Portal_App::head()): the data here is invented. */
.p-demo-banner {
  background: var(--accent); color: #fff;
  font-size: 13px; line-height: 1.4; padding: 6px 16px; text-align: center;
}
