/* O Jailbreaks — [O]Market's pages for everyone (site v54): 🧾 My purchases (purchases/, purchases.js) and 📜 the
   [O]Market terms (terms/). Builds on styles.css and members.css, with theme.css loaded after (the look). Classes start
   pu- (purchases) and tm- (terms). Status colours: amber waiting on someone, blue paid, sky delivered, red a problem,
   green done, violet refunded, grey closed. */

.pu { max-width: 980px; }

/* (v57) 💳 Paying from here */
.pu-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.pu-pay .pp-mbtn { min-height: 44px; }
.pu-pay-note { flex: 1 1 100%; margin: 2px 0 0; font-size: 13px; color: var(--dim); }

/* ---------- The list ---------- */
.pu-list { display: grid; gap: 12px; }
.pu-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.pu-h2 { margin: 0; font: 600 18px/1.3 var(--font); letter-spacing: -.02em; text-transform: none; color: var(--text); }
.pu-h3 { display: flex; align-items: center; gap: 9px; margin: 0; font: 600 16px/1.3 var(--font); letter-spacing: -.01em; color: var(--text); }
.pu-h3 .ico { font-size: 17px; color: var(--muted); }
.pu-count { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pu-rows { display: grid; gap: 8px; }
.pu-rows > li { animation: mb-row .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.pu-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto 18px; align-items: center; gap: 16px;
  padding: 13px 14px 13px 14px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .08); color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012) 70%), #090909;
  transition: border-color .2s, transform .25s var(--ease), box-shadow .25s;
}
.pu-row:hover { border-color: rgba(255, 255, 255, .2); transform: translateY(-1px); box-shadow: 0 14px 30px -20px rgba(0, 0, 0, .9); }
.pu-row:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }
.pu-row.is-loading { height: 68px; border-color: var(--line); background: rgba(255, 255, 255, .025); animation: pu-pulse 1.1s ease-in-out infinite alternate; }
@keyframes pu-pulse { from { opacity: .45; } to { opacity: 1; } }
.pu-num {
  display: inline-flex; align-items: center; height: 26px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .04); font: 500 12.5px/1 var(--mono); letter-spacing: .02em; color: var(--text-2); white-space: nowrap;
}
.pu-main { display: grid; gap: 5px; min-width: 0; }
.pu-main b { overflow: hidden; font: 600 15.5px/1.3 var(--font); letter-spacing: -.01em; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.pu-main small { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 7px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.pu-main small i { font-style: normal; color: var(--dim); }
.pu-price { font: 600 15px var(--font); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.pu-go { display: grid; place-items: center; font-size: 16px; color: var(--dim); transition: color .2s, transform .25s var(--ease); }
.pu-row:hover .pu-go { color: var(--text); transform: translateX(2px); }

/* Where an order stands */
.pu-pill {
  --c: 163, 163, 163; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  border: 1px solid rgba(var(--c), .32); background: rgba(var(--c), .09); color: rgb(var(--c)); font: 500 12px/1 var(--font); white-space: nowrap;
}
.pu-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pu-pill.is-unpaid { --c: 252, 211, 77; }
.pu-pill.is-paid { --c: 147, 197, 253; }
.pu-pill.is-delivered { --c: 125, 211, 252; }
.pu-pill.is-problem { --c: 252, 165, 165; }
.pu-pill.is-complete { --c: 134, 239, 172; }
.pu-pill.is-refunded { --c: 216, 180, 254; }
.pu-pill.is-closed { --c: 163, 163, 163; }

/* Nothing bought yet */
.pu-empty {
  display: grid; justify-items: center; gap: 10px; padding: 44px 24px; border-radius: 16px; border: 1px dashed var(--line-2);
  background: rgba(255, 255, 255, .015); text-align: center;
}
.pu-empty-ico { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 4px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 23px; color: var(--text-2); }
.pu-empty h3 { margin: 0; font: 600 18px/1.3 var(--font); color: var(--text); }
.pu-empty p { max-width: 48ch; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.pu-empty .pp-mbtn { margin-top: 6px; }

/* ---------- One purchase ---------- */
.pu-one { display: grid; gap: 14px; }
.pu-back {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; height: 34px; margin-left: -8px; padding: 0 12px 0 8px;
  border-radius: 10px; font: 500 14px var(--font); color: var(--text-2); transition: background .15s, color .15s;
}
.pu-back .ico { font-size: 16px; }
.pu-back:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.pu-sum { display: grid; gap: 16px; min-width: 0; overflow-wrap: anywhere; }
.pu-sum-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.pu-sum-main { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; }
.pu-sum-text { flex: 1 1 260px; min-width: 0; }
.pu-item { margin: 0; font: 600 clamp(24px, 3.2vw, 32px)/1.15 var(--font); letter-spacing: -.03em; text-transform: none; color: var(--text); overflow-wrap: anywhere; }
.pu-shop { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 14.5px; color: var(--text-2); }
.pu-shop .ico { font-size: 16px; color: var(--muted); }
.pu-big { font: 600 clamp(24px, 3vw, 30px)/1 var(--font); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.pu-means { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.pu-outcome { font-size: 14px; line-height: 1.55; color: var(--muted); }
.pu-refund, .pu-problem { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 14.5px; line-height: 1.55; }
.pu-refund { border: 1px solid rgba(216, 180, 254, .3); background: rgba(168, 85, 247, .08); color: #e9d5ff; }
.pu-problem { border: 1px solid rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .07); color: #fecaca; }
.pu-refund .ico, .pu-problem .ico { flex-shrink: 0; margin-top: 2px; font-size: 17px; }
.pu-problem div { display: grid; gap: 4px; min-width: 0; }
.pu-problem p { color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.pu-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 1px; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: var(--line); }
.pu-facts > div { display: grid; align-content: start; gap: 4px; padding: 12px 14px; background: #0b0b0b; }
.pu-facts dt { font-size: 12.5px; color: var(--muted); }
.pu-facts dd { margin: 0; font: 500 14.5px/1.4 var(--font); color: var(--text); }
.pu-wait { display: grid; gap: 12px; }
.pu-wait span { height: 16px; border-radius: 8px; background: rgba(255, 255, 255, .06); animation: pu-pulse 1.1s ease-in-out infinite alternate; }
.pu-wait span:nth-child(1) { width: 30%; }
.pu-wait span:nth-child(2) { width: 62%; height: 30px; }
.pu-wait span:nth-child(3) { width: 84%; }

.pu-cols { display: grid; grid-template-columns: minmax(0, 290px) minmax(0, 1fr); align-items: start; gap: 14px; }
.pu-box { display: grid; align-content: start; gap: 16px; min-width: 0; }

/* How it went */
.pu-time { display: grid; }
.pu-step { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; padding-bottom: 18px; }
.pu-step:last-child { padding-bottom: 0; }
.pu-step:not(:last-child)::before { content: ''; position: absolute; left: 12.5px; top: 30px; bottom: 4px; width: 1px; background: var(--line-2); }
.pu-step.is-done:not(:last-child)::before { background: rgba(34, 197, 94, .35); }
.pu-dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px dashed var(--line-3); background: #0b0b0b; font-size: 13px; }
.pu-dot .ico { stroke-width: 2.4; }
.pu-step.is-done .pu-dot { border: 1px solid rgba(34, 197, 94, .5); background: rgba(34, 197, 94, .12); color: var(--green); }
.pu-step.is-warn .pu-dot { border-color: rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .12); color: #fca5a5; }
.pu-step.is-refund .pu-dot { border-color: rgba(216, 180, 254, .5); background: rgba(168, 85, 247, .12); color: #d8b4fe; }
.pu-step-text { display: grid; gap: 2px; padding-top: 3px; min-width: 0; }
.pu-step-text b { font: 500 14.5px/1.35 var(--font); color: var(--text); }
.pu-step:not(.is-done) .pu-step-text b { color: var(--muted); }
.pu-step-text small { font-size: 13px; line-height: 1.45; color: var(--muted); }

/* The order chat */
.pu-chat-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.pu-files-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); font-size: 13px; line-height: 1.5; color: var(--muted); }
.pu-files-note .ico { flex-shrink: 0; margin-top: 2px; font-size: 14px; }
.pu-open-chat { display: grid; justify-items: start; gap: 12px; padding: 16px; border-radius: 12px; border: 1px dashed var(--line-2); font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.pu-msgs { display: grid; align-content: start; min-width: 0; }
.pu-none { padding: 18px; border-radius: 12px; border: 1px dashed var(--line-2); text-align: center; font-size: 14px; color: var(--muted); }
.pu-day { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pu-day:first-child { margin-top: 0; }
.pu-day::before, .pu-day::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.pu-msg { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; gap: 10px; margin-top: 12px; }
.pu-msg.is-cont { margin-top: 4px; }
.pu-av {
  grid-column: 1; grid-row: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line-2); background: #181818; font: 600 13px/1 var(--font); color: var(--text-2);
}
.pu-bubble {
  grid-column: 2; grid-row: 1; justify-self: start; min-width: 0; max-width: min(100%, 580px); padding: 9px 13px 10px;
  border-radius: 4px 14px 14px 14px; border: 1px solid var(--line); background: #0f0f0f;
}
.pu-msg.is-cont .pu-bubble { border-radius: 14px; }
.pu-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 4px; font-size: 13px; line-height: 1.3; }
.pu-who b { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.pu-role { --c: 163, 163, 163; padding: 3px 6px; border-radius: 5px; border: 1px solid rgba(var(--c), .35); background: rgba(var(--c), .08); font: 500 10.5px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; color: rgb(var(--c)); }
.pu-who time { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.pu-text { font-size: 14.5px; line-height: 1.55; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.pu-text b { font-weight: 600; color: var(--text); }
.pu-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pu-files li { min-width: 0; max-width: 100%; }
.pu-files a, .pu-file-gone {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 32px; padding: 0 11px 0 9px; border-radius: 9px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .035); font-size: 13px; color: var(--text); transition: border-color .15s, background .15s;
}
.pu-files a:hover { border-color: var(--line-3); background: rgba(255, 255, 255, .07); }
.pu-files .ico { flex-shrink: 0; font-size: 14px; color: var(--muted); }
.pu-files span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pu-file-gone { color: var(--muted); }
/* Who's who: you (the buyer) on the right in blue, the seller in green, olliE in amber, the bot quieter */
.pu-msg.is-buyer { grid-template-columns: minmax(0, 1fr) 32px; }
.pu-msg.is-buyer .pu-av { grid-column: 2; border-color: rgba(59, 130, 246, .45); background: rgba(59, 130, 246, .16); color: #bfdbfe; }
.pu-msg.is-buyer .pu-bubble { grid-column: 1; justify-self: end; border-radius: 14px 4px 14px 14px; border-color: rgba(59, 130, 246, .3); background: rgba(59, 130, 246, .1); }
.pu-msg.is-buyer.is-cont .pu-bubble { border-radius: 14px; }
.pu-msg.is-buyer .pu-who { justify-content: flex-end; }
.pu-msg.is-buyer .pu-role { --c: 147, 197, 253; }
.pu-msg.is-seller .pu-av { border-color: rgba(34, 197, 94, .4); background: rgba(34, 197, 94, .12); color: #bbf7d0; }
.pu-msg.is-seller .pu-role { --c: 134, 239, 172; }
.pu-msg.is-olliE .pu-av { border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .12); color: #fde68a; }
.pu-msg.is-olliE .pu-bubble { border-color: rgba(245, 158, 11, .25); }
.pu-msg.is-olliE .pu-role { --c: 252, 211, 77; text-transform: none; letter-spacing: 0; font-size: 11px; }
.pu-msg.is-staff .pu-role { --c: 216, 180, 254; }
.pu-msg.is-bot .pu-av { border-style: dashed; background: #111; font-size: 15px; color: var(--muted); }
.pu-msg.is-bot .pu-bubble { border-style: dashed; background: rgba(255, 255, 255, .02); }
.pu-msg.is-bot .pu-text { font-size: 14px; color: var(--muted); }

/* (v58) An open order on its page: its buttons, a question about more time, writing to the seller */
.pu-acts { display: grid; gap: 10px; margin-top: 14px; padding: 14px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(255, 255, 255, .02); }
.pu-acts-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pu-acts-row .pp-mbtn { min-height: 44px; height: auto; white-space: normal; text-align: left; }
.pu-acts .pp-mbtn[disabled], .pu-send .pp-mbtn[disabled] { opacity: .55; cursor: progress; }
.pu-acts .is-sure { background: var(--red) !important; border-color: var(--red) !important; color: #fff !important; }
.pu-acts-note { margin: 0; font-size: 13px; color: var(--dim); }
.pu-more { display: grid; gap: 8px; padding: 12px; border-radius: 10px; border: 1px solid rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .06); }
.pu-more p { margin: 0; font-size: 14px; color: var(--text-2); }
.pu-more-why { padding-left: 10px; border-left: 3px solid rgba(245, 158, 11, .5); color: var(--muted) !important; white-space: pre-wrap; overflow-wrap: anywhere; }
.pu-problem-form { display: grid; gap: 8px; }
.pu-problem-form label { font-size: 13.5px; color: var(--text-2); }
.pu-problem-form textarea, .pu-send textarea {
  width: 100%; min-height: 70px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface);
  font: 400 15px/1.5 var(--font); color: var(--text); resize: vertical;
}
.pu-problem-form textarea:focus, .pu-send textarea:focus { outline: none; border-color: var(--line-3); }
.pu-send { display: flex; align-items: flex-end; gap: 8px; margin-top: 14px; }
.pu-send textarea { flex: 1 1 auto; min-height: 46px; max-height: 220px; }
.pu-send .pp-mbtn { min-height: 46px; flex: none; }
.pu-send-note { margin: 6px 0 0; font-size: 12.5px; color: var(--dim); }
@media (max-width: 480px) { .pu-send { flex-direction: column; align-items: stretch; } }

/* Paying safely */
.pu-safe {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 22px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid rgba(59, 130, 246, .25); background: linear-gradient(180deg, rgba(59, 130, 246, .08), rgba(59, 130, 246, .02));
  font-size: 14px; line-height: 1.55; color: var(--text-2);
}
.pu-safe p { flex: 1 1 320px; min-width: 0; }
.pu-safe b { font-weight: 600; color: var(--text); }
.pu-safe a { font-weight: 500; color: var(--text); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px; white-space: nowrap; }
.pu-safe a:hover { text-decoration-color: currentColor; }
.pu-safe-ico, .tm-callout-ico { flex-shrink: 0; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(59, 130, 246, .35); background: rgba(59, 130, 246, .12); font-size: 17px; color: #bfdbfe; }

@media (min-width: 861px) { /* (the summary of how it went stays in view beside a long chat) */
  .pu-cols > .pu-box:first-child { position: sticky; top: calc(var(--header-h) + 16px); }
}
@media (max-width: 860px) {
  .pu-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .pu-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "num pill" "main main" "price go"; gap: 8px 10px; padding: 12px 12px 12px 14px; }
  .pu-row .pu-num { grid-area: num; justify-self: start; }
  .pu-row .pu-pill { grid-area: pill; justify-self: end; }
  .pu-row .pu-main { grid-area: main; }
  .pu-row .pu-main b { white-space: normal; }
  .pu-row .pu-price { grid-area: price; }
  .pu-row .pu-go { grid-area: go; justify-self: end; }
  .pu-row.is-loading { height: 108px; }
  .pu-msg { grid-template-columns: 28px minmax(0, 1fr); gap: 8px; }
  .pu-msg.is-buyer { grid-template-columns: minmax(0, 1fr) 28px; }
  .pu-av { width: 28px; height: 28px; font-size: 12px; }
  .pu-bubble { padding: 8px 11px 9px; }
  .pu-text { font-size: 14px; }
  .pu-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .pu-rows > li, .pu-row.is-loading, .pu-wait span { animation: none; } .pu-row:hover { transform: none; } }
/* (v62) 💬 Message seller: under a paid, open order in the list (straight to writing to the seller), and a heading over
   the box to write in on the order's page. */
.pu-rows > li.pu-has-talk { display: grid; gap: 6px; }
.pu-talk { justify-self: end; height: 36px; padding: 0 14px; font-size: 13.5px; }
.pu-reply-head { display: grid; gap: 3px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.pu-reply-head[hidden] { display: none; }
.pu-h4 { margin: 0; font: 600 15px/1.3 var(--font); letter-spacing: -.01em; color: var(--text); }
.pu-reply-head p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.pu-reply-head + .pu-send { margin-top: 10px; }
@media (max-width: 640px) { .pu-talk { justify-self: stretch; justify-content: center; } }

/* ---------- The terms ---------- */
.tm-version { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tm-badge { padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(59, 130, 246, .35); background: rgba(59, 130, 246, .1); font: 500 12px/1 var(--font); color: #bfdbfe; }
.lg .tm-rules { display: grid; gap: 8px; padding: 0; list-style: none; counter-reset: rule; }
.lg .tm-rules li { position: relative; max-width: none; padding: 12px 16px 12px 54px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); counter-increment: rule; color: var(--text-2); }
.lg .tm-rules li::before {
  content: counter(rule); left: 14px; top: 10px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface-3) !important; box-shadow: none !important; font: 600 12.5px/1 var(--mono); color: var(--text);
}
.lg .tm-breach { gap: 0; padding: 4px 16px; border-radius: 12px; border: 1px solid rgba(245, 158, 11, .3); background: rgba(245, 158, 11, .06); }
.lg .tm-breach li { max-width: none; padding: 10px 0 10px 22px; color: var(--text-2); }
.lg .tm-breach li + li { border-top: 1px solid rgba(245, 158, 11, .15); }
.lg .tm-breach li::before { top: calc(10px + .72em); background: var(--amber) !important; }
.tm-callout {
  display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-radius: 14px;
  border: 1px solid rgba(59, 130, 246, .3); background: linear-gradient(180deg, rgba(59, 130, 246, .1), rgba(59, 130, 246, .03));
}
.tm-callout p { max-width: none; color: var(--text-2); }
.tm-callout b { color: var(--text); }
@media (max-width: 640px) {
  .lg .tm-rules li { padding: 11px 14px 11px 50px; }
  .lg .tm-rules li::before { left: 12px; }
  .tm-callout { padding: 14px; gap: 12px; }
}

/* (v65) ➕ Something else from the same shop, in this chat */
.pu-add-form select { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: #0b0b0b; color: var(--text); font: 400 15px var(--font); }
.pu-others { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13.5px; color: var(--muted); }
.pu-others a { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); }
.pu-others a:hover { border-color: var(--line-3); color: #fff; }
