/* Profile v3 — layout corrections. Loaded last. */

/* headers must never squeeze their action into two lines */
.profile-page.pv3 .pv3-head{flex-wrap:wrap;row-gap:8px;align-items:center}
.profile-page.pv3 .pv3-link{white-space:nowrap;flex:0 0 auto}
.profile-page.pv3 .pv3-head>div{min-width:0}

/* hero: button always inside the card, wraps under on narrow cards */
.profile-page.pv3 .pv3-hero{flex-wrap:wrap;row-gap:12px}
.profile-page.pv3 .pv3-edit{max-width:100%;margin-left:auto;white-space:nowrap}

/* order rows: same three-zone grid at every width, total/status on their own line */
.profile-page.pv3 .pv3-order{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  grid-template-areas:"t b v" "e e e";
  align-items:center;gap:8px 10px;
}
.profile-page.pv3 .pv3-order-thumbs{grid-area:t}
.profile-page.pv3 .pv3-order-body{grid-area:b;min-width:0}
.profile-page.pv3 .pv3-order-view{grid-area:v}
.profile-page.pv3 .pv3-order-end{
  grid-area:e;display:flex;flex-direction:row;align-items:center;justify-content:space-between;
  width:100%;gap:8px;padding-top:8px;border-top:1px solid var(--pv3-line);
}
.profile-page.pv3 .pv3-order-id{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profile-page.pv3 .pv3-order-meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profile-page.pv3 .pv3-status{white-space:nowrap}

/* more tiles: never break words */
.profile-page.pv3 .pv3-tile b{white-space:normal;line-height:1.2}
.profile-page.pv3 .pv3-tile small{white-space:normal;line-height:1.25}

/* column plan: 1 → 2 → 3 only when there is genuinely room */
@media (min-width:900px) and (max-width:1399px){
  .profile-page.pv3{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .profile-page.pv3 .pv3-hero,
  .profile-page.pv3 .pv3-stats{grid-column:1 / -1}
}
@media (min-width:1400px){
  .profile-page.pv3{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .profile-page.pv3 .pv3-hero,
  .profile-page.pv3 .pv3-stats{grid-column:1 / -1}
  .profile-page.pv3 .pv3-tiles{grid-template-columns:repeat(4,minmax(0,1fr))}
}

/* stat tiles stay 4-up only when wide enough */
@media (min-width:900px) and (max-width:1099px){
  .profile-page.pv3 .pv3-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* panels size to their content instead of stretching to the row height */
.profile-page.pv3{align-items:start}
.profile-page.pv3 .pv3-panel{height:auto}
.profile-page.pv3 .pv3-rail{padding-bottom:2px}

/* ── order rows: one compact block, total + status under the meta ── */
.profile-page.pv3 .pv3-order{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr) auto!important;
  grid-template-areas:"t b v"!important;
  align-items:center!important;gap:10px!important;
  padding:11px 12px!important;
}
.profile-page.pv3 .pv3-order-body{grid-area:b;display:flex;flex-direction:column;gap:3px;min-width:0}
.profile-page.pv3 .pv3-order-view{grid-area:v;align-self:center;width:32px;height:32px;flex:0 0 auto}
.profile-page.pv3 .pv3-order-foot{
  display:flex;align-items:center;gap:8px;margin-top:3px;padding:0;border:0;width:auto;
}
.profile-page.pv3 .pv3-order-foot strong{font-size:14.5px;font-weight:800;color:#17301f}
.profile-page.pv3 .pv3-status{font-size:9.5px;padding:3px 8px}

/* ── Edit details: calm pill, always inside the hero ── */
.profile-page.pv3 .pv3-edit{
  height:40px!important;padding:0 15px!important;font-size:12px!important;
  background:#fffdf8!important;color:#1d5a37!important;
  border:1.5px solid rgb(29 90 55 / 28%)!important;
  box-shadow:0 6px 14px rgb(31 58 43 / 10%)!important;
  gap:6px!important;
}
.profile-page.pv3 .pv3-edit:hover{background:#f4faf3!important;border-color:rgb(29 90 55 / 45%)!important;transform:translateY(-1px)}
.profile-page.pv3 .pv3-hero{padding-right:18px!important}

/* ── More tiles: never four thin columns in a narrow panel ── */
@media (max-width:1399px){
  .profile-page.pv3 .pv3-tiles{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
.profile-page.pv3 .pv3-tile{min-height:88px;padding:12px 12px 13px}
.profile-page.pv3 .pv3-tile b{font-size:12.5px}
.profile-page.pv3 .pv3-tile small{font-size:10px;line-height:1.3}
.profile-page.pv3 .pv3-more{padding-bottom:16px}
.profile-page.pv3 .pv3-danger{margin-top:14px}
