/* ==========================================================================
   simulated-marketplace — eBay-style theme (placeholder brand "MarketPlace").
   Desktop-first; a card-based marketplace look. No build step — plain CSS.
   ========================================================================== */
:root {
  --blue: #3665f3;          /* primary action / links */
  --blue-d: #2a4fc4;
  --red: #e53238;
  --yellow: #f5af02;
  --green: #119400;
  --ink: #111820;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --bg: #ffffff;
  --bg-soft: #f7f7f7;
  --shadow: 0 1px 3px rgba(0,0,0,.12);
  --radius: 8px;
  --maxw: 1240px;
  --font: Arial, "Helvetica Neue", Helvetica, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }

/* ---- Top bar ------------------------------------------------------------ */
.mp-header { border-bottom: 1px solid var(--line); background: #fff; }
.mp-header-top {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 18px;
}
.mp-logo { font-size: 28px; font-weight: 800; letter-spacing: -.5px; flex: 0 0 auto; }
.mp-logo:hover { text-decoration: none; }
.mp-logo-m { color: var(--blue); }
.mp-logo-p { color: var(--red); }
.mp-search { flex: 1 1 auto; display: flex; align-items: stretch; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fff; }
.mp-search-cat { border: 0; border-right: 1px solid var(--line); background: #fff; padding: 0 12px; font-size: 13px; color: var(--muted); outline: none; }
.mp-search-in { flex: 1 1 auto; border: 0; padding: 10px 16px; font-size: 15px; outline: none; }
.mp-search-btn { border: 0; background: var(--blue); color: #fff; font-weight: 700; padding: 0 28px; cursor: pointer; font-size: 15px; }
.mp-search-btn:hover { background: var(--blue-d); }
.mp-account { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; flex: 0 0 auto; }
.mp-cart { font-size: 18px; }

.mp-cats {
  max-width: var(--maxw); margin: 0 auto; padding: 6px 16px 12px;
  display: flex; gap: 20px; font-size: 13.5px; flex-wrap: wrap;
}
.mp-cat-link { color: var(--ink); cursor: pointer; white-space: nowrap; padding-bottom: 2px; }
.mp-cat-link:hover { color: var(--blue); text-decoration: none; }
.mp-cat-link.is-active { font-weight: 700; border-bottom: 2px solid var(--ink); }
.mp-cat-link.is-disabled { color: var(--line-2); cursor: default; }

/* ---- "You are selling" bar + nudge -------------------------------------- */
.mp-sellbar { background: #fffbe6; border-bottom: 1px solid var(--yellow); }
.mp-sellbar-in {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px;
}
.mp-sellbar-img { width: 44px; height: 44px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; flex: 0 0 auto; }
.mp-sellbar-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mp-sellbar-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mp-sellbar-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.btn-list { margin-left: auto; background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: 10px 22px; font-weight: 700; cursor: pointer; flex: 0 0 auto; }
.btn-list:hover { background: var(--blue-d); }

.mp-nudge {
  max-width: var(--maxw); margin: 12px auto 0; padding: 12px 16px;
  background: #eef3ff; border: 1px solid #c7d7ff; border-radius: var(--radius);
  color: #21429b; font-size: 14px;
}
.mp-nudge b { font-weight: 700; }

/* ---- Main column -------------------------------------------------------- */
.mp-main { flex: 1 0 auto; max-width: var(--maxw); margin: 0 auto; width: 100%; padding: 18px 16px 48px; outline: none; }

/* ---- Centered "flow" screens (consent / instructions / questions) ------- */
.flow { max-width: 720px; margin: 24px auto; }
.flow-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; }
.flow .eyebrow { text-transform: uppercase; letter-spacing: .05em; font-size: 12px; color: var(--blue); font-weight: 700; }
.flow h1 { font-size: 26px; margin: 6px 0 14px; }
.flow p { color: #25303b; }
.flow .lead { font-size: 16px; }
.consent-sec { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.consent-sec h3 { margin: 0 0 4px; font-size: 15px; }
.consent-sec p { margin: 0; color: #3a4654; font-size: 14px; }
.agreement { background: var(--bg-soft); border-radius: 6px; padding: 12px 14px; margin: 18px 0; font-size: 14px; }

.options { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 4px; }
.option { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line-2); border-radius: 8px; padding: 12px 14px; cursor: pointer; }
.option:hover { border-color: var(--blue); background: #fafbff; }
.option input { margin-top: 2px; }

/* ---- Wide flow screens: consent, instructions, comprehension (RA 2026-10-14)
   The 720px column above made these 1,140 / 1,450 / 1,920px tall at 100% zoom —
   two to three screens of scrolling on a laptop — and zoomed out, the text got
   too small to read. On a desktop they now spend the width instead: text flows in
   columns, blocks sit side by side, and the instruction text follows the window
   height within a readable 14–15.5px. Narrow screens: see the end of the file. */
.flow-wide { max-width: 1240px; margin: 8px auto; }
.flow-wide .flow-card { padding: 22px 28px; }
.flow-wide h1 { font-size: 24px; margin: 4px 0 12px; }
.flow-consent { max-width: 1080px; }

/* Instructions: the text in two columns, the item + cost + Continue beside it,
   sticky, so the way forward is on screen from the first second. */
.instr-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(230px, 21vw, 290px); gap: 28px; align-items: start; }
.instr-text { columns: 2 300px; column-gap: 40px; font-size: clamp(13.5px, calc(5.5px + 1.2vh), 15px); line-height: 1.7; color: #36424f; }
/* Whole paragraphs per column: a sentence split across the columns was hard to
   follow (walkthrough 2026-10-14). */
.instr-text p { margin: 0 0 12px; break-inside: avoid; }
.instr-side { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 12px; }
.instr-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: #fff; }
.instr-img { display: block; width: 100%; max-height: 200px; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 6px; margin: 0 0 10px; }
.instr-item-title { font-weight: 700; font-size: 15px; line-height: 1.3; margin: 4px 0 6px; }
.instr-item .meta-row { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.instr-side .cost-box { margin: 0; }
.instr-continue { width: 100%; }
/* "Key parts" (RA 2026-10-14): bold, underlined and half a size larger than the
   body text, so the body reads as the quieter layer. Black, not blue: blue and
   underlined is what a link looks like, and these are not clickable (RA, same day). */
.instr-text b, .review-body b { color: var(--ink); }
.instr-text u, .review-body u {
  color: var(--ink); font-size: 1.07em;
  text-decoration-line: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}

/* Consent: the four sections two by two, the two choices side by side. */
.consent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); column-gap: 34px; }
.consent-grid .consent-sec { margin-top: 12px; padding-top: 12px; }
.flow-wide .agreement { margin: 16px 0 12px; }
.consent-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Comprehension: the questions side by side; the re-read block in columns too. */
.q-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px 26px; align-items: start; }
.q-grid .q-prompt { margin-bottom: 6px; }
.q-grid .question { margin: 0; }
.q-grid .options { gap: 6px; margin: 6px 0 0; }
.q-grid .option { padding: 5px 12px; font-size: 14px; line-height: 1.35; align-items: center; }
.q-grid .option input { margin-top: 0; }
.q-submit { align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
/* Aligned rows (RA 2026-10-14): each question spans five shared rows (prompt + four
   options), so prompts, and each option, line up across the columns even when a
   prompt or an option wraps. Browsers without subgrid keep the plain grid above. */
@supports (grid-template-rows: subgrid) {
  .q-grid { row-gap: 5px; }
  .q-grid .question { display: grid; grid-row: span 5; grid-template-rows: subgrid; margin: 0 0 12px; }
  .q-grid .question .q-prompt { margin: 0; align-self: end; }
  .q-grid .question .options { display: grid; grid-row: span 4; grid-template-rows: subgrid; margin: 0; }
  .q-grid .q-submit { grid-row: span 5; margin-bottom: 12px; }
}
.q-submit .nav-row { margin-top: 0; }
.flow-comp h1 { margin-bottom: 8px; }
.flow-comp .lead { margin: 0 0 10px; font-size: 15px; }
.flow-comp .review-toggle { padding: 10px 14px; }
.flow-comp .review-block { margin: 0 0 4px; }
.flow-comp .review-body { columns: 3 280px; column-gap: 30px; }
.flow-comp .review-body p { margin: 8px 0 12px; break-inside: avoid; line-height: 1.65; color: #36424f; }
.flow-comp .review-hint { padding: 0 2px; margin: 0 0 8px; }
@media (min-width: 901px) {
  .flow-comp .review-wrap { position: relative; margin-bottom: 14px; }
  .flow-comp .review-wrap .review-block { margin: 0; }
  .flow-comp .review-wrap .review-hint {
    position: absolute; top: 0; right: 16px; height: 41px; margin: 0;
    display: flex; align-items: center; pointer-events: none;
  }
}
.flow-wide .nav-row { margin-top: 18px; }

/* ---- Endowment "your item" card ----------------------------------------- */
.endow { display: grid; grid-template-columns: 320px 1fr; gap: 28px; align-items: start; }
.endow-img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; aspect-ratio: 1/1; object-fit: contain; padding: 12px; }
.endow h1 { font-size: 22px; margin: 4px 0 10px; }
.endow .badge { margin: 6px 0 12px; }
.endow .desc { white-space: pre-line; color: #36424f; font-size: 14px; }

/* ---- Listings: sidebar + grid ------------------------------------------- */
.listings { display: grid; grid-template-columns: 230px 1fr; gap: 26px; align-items: start; }
.crumbs { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

.filters h2 { font-size: 18px; margin: 2px 0 4px; }
.filters .clear { font-size: 13px; }
.filter-group { border-top: 1px solid var(--line); padding: 14px 0; }
.filter-group h3 { font-size: 14px; margin: 0 0 8px; }
.filter-group label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 3px 0; cursor: pointer; color: #2b3640; }
.price-inputs { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.price-inputs input { width: 72px; padding: 7px 8px; border: 1px solid var(--line-2); border-radius: 6px; font-size: 13px; }
.price-inputs .dash { color: var(--muted); }
.btn-apply { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-weight: 700; }
.btn-apply:hover { border-color: var(--blue); color: var(--blue); }

.results-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.results-count { font-size: 14px; }
.results-count b { font-weight: 700; }
.sort-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sort-wrap select { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 6px; font-size: 13.5px; background: #fff; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) { .grid { grid-template-columns: repeat(2, 1fr); } .listings { grid-template-columns: 1fr; } .endow { grid-template-columns: 1fr; } }

.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; cursor: pointer; display: flex; flex-direction: column; transition: box-shadow .12s, transform .12s; }
.card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); transform: translateY(-2px); }
.card-imgwrap { aspect-ratio: 1/1; background: #fff; padding: 10px; border-bottom: 1px solid var(--line); overflow: hidden; }
/* Size the IMAGE to the square, not the box to the image: max-height:100% does
   not resolve against an aspect-ratio-derived height, so portrait photos used to
   stretch their card ~90px taller than the rest of the row. */
.card-img { width: 100%; height: 100%; object-fit: contain; }
.card-body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.card-title { font-size: 13.5px; line-height: 1.35; max-height: 2.7em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-price { font-size: 18px; font-weight: 700; margin-top: 2px; }
.card-ship { font-size: 12.5px; color: var(--muted); }
.card-ship.free { color: var(--green); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #eef1f4; color: #41505d; width: fit-content; }
.badge.cond-New, .badge.cond-Certified { background: #e7f6e7; color: #0a6b00; }
.badge.cond-Open { background: #eaf1ff; color: #21429b; }
.badge.cond-For { background: #fdeceb; color: #b3231f; }
.card-sold { font-size: 12px; color: var(--red); font-weight: 700; }
.card-seller { font-size: 11.5px; color: var(--muted); }

.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 28px 0 0; }
.pager button { min-width: 36px; height: 36px; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; cursor: pointer; font-size: 14px; }
.pager button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.pager button.is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager button:disabled { opacity: .4; cursor: default; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---- Detail page -------------------------------------------------------- */
/* This is the main way back to the grid from a listing, and it was a 131x20px
   target. Padding brings it to 44px tall without moving anything around it. */
.detail-back { font-size: 14px; margin-bottom: 8px; display: inline-block; padding: 12px 4px; }
.detail { display: grid; grid-template-columns: 460px 1fr; gap: 34px; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } }
.detail-img { width: 100%; aspect-ratio: 1/1; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 20px; }
.detail h1 { font-size: 22px; margin: 0 0 12px; line-height: 1.3; }
.detail .price { font-size: 30px; font-weight: 800; margin: 6px 0; }
.detail .ship { font-size: 14px; color: #36424f; margin-bottom: 4px; }
.detail .ship.free { color: var(--green); font-weight: 600; }
.detail .meta-row { font-size: 14px; color: #36424f; margin: 4px 0; }
.seller-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 16px 0; font-size: 13.5px; background: var(--bg-soft); }
.seller-box .sname { font-weight: 700; }
.cta { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; max-width: 340px; }
.btn-buy { background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: 13px; font-size: 16px; font-weight: 700; cursor: pointer; }
.btn-buy:hover { background: var(--blue-d); }
.btn-watch { background: #fff; color: var(--blue); border: 1px solid var(--blue); border-radius: 999px; padding: 12px; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-watch:hover { background: #f3f6ff; }
.detail h2 { font-size: 17px; margin: 26px 0 10px; border-top: 1px solid var(--line); padding-top: 18px; }
.detail .desc { white-space: pre-line; color: #2b3640; font-size: 14.5px; }
.specs { width: 100%; border-collapse: collapse; font-size: 14px; }
.specs td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs td.k { color: var(--muted); width: 38%; }

/* ---- Listing-creation page --------------------------------------------- */
.create { max-width: 860px; margin: 0 auto; }
/* The same small heading as the consent / instructions / check pages; on these
   three it was plain 15px text (walkthrough 2026-10-14). */
.create .eyebrow { text-transform: uppercase; letter-spacing: .05em; font-size: 12px; color: var(--blue); font-weight: 700; }
.create h1 { font-size: 24px; margin: 6px 0 4px; }
.create .sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
/* Belief screens reuse the pricing-page layout (PI 2026-09-06) so the item is in
   front of the participant while they answer. That makes them look like a round,
   which is the one thing they must NOT be mistaken for — hence a banner and a
   blue rule down the card, so the difference is legible before any text is read. */
.task-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: #eef3ff; border: 1px solid #c7d7fe; border-left: 4px solid var(--blue);
  border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px;
}
.task-banner .tb-mark { font-size: 18px; line-height: 1.2; flex: 0 0 auto; }
.task-banner .tb-title { font-weight: 800; color: var(--blue-d); font-size: 13px;
  text-transform: uppercase; letter-spacing: .04em; }
.task-banner .tb-body { font-size: 13.5px; color: var(--ink); margin-top: 2px; }
.create.is-belief .create-grid { border-left: 4px solid var(--blue); }
@media (max-width: 600px) { .task-banner { padding: 10px 12px; } }


.create-grid { display: grid; grid-template-columns: 200px 1fr; gap: 22px; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.create-img { width: 100%; border: 1px solid var(--line); border-radius: 6px; object-fit: contain; aspect-ratio: 1/1; padding: 8px; }
.field { margin-bottom: 14px; }
.field .lab { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 3px; }
.field .val { font-size: 15px; }
.field.locked .val { color: #2b3640; }
.lock-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; margin-left: 6px; }
.desc-locked { white-space: pre-line; font-size: 13.5px; color: #36424f; background: var(--bg-soft); border-radius: 6px; padding: 10px 12px; max-height: 130px; overflow: auto; }

.price-field { border: 2px solid var(--blue); border-radius: 10px; padding: 16px; margin-top: 8px; background: #fafbff; }
.price-field .lab { color: var(--blue); font-weight: 700; font-size: 13px; }
.price-input-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.price-curr { font-size: 30px; font-weight: 800; color: var(--ink); }
#price { font-size: 30px; font-weight: 800; width: 220px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; outline: none; }
#price:focus { border-color: var(--blue); }
.suggested { font-size: 13px; color: var(--muted); margin-top: 8px; }
.price-help { font-size: 13px; color: var(--muted); margin-top: 6px; }
/* wrap: at 375px "Look at other products" and "List at this price" were squeezed
   side by side into two multi-line pills instead of stacking. */
.create-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-end; }

/* ---- Pricing + belief pages, wide (RA 2026-10-14) ------------------------
   photo | listing | an action panel with the cost, the input(s) and the buttons.
   The old single column put the price box ~720px down on a 1366x768 laptop —
   below the fold every round — and the belief page's Continue at ~1,040px.
   Narrow windows: see the end of the file. */
.create.create-wide { max-width: 1240px; margin: 8px auto 0; }
.create-wide h1 { margin: 4px 0 2px; }
.create-wide .sub { margin-bottom: 14px; }
.create-wide .create-grid {
  grid-template-columns: clamp(160px, 15vw, 220px) minmax(0, 1fr) clamp(250px, 23vw, 300px);
  gap: 24px; padding: 20px 22px;
}
.create-wide .field { margin-bottom: 10px; }
.create-wide .desc-locked { max-height: none; overflow: visible; }
.field-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.create-panel { display: flex; flex-direction: column; gap: 12px; }
.create-panel .cost-box { margin: 0; }
.create-panel .price-field { margin-top: 0; }
.create-panel .btn { width: 100%; }
.create-panel #price { width: 100%; min-width: 0; }
.create-panel .question { margin: 0 0 14px; }
.create-panel .question:last-of-type { margin-bottom: 4px; }
.create-panel .q-num { width: 100%; max-width: 200px; }

/* The same headphones, new, with the manufacturer's price (PI 2026-10-14). A
   product page, not a form: bigger photo, and the price is the loudest thing on
   the card — "Importantly, i want them to see the price." min-width so it does
   not out-rank the single-column rule on narrow screens. */
@media (min-width: 901px) { .create-grid.new-item { grid-template-columns: 280px 1fr; } }
.new-item-seller { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.new-item-title { font-size: 20px; margin: 4px 0 6px; line-height: 1.3; }
.new-item-condition { font-size: 14px; color: #2b3640; }
.new-item-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 14px 0 10px;
  padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-soft); }
.new-item-price-lab { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.new-item-price-val { font-size: 32px; font-weight: 800; color: var(--ink); }
.new-item-points { margin: 0 0 6px; padding-left: 20px; font-size: 14px; color: #36424f; }
.new-item-points li { margin: 2px 0; }

/* ---- Questions ---------------------------------------------------------- */
.question { margin: 0 0 22px; }
.q-prompt { font-weight: 600; margin-bottom: 8px; }
.q-num-row { display: flex; align-items: center; gap: 6px; }
.q-num-row .pfx { font-size: 18px; font-weight: 700; color: var(--muted); }
/* 16px, not 15/14: iOS Safari zooms into any input with a smaller font on focus
   and does not zoom back out, so the belief screens and the final free-text
   question left phone participants stranded at 1.3x for the rest of the study.
   #price was already 30px, which is why this was only ever hit on these two. */
.q-num { width: 160px; padding: 10px 12px; font-size: 16px; border: 1px solid var(--line-2); border-radius: 8px; }
.q-text { width: 100%; min-height: 90px; padding: 10px 12px; font-size: 16px; border: 1px solid var(--line-2); border-radius: 8px; resize: vertical; font-family: var(--font); }
.scale { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.scale-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chip { border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.chip input { display: none; }
.chip:has(input:checked) { background: var(--blue); color: #fff; border-color: var(--blue); }
.chip:hover { border-color: var(--blue); }

/* ---- Buttons / nav / notices ------------------------------------------- */
/* min-height 44px: 12px padding + 15px font gave a 41px control, under the
   44px touch-target floor on both iOS and Android. */
.btn { border: 0; border-radius: 999px; padding: 12px 26px; min-height: 44px; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-d); }
.btn-primary:disabled { background: var(--line-2); cursor: default; }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line-2); }
.btn-secondary:hover { border-color: var(--ink); }
.nav-row { display: flex; justify-content: space-between; margin-top: 24px; gap: 12px; }
.nav-row.end { justify-content: flex-end; }

.notice { text-align: center; max-width: 620px; margin: 40px auto; }
.notice .big-check { font-size: 46px; color: var(--green); }
.notice h1 { font-size: 26px; }
.code-box { display: inline-block; font-size: 22px; font-weight: 800; letter-spacing: 1px; background: var(--bg-soft); border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px 22px; margin: 12px 0; }

/* ---- Footer / toast ----------------------------------------------------- */
.mp-footer { flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--bg-soft); color: var(--muted); font-size: 12px; margin-top: 30px; }
.mp-footer-in { max-width: var(--maxw); margin: 0 auto; padding: 16px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 14px; box-shadow: 0 4px 18px rgba(0,0,0,.25); z-index: 50; max-width: 90vw; }

/* ==========================================================================
   Experiment 1 — rounds, cost display, SOLD/LISTED tags, outcome feedback.
   ========================================================================== */

/* ---- Inline validation (§8: blanks are blocked, never silently coerced) -- */
.field-error {
  background: #fdeceb; border: 1px solid #f3b6b4; color: #a3201c;
  border-radius: 6px; padding: 10px 12px; margin-top: 10px;
  font-size: 13.5px; font-weight: 600;
}
.question.is-missing .q-prompt { color: #a3201c; }
.question.is-missing .option { border-color: #f3b6b4; }

/* ---- Round progress ----------------------------------------------------- */
.round-bar {
  height: 6px; background: var(--line); border-radius: 999px;
  overflow: hidden; margin: 8px 0 14px;
}
.round-bar-fill { height: 100%; background: var(--blue); transition: width .25s ease; }

/* ---- The seller's cost, shown on every pricing round (§4) --------------- */
.cost-box {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: #fffbe6; border: 1px solid var(--yellow); border-radius: 8px;
  padding: 10px 14px; margin: 14px 0 4px;
}
.cost-lab { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #8a6d00; font-weight: 700; }
.cost-val { font-size: 22px; font-weight: 800; }
.cost-note { font-size: 12.5px; color: var(--muted); }

/* ---- SOLD / LISTED status tags (§5.2) ----------------------------------- */
.peer-tag {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em;
  padding: 3px 9px; border-radius: 4px; text-transform: uppercase; width: fit-content;
}
.peer-tag.sold { background: var(--red); color: #fff; }
.peer-tag.listed { background: #eaf1ff; color: #21429b; border: 1px solid #c3d3ff; }
.peer-tag.unsold { background: #eef1f4; color: #41505d; }
.peer-tag.yes { background: var(--green); color: #fff; }
.peer-tag.corner { position: absolute; top: 8px; left: 8px; z-index: 1; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.card-imgwrap { position: relative; }
.sold-note {
  background: var(--bg-soft); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 12px 14px; font-weight: 700; color: #41505d; text-align: center;
}

/* ---- Own-sale feedback after every round -------------------------------- */
.outcome { display: flex; align-items: center; gap: 14px; margin: 4px 0 10px; }
.outcome h1 { margin: 0; font-size: 26px; }
.outcome-mark {
  width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #fff;
}
.outcome.is-sold .outcome-mark { background: var(--green); }
.outcome.is-sold h1 { color: var(--green); }
.outcome.is-unsold .outcome-mark { background: var(--muted); }
.outcome.is-unsold h1 { color: #41505d; }

/* ---- Bonus -------------------------------------------------------------- */
.bonus-amount { font-size: 24px; font-weight: 800; color: var(--green); }
.bonus-amount.is-zero { color: #41505d; }

/* ---- Narrow screens ----------------------------------------------------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .create-grid, .detail, .endow { grid-template-columns: 1fr; }
  #price { width: 100%; }
}

/* ---- Forced exposure to the competitor set (PI update 2026-08-11) ------- */
.gate-note {
  margin-top: 10px; padding: 9px 12px; border-radius: 6px;
  font-size: 13px; font-weight: 600;
}
.gate-note.is-locked { background: #fffbe6; border: 1px solid var(--yellow); color: #8a6d00; }
.gate-note.is-open   { background: #f0f9f0; border: 1px solid #bfe3bd; color: #0a6b00; }
#price:disabled { background: var(--bg-soft); color: var(--muted); cursor: not-allowed; }

/* ---- Final answer: live character counter ------------------------------- */
.char-counter { margin-top: 6px; font-size: 12.5px; color: var(--muted); text-align: right; }
.char-counter.is-ok { color: var(--green); font-weight: 600; }

/* The competitor panel is the first step of a round, so it needs its own
   forward action rather than only the banner link. */
.peer-continue { display: flex; justify-content: center; margin: 28px 0 4px; }

/* ==========================================================================
   Mobile fixes from the UI review (2026-08-11). Prolific traffic skews mobile
   and nothing below 900px had ever been styled for the marketplace chrome.
   ========================================================================== */
@media (max-width: 820px) {
  /* The account block sat at x=389..410 on a 375px viewport, giving every peer
     screen 35px of horizontal scroll. It is decoration; drop it. */
  .mp-account { display: none; }
  .mp-header-top { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .mp-logo { font-size: 22px; }
  .mp-cats { gap: 12px; font-size: 12.5px; padding: 4px 12px 10px; }

  /* The sellbar was a nowrap flex row with a 246px fixed button, which squeezed
     the text column to 24.8px — the eyebrow wrapped to seven single-word lines
     and the title clipped to "S…". Stack it instead. */
  .mp-sellbar-in { flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .mp-sellbar-txt { flex: 1 1 auto; min-width: 0; }
  .mp-sellbar-eyebrow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mp-sellbar-title { white-space: normal; max-width: none; font-size: 14px; }
  .btn-list { margin-left: 0; flex: 1 1 100%; padding: 12px 16px; }
}
@media (max-width: 480px) {
  /* Two cards a row, not one: a single column made the twelve products ~6,900px
     — about ten phone screens every round (walkthrough 2026-10-14). */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 8px 9px 10px; }
  .card-price { font-size: 16px; }
  .card-title { font-size: 12.5px; }
  .card-seller { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* The category strip is decoration; one swipeable line instead of three. */
  .mp-cats { flex-wrap: nowrap; overflow-x: auto; gap: 16px; scrollbar-width: none; }
  .flow-card { padding: 20px 16px; }
  .create-grid { padding: 16px; }
  .cost-box { padding: 10px 12px; }
  /* Two buttons in a row share it instead of wrapping "Next round →" mid-label. */
  .nav-row { flex-wrap: wrap; }
  .nav-row .btn { flex: 1 1 140px; white-space: nowrap; }
  .review-toggle { min-height: 44px; }
}

/* ---- "Show history" popup (PI 2026-08-26) ------------------------------
   A modal over the sale-outcome screen listing every round so far. Time open
   is measured on the SERVER (rounds.history_ms), so nothing here is load-bearing
   for the data — this is presentation only. */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(17, 24, 32, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 60;
}
.modal {
  background: #fff; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.25);
  width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; padding: 22px 24px;
}
.modal h2 { margin: 0 0 4px; font-size: 20px; }
.modal .modal-intro { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.modal .nav-row { margin-top: 18px; justify-content: flex-end; }
.hist { width: 100%; border-collapse: collapse; font-size: 14px; }
.hist th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700; padding: 0 10px 6px; border-bottom: 1px solid var(--line-2);
}
.hist td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.hist .peer-tag { white-space: nowrap; }
.hist tr:last-child td { border-bottom: 0; }
.hist .r-num { color: var(--muted); width: 22%; }
.hist .r-price { font-weight: 700; }
/* The round the participant is looking at right now. */
.hist tr.is-current td { background: #f3f6ff; }
@media (max-width: 560px) {
  .modal-backdrop { padding: 10px; }
  .modal { padding: 16px 12px; }
  /* All ten rows and Close on one phone screen, each outcome tag on one line. */
  .hist { font-size: 13px; }
  .hist th, .hist td { padding-left: 4px; padding-right: 4px; }
  .hist .peer-tag { font-size: 10px; letter-spacing: 0; padding: 2px 5px; }
}

/* ---- Inline instruction review on the comprehension page (RA 2026-09-04) ----
   A collapsible copy of the instructions, so a participant can re-read without
   leaving the page and losing what they have selected. */
.review-block { margin: 0 0 22px; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.review-toggle {
  width: 100%; text-align: left; background: var(--bg-soft); border: 0; cursor: pointer;
  padding: 12px 14px; font-size: 14px; font-weight: 700; color: var(--blue);
  font-family: var(--font); display: flex; align-items: center; gap: 8px;
}
.review-toggle:hover { background: #eef2ff; }
.review-toggle .chev { transition: transform .15s ease; display: inline-block; }
.review-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.review-body { padding: 4px 16px 14px; border-top: 1px solid var(--line); }
.review-body p { font-size: 14px; margin: 10px 0; }
.review-hint { font-size: 12.5px; color: var(--muted); padding: 0 14px 12px; margin: 0; }
/* A failed attempt sends them back to the instructions; flag why they are here. */
.retry-note {
  background: #fff8e6; border: 1px solid var(--yellow); border-radius: var(--radius);
  padding: 12px 14px; font-size: 14px; margin: 0 0 18px;
}

/* ---- Phone fixes (walkthrough 2026-09-06) -------------------------------
   AT THE END OF THE FILE ON PURPOSE. This block first sat above the base rules
   it overrides, so `.desc-locked { max-height: none }` lost the cascade to
   `.desc-locked { max-height: 130px }` further down at equal specificity — the
   fix shipped and did nothing, caught by a phone walkthrough on 2026-09-06.
   Anything added here must stay last, or use a more specific selector.
   ------------------------------------------------------------------------ */
@media (max-width: 700px) {
  /* The locked description was a 130px window over ~370px of text sitting in the
     middle of the belief and pricing pages, so a touch scroll that began inside
     it moved the description rather than the page — on a phone that reads as the
     page being stuck. Nothing is gained by clipping it on a narrow screen. */
  .desc-locked { max-height: none; overflow: visible; }
  /* 40px -> 44px touch target. font-size stays 16px so iOS does not zoom the
     viewport on focus and fail to zoom back. */
  .q-num { min-height: 44px; }
}

/* ---- Wide flow screens on narrow windows (RA 2026-10-14) ----------------
   Last in the file for the same reason as the block above. Below 900px the
   instructions' side panel moves under the text and the item becomes a compact
   row; below 720px (phones) everything is one column at a phone reading size,
   with full-width choices. */
@media (max-width: 900px) {
  .instr-grid { grid-template-columns: 1fr; gap: 16px; }
  .instr-side { position: static; }
  .instr-item { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: start; }
  .instr-img { margin: 0; }
  .instr-continue { width: auto; align-self: flex-end; }
}
@media (max-width: 720px) {
  .flow-wide { margin: 6px auto; }
  .flow-wide .flow-card { padding: 18px 16px; }
  .flow-wide h1 { font-size: 22px; }
  .instr-text { columns: 1; font-size: 15.5px; }
  .instr-item { grid-template-columns: 88px 1fr; gap: 12px; }
  .instr-continue { width: 100%; align-self: stretch; }
  .consent-grid, .q-grid { grid-template-columns: 1fr; }
  .consent-options { grid-template-columns: 1fr; }
  .q-grid .option { padding: 12px 14px; font-size: 15px; }
  .flow-comp .review-body { columns: 1; }
}

/* Pricing + belief pages on narrow windows (RA 2026-10-14). Last in the file. */
@media (max-width: 1100px) {
  .create-wide .create-grid { grid-template-columns: 170px minmax(0, 1fr); }
  .create-wide .create-panel { grid-column: 1 / -1; }
  .create-panel .btn { width: auto; align-self: flex-end; }
}
@media (max-width: 720px) {
  .create-wide .create-grid { grid-template-columns: 1fr; padding: 16px; gap: 14px; }
  .create-wide .create-img { max-width: 220px; justify-self: center; }
  .field-row3 { grid-template-columns: 1fr; }
  .create-panel .btn { width: 100%; align-self: stretch; }
  .create-panel .q-num { max-width: none; }
}
