/* BookFlow — one stylesheet, mobile first, no framework. */

:root {
  --brand: #C0472A;
  --brand-ink: #9C3720;
  --brand-soft: #FBEDE7;
  --logo: #D9452B;
  --cta: #1C1B19;
  --cta-hover: #000;
  --danger: #B42318;
  --danger-soft: #FEECEB;
  --amber: #B45309;
  --amber-soft: #FEF3C7;
  --ink: #1C1B19;
  --ink-2: #3B3833;
  --muted: #6B6760;
  --line: #ECE6DA;
  --paper: #FBF8F2;
  --card: #FFFFFF;
  --sand: #F4EFE5;
  --ok: #157F3B;
  --ok-soft: #E6F4EA;
  --warn: #9A5B00;
  --warn-soft: #FFF4DC;
  --wa: #1FA855;
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(29, 27, 24, .06), 0 4px 16px rgba(29, 27, 24, .06);
  --serif: "Iowan Old Style", Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --tabbar-h: 62px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1, h2 { font-family: var(--serif); font-weight: 700; letter-spacing: 0; }
@view-transition { navigation: auto; }
h1 { font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.sr, .bf-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.hint { display: block; color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
.i { flex: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; background: var(--card); font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-brand { background: var(--cta); color: #fff; }
.btn-brand:hover { background: var(--cta-hover); }
.btn-accent, .head-sell { background: var(--brand); color: #fff; }
.btn-accent:hover, .head-sell:hover { background: var(--brand-ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-light { background: #fff; color: var(--ink); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-lg { min-height: 52px; font-size: 1.05rem; padding: 12px 22px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }
.pill { display: inline-block; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--sand); color: var(--ink-2); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: .75rem; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 40; background: rgba(251, 250, 247, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 1.25rem; letter-spacing: -.02em; flex: none; }
.brand img { border-radius: 8px; }
.brand b { color: var(--logo); font-weight: 800; }
.brand span { font-weight: 700; }
.head-search { flex: 1; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--muted); min-width: 0; }
.head-search:focus-within { border-color: var(--ink-2); }
.head-search input { border: 0; outline: 0; background: none; width: 100%; color: var(--ink); min-width: 0; }
.head-nav { display: none; align-items: center; gap: 4px; }
.head-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; text-decoration: none; font-weight: 500; font-size: .95rem; }
.head-link:hover { background: var(--sand); }
.avatar { border-radius: 50%; object-fit: cover; background: var(--sand); }
.avatar-lg { width: 56px; height: 56px; }

/* Bottom tab bar (phones) */
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .7rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabbar a.is-active { color: var(--ink); }
.tabbar .tab-sell svg { width: 40px; height: 40px; padding: 9px; margin-top: -14px; border-radius: 50%; background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(192, 71, 42, .35); }
.contact-bar { position: fixed; inset: auto 0 calc(var(--tabbar-h) + env(safe-area-inset-bottom)) 0; z-index: 45; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-top: 1px solid var(--line); }
.contact-bar .btn { flex: 1; }
.contact-bar-price { font-weight: 800; font-size: 1.15rem; }

/* Flash and notices */
.flash { margin: 16px 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-error::before { content: "⚠ "; }
.flash ul { margin: 0; padding-left: 18px; }
.notice { padding: 10px 12px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); font-weight: 500; }
.notice-muted { background: var(--sand); color: var(--ink-2); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 28px 0 8px; }
.hero > .wrap { position: relative; }
.hero h1 { max-width: 18ch; }
.hero-art { position: absolute; top: 4px; right: -150px; width: 420px; color: var(--brand); opacity: .16; pointer-events: none; }
@media (min-width: 900px) { .hero-art { top: auto; right: max(-40px, calc(50vw - 640px)); bottom: 70px; width: 600px; opacity: .2; } }
@media (max-width: 899px) { .home .head-search { visibility: hidden; } }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 60ch; }
.hero-search { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; margin: 16px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); color: var(--muted); max-width: 680px; }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; height: 44px; color: var(--ink); font-size: 1.05rem; }
.hero-search:focus-within { border-color: var(--ink-2); }

/* Chips */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: .9rem; font-weight: 500; white-space: nowrap; }
.chip small { color: var(--muted); font-size: .75rem; }
.chip:hover { border-color: var(--ink-2); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.is-on small { color: rgba(255, 255, 255, .7); }

/* Sections */
.section { padding-top: 28px; padding-bottom: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.more { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .92rem; color: var(--brand-ink); text-decoration: none; }

.cat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cat-tile { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); text-decoration: none; height: 100%; transition: border-color .15s, transform .15s; }
.cat-tile:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.cat-name { font-weight: 700; }
.cat-count { color: var(--muted); font-size: .85rem; }

/* Ad grid and cards */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 46%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.card { position: relative; background: var(--card); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-link { display: block; text-decoration: none; height: 100%; }
.card-img { position: relative; aspect-ratio: 3 / 4; background: var(--sand); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-noimg { display: grid; place-items: center; height: 100%; color: var(--muted); }
.card.is-sold .card-img img { filter: grayscale(1); opacity: .6; }
.card-body { padding: 10px 12px 12px; }
.card-price { margin: 0; font-weight: 800; font-size: 1.05rem; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.off { font-size: .75rem; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 1px 6px; border-radius: 4px; }
.card-title { font-size: .92rem; font-weight: 500; margin: 2px 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.card-meta { margin: 0; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta span + span::before { content: " · "; }
.tag { position: absolute; left: 8px; top: 8px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; }
.tag-feat { background: var(--amber-soft); color: var(--amber); }
.tag-sold { background: var(--ink); color: #fff; left: auto; right: 8px; top: auto; bottom: 8px; }
.tag-set { top: auto; bottom: 8px; background: var(--card); color: var(--ink); }
.facts { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; }
.facts li { padding: 3px 10px; border-radius: 99px; background: var(--sand); color: var(--ink-2); }
.quick-chips { margin: 0 0 10px; gap: 6px; }
.quick-chips .chip { font-size: .85rem; padding: 6px 12px; }
.more-wrap { text-align: center; margin: 20px 0 0; }
.link-row { margin: 24px 0 0; }
.fav { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: var(--ink-2); cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.fav.is-on, .fav-btn.is-on { color: var(--brand); }
.fav.is-on svg, .fav-btn.is-on svg { fill: currentColor; }

/* Sell band */
.sell-band { margin: 36px 0 8px; }
.sell-inner { position: relative; overflow: hidden; display: grid; gap: 18px; padding: 26px 20px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--r); max-width: calc(1200px - 32px); width: calc(100% - 32px); margin: 0 auto; }
.sell-inner::after { content: ""; position: absolute; right: -40px; bottom: -30px; width: 220px; height: 140px; opacity: .12; pointer-events: none; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 140' fill='none' stroke='%23C0472A' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M0 110C60 80 110 130 220 90'/%3E%3Crect x='30' y='52' width='30' height='42' rx='3' transform='rotate(-12 45 73)'/%3E%3Crect x='100' y='60' width='28' height='38' rx='3' transform='rotate(8 114 79)'/%3E%3Crect x='165' y='34' width='30' height='42' rx='3' transform='rotate(-6 180 55)'/%3E%3C/svg%3E"); }
.sell-inner > * { position: relative; }
.sell-inner h2 { font-size: 1.5rem; max-width: 22ch; margin-bottom: .4em; }
.sell-inner p { color: var(--muted); margin: 0; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--ink-2); }
.steps b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-size: .85rem; flex: none; }
.sell-band .btn { justify-self: start; }
.sell-band .btn-light { background: var(--ink); color: #fff; }

.prose-block h2 { margin-top: 1.4em; }
.why { display: grid; gap: 16px; margin: 12px 0 8px; }
.why > div { padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.why svg { color: var(--brand); margin-bottom: 8px; }
.why p { margin: 0; color: var(--muted); font-size: .95rem; }
.faq details, .safety { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary, .safety summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.faq summary::-webkit-details-marker, .safety summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 8px 0 0; color: var(--muted); }

/* Listing */
.listing { padding-top: 12px; padding-bottom: 32px; }
.listing-head { margin: 8px 0 14px; }
.listing-head .lede { margin: 0; font-size: .98rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 4px 0 8px; font-size: .82rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.filters { margin: 4px 0 8px; display: grid; gap: 10px; }
.filter-q { display: grid; grid-template-columns: 1fr; gap: 8px; }
.filter-q input, .filter-q select { height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); width: 100%; }
.filter-more { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.filter-more > summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 600; cursor: pointer; list-style: none; }
.filter-more > summary::-webkit-details-marker { display: none; }
.filter-grid { display: grid; gap: 14px; padding: 4px 14px 14px; }
.filter-grid fieldset { border: 0; padding: 0; margin: 0; }
.filter-grid legend { font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--ink-2); }
.filter-grid input[type=text], .filter-grid input[type=number], .filter-grid select { height: 42px; width: 100%; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.range { display: flex; align-items: center; gap: 8px; }
.filter-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 0 14px 14px; }
.count { color: var(--muted); font-size: .9rem; margin: 6px 0 10px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-weight: 500; font-size: .92rem; }
.seg input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.seg-lg span { min-height: 46px; padding: 8px 22px; font-size: 1rem; }
.pager { margin: 24px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pager .page-numbers { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); text-decoration: none; font-weight: 600; }
.pager .current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager .dots { border: 0; background: none; }
.empty { text-align: center; padding: 40px 16px; }
.empty p { color: var(--muted); }
.seo-text { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .95rem; }
.seller-head { display: flex; align-items: center; gap: 14px; margin: 20px 0; }
.seller-head h1 { margin: 0; font-size: 1.4rem; }
.seller-head p { margin: 0; }

/* Single ad */
.ad-page { padding-top: 8px; padding-bottom: 40px; }
.ad-layout { display: grid; gap: 20px; }
.gallery { margin: 0 -16px; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--sand); }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; aspect-ratio: 1; display: grid; place-items: center; }
@media (max-width: 899px) { .gallery-slide { aspect-ratio: auto; height: min(100vw, 40vh); } }
.gallery-slide > a { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.zoom { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #111; }
.zoom::backdrop { background: #111; }
.zoom-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.zoom-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; touch-action: pinch-zoom pan-x pan-y; }
.zoom-close { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 99px; border: 0; background: rgba(255,255,255,.9); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.ad-facts { list-style: none; margin: 4px 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ad-facts li { font-size: .82rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--sand); color: var(--ink-2); }
.ask-chips { gap: 6px; }
.ask-chips .chip { font-size: .82rem; padding: 6px 12px; }
.seller-line { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .85rem; }
.seller-line .avatar { border-radius: 99px; flex: none; }
.seller-line b { color: var(--ink); font-weight: 600; }
.about-copy { margin: 0; }
.near-links { margin-top: 12px; }
.gallery-slide img { width: 100%; height: 100%; object-fit: contain; }
.gallery-empty { color: var(--muted); }
.gallery-thumbs { display: flex; gap: 8px; padding: 10px 16px 0; overflow-x: auto; }
.gallery-thumbs a { flex: none; width: 60px; height: 60px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; }
.gallery-thumbs a.is-active { border-color: var(--ink); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.ad-title { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); margin-bottom: 8px; }
.ad-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.ad-price strong { font-size: 1.75rem; font-weight: 800; }
.ad-price s { color: var(--muted); }
.ad-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .9rem; }
.ad-sub span { display: inline-flex; align-items: center; gap: 4px; }
.ad-actions { display: grid; gap: 10px; margin: 16px 0 20px; }
.ad-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.h-sm { font-size: 1.05rem; margin: 22px 0 10px; }
.specs { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.specs div { background: var(--card); padding: 10px 12px; }
.specs dt { font-size: .78rem; color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; word-break: break-word; }
.seller-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 24px 0 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.seller-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.seller-link span { display: flex; flex-direction: column; }
.seller-link small { color: var(--muted); }
.safety ul { margin: 10px 0 0; padding-left: 20px; color: var(--ink-2); font-size: .95rem; }
.revealed-phone { font-size: 1.15rem; letter-spacing: .02em; }

/* Forms */
.form-page { padding-top: 12px; padding-bottom: 40px; }
.form-sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px; margin-bottom: 14px; }
.form-sec h2 { font-size: 1.05rem; margin-bottom: 4px; }
.field { display: grid; gap: 6px; margin-top: 14px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { font-weight: 600; font-size: .92rem; padding: 0; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=tel], .field input[type=number], .field input:not([type]), .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #D9D4CA; border-radius: 10px; background: #fff; font-size: 16px;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink-2); outline: 2px solid rgba(29, 27, 24, .08); }
.field input:user-invalid, .field select:user-invalid { border-color: var(--danger); }
.field-row, .field-grid { display: grid; gap: 0 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { position: relative; }
.check input { position: absolute; opacity: 0; inset: 0; }
.check span { display: inline-flex; padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; font-size: .92rem; cursor: pointer; }
.check input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.check input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.uploader { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs { list-style: none; padding: 0; margin: 0; display: contents; }
.thumb { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; background: var(--sand); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-cover::after { content: "Cover"; position: absolute; left: 4px; bottom: 4px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .65rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; }
.drop { width: 92px; height: 92px; border: 2px dashed #CFC8BB; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .75rem; font-weight: 600; cursor: pointer; position: relative; text-align: center; }
.drop:hover, .drop.is-over { border-color: var(--brand); color: var(--brand); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop.is-full { display: none; }
.feature-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin: 12px 0 14px; border: 1px solid #F2D27A; background: #FFFAEB; border-radius: var(--r); cursor: pointer; }
.feature-opt input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--brand); }
.feature-opt b { display: inline-flex; align-items: center; gap: 6px; }
.feature-opt small { display: block; color: var(--muted); }
.form-submit { padding: 8px 0 12px; }
.panel { padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }

/* Auth */
.auth { display: grid; place-items: start center; padding-top: 24px; padding-bottom: 40px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px 20px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.auth-card .form .btn { margin-top: 18px; }
.auth-alt { text-align: center; margin: 14px 0 0; font-size: .95rem; }
.auth-alt a { color: var(--brand-ink); font-weight: 600; }

/* Dashboard */
.dash { padding-top: 16px; padding-bottom: 40px; }
.dash-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-head h1 { font-size: 1.35rem; margin: 0; }
.dash-head p { margin: 0; }
.dash-sell { margin-left: auto; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; scrollbar-width: none; }
.tabs a { padding: 10px 14px; text-decoration: none; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.is-active { color: var(--ink); border-color: var(--brand); }
.tabs .tabs-out { margin-left: auto; font-weight: 500; }
.my-ads { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
html, body { overflow-x: clip; }
.my-ad { display: flex; gap: 12px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.my-ad-img { flex: none; width: 76px; height: 76px; border-radius: 8px; overflow: hidden; background: var(--sand); }
.my-ad-img img { width: 100%; height: 100%; object-fit: cover; }
.my-ad-body { min-width: 0; flex: 1; }
.my-ad-title { font-weight: 600; text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-ad-body p { margin: 2px 0 6px; font-size: .85rem; }
.my-ad-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; font-weight: 600; }
.my-ad-actions a { color: var(--ink-2); }
.my-ad-actions .danger { color: var(--danger); }
.status { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; margin-right: 4px; }
.status-live { background: var(--ok-soft); color: var(--ok); }
.status-pending { background: var(--warn-soft); color: var(--warn); }
.status-sold, .status-hidden, .status-expired { background: var(--sand); color: var(--ink-2); }
.feat { color: var(--warn); font-weight: 600; }
.credits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.credits div { padding: 16px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-align: center; }
.credits b { display: block; font-size: 1.5rem; }
.credits span { color: var(--muted); font-size: .85rem; }
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-size: .92rem; margin-bottom: 18px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.table .is-expired td { color: var(--muted); }
.narrow-form { max-width: 480px; }
.narrow-form .btn { margin-top: 18px; }

/* Packages */
.packages { padding-top: 16px; padding-bottom: 40px; }
.plans { display: grid; gap: 14px; margin: 20px 0; }
.plan { position: relative; padding: 22px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; }
.plan.is-best { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.plan-flag { position: absolute; top: -12px; left: 18px; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.plan h2 { margin: 0; }
.plan-price { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 12px; }
.plan-price strong { font-size: 2rem; font-weight: 800; }
.plan-price s { color: var(--muted); }
.plan-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; flex: 1; }
.plan-list li { display: flex; align-items: center; gap: 8px; }
.plan-list svg { color: var(--ok); }

/* Pages and blog */
.page-body { padding-top: 12px; padding-bottom: 40px; }
.prose { font-size: 1.02rem; overflow-wrap: anywhere; }
.prose img { border-radius: var(--r-sm); }
.prose a { color: var(--brand-ink); }
.prose table { width: 100%; border-collapse: collapse; }
.prose td, .prose th { border: 1px solid var(--line); padding: 8px; }
.post-hero { margin: 0 0 20px; }
.post-hero img { border-radius: var(--r); width: 100%; }
.posts { display: grid; gap: 16px; }
.post-card a { display: block; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; height: 100%; }
.post-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card h2 { font-size: 1.1rem; margin: 12px 14px 6px; }
.post-card p { margin: 0 14px 14px; color: var(--muted); font-size: .92rem; }
.page-404 { padding-top: 48px; padding-bottom: 48px; }
.page-404 .hero-search { margin: 20px auto; }

/* Footer */
.site-foot { margin-top: 40px; background: var(--card); border-top: 1px solid var(--line); font-size: .92rem; }
.foot-grid { display: grid; gap: 24px; padding-top: 32px; padding-bottom: 24px; grid-template-columns: 1fr 1fr; }
.foot-about { grid-column: 1 / -1; }
.foot-about p { color: var(--muted); margin-top: 10px; max-width: 42ch; }
.foot-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.foot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-list a { text-decoration: none; }
.foot-list a:hover { text-decoration: underline; }
.foot-base { border-top: 1px solid var(--line); padding-top: 14px; padding-bottom: 18px; color: var(--muted); font-size: .85rem; }

/* WooCommerce checkout, kept minimal */
.woocommerce form .form-row input.input-text, .woocommerce form .form-row select { min-height: 46px; padding: 10px 12px; border: 1px solid #D9D4CA; border-radius: 10px; }
.woocommerce #payment #place_order, .woocommerce-page #payment #place_order, .woocommerce button.button.alt { background: var(--brand) !important; border-radius: 10px; min-height: 50px; font-weight: 700; }
.woocommerce-checkout #customer_details .col-1, .woocommerce-checkout #customer_details .col-2 { width: 100%; float: none; }

/* Wider screens */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .rail { grid-auto-columns: 31%; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .why { grid-template-columns: repeat(3, 1fr); }
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .field-grid .field-wide { grid-column: 1 / -1; }
  .filter-q { grid-template-columns: 2fr 1fr; }
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: repeat(2, 1fr); }
  .posts { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 32px; }
  .gallery { margin: 0; }
  .gallery-track { border-radius: var(--r); }
  .gallery-thumbs { padding-left: 0; }
}

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .tabbar, .contact-bar { display: none; }
  .head-row { height: 68px; gap: 20px; }
  .head-search { max-width: 520px; }
  .head-nav { display: flex; margin-left: auto; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rail { grid-auto-columns: calc(25% - 12px); margin: 0; padding: 0 0 4px; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .hero { padding: 48px 0 16px; }
  .sell-inner { grid-template-columns: 1fr auto; align-items: center; }
  .sell-band .btn { justify-self: end; }
  .ad-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 36px; align-items: start; }
  .gallery { position: sticky; top: 88px; }
  .filters { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: repeat(4, 1fr); }
  .plans { grid-template-columns: repeat(4, 1fr); }
  .posts { grid-template-columns: repeat(3, 1fr); }
  .foot-grid { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; }
  .foot-about { grid-column: auto; }
  .form-submit { position: static; background: none; }
}

@media (min-width: 900px) and (max-width: 1100px) {
  .head-link span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* City picker */
.city-field { position: relative; }
.suggest { position: absolute; z-index: 30; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 320px; overflow-y: auto; }
.suggest li { padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.suggest li span { color: var(--muted); font-size: .85rem; }
.suggest li.is-active, .suggest li:hover { background: var(--sand); }
.city-chips { margin-top: 10px; }

/* Ad spots: clearly labelled, never inside the book cards */
.ad-slot { grid-column: 1 / -1; margin: 6px 0; padding: 8px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--card); min-height: 100px; }
.ad-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.ad-slot-ad { margin: 20px 0 8px; }

/* Google sign-in and divider */
.google-signin { display: flex; justify-content: center; min-height: 44px; margin: 16px 0 4px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 14px 0 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Footer extras */
.foot-ctas { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.center-row { justify-content: center; }
.social { display: flex; gap: 14px; font-size: .9rem; }
.social a { color: var(--muted); }

/* Book grids inside converted pages */
.prose .grid { margin: 16px 0 24px; }
.prose .card-title, .prose .card-price { margin-top: 0; }
.prose details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.prose summary { font-weight: 600; cursor: pointer; }
.prose .btn { color: #fff; text-decoration: none; }

/* Unread dots on header and tab bar */
.head-link, .tabbar a { position: relative; }
.dot { position: absolute; top: 2px; left: 22px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; }
.tabbar .dot { top: 4px; left: calc(50% + 4px); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn-icon { flex: 0 0 auto !important; width: 48px; padding: 0; }

/* Chat */
.chat { display: grid; grid-template-columns: 1fr; padding-top: 12px; padding-bottom: 16px; }
.chat-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.chat-list-head h1 { font-size: 1.4rem; margin: 0; }
.threads { list-style: none; margin: 0; padding: 0; }
.thread { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-radius: var(--r); text-decoration: none; }
.thread:hover, .thread.is-active { background: var(--sand); }
.thread-img { flex: none; width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--sand); }
.thread-img img { width: 100%; height: 100%; object-fit: cover; }
.thread-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.thread-top { display: flex; justify-content: space-between; gap: 8px; }
.thread-top small { color: var(--muted); font-size: .75rem; flex: none; }
.thread-ad, .thread-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .85rem; color: var(--muted); }
.thread-ad { color: var(--ink-2); }
.thread.is-unread .thread-last { color: var(--ink); font-weight: 600; }
.chat-pane { display: none; }
.chat-placeholder { display: grid; place-items: center; gap: 8px; color: var(--muted); height: 100%; min-height: 300px; text-align: center; }

/* Phone: an open conversation takes the whole screen */
.chat.is-open .chat-list { display: none; }
.chat.is-open .chat-pane { display: flex; flex-direction: column; position: fixed; inset: 0 0 calc(var(--tabbar-h) + env(safe-area-inset-bottom)) 0; z-index: 41; background: var(--paper); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.chat-back { font-size: 1.4rem; text-decoration: none; padding: 4px 8px; }
.chat-ad { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; text-decoration: none; }
.chat-ad img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.chat-ad span { display: flex; flex-direction: column; min-width: 0; }
.chat-ad small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-menu { position: relative; }
.chat-menu summary { list-style: none; cursor: pointer; font-size: 1.4rem; padding: 4px 10px; border-radius: 8px; }
.chat-menu summary::-webkit-details-marker { display: none; }
.chat-menu > div { position: absolute; right: 0; top: 100%; z-index: 5; min-width: 200px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: grid; }
.chat-menu a, .chat-menu button { text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 8px; text-decoration: none; cursor: pointer; font-size: .92rem; }
.chat-menu a:hover, .chat-menu button:hover { background: var(--sand); }
.chat-menu .danger { color: var(--danger); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.chat-safety { align-self: center; max-width: 420px; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: .8rem; text-align: center; display: flex; gap: 6px; align-items: flex-start; }
.msg { max-width: 80%; align-self: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 8px 12px; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg time, .msg-seen { display: block; font-size: .68rem; color: var(--muted); margin-top: 2px; text-align: right; }
.msg.is-mine { align-self: flex-end; background: var(--ink); color: #fff; border-color: var(--ink); border-radius: 16px 16px 4px 16px; }
.msg.is-mine time, .msg.is-mine .msg-seen { color: rgba(255, 255, 255, .65); }
.msg.is-pending { opacity: .6; }
.msg.is-failed { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft); }
.msg.is-failed time { color: var(--danger); }
.quick { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 8px; scrollbar-width: none; }
.quick .chip { cursor: pointer; flex: none; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 10px 14px; border: 1px solid #D9D4CA; border-radius: 22px; font-size: 16px; line-height: 1.4; }
.composer textarea:focus { outline: none; border-color: var(--ink-2); }
.composer .btn { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; flex: none; }
.chat-closed { text-align: center; color: var(--muted); padding: 14px; background: #fff; border-top: 1px solid var(--line); margin: 0; }

@media (min-width: 900px) {
  .chat { grid-template-columns: 340px 1fr; gap: 0; height: calc(100vh - 68px - 40px); min-height: 520px; padding-top: 20px; }
  .chat-list { display: block !important; border-right: 1px solid var(--line); padding-right: 12px; overflow-y: auto; }
  .chat-pane, .chat.is-open .chat-pane { display: flex; flex-direction: column; position: static; background: var(--paper); border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--r) var(--r) 0; overflow: hidden; }
  .chat-back { display: none; }
  .is-app-page .site-foot { margin-top: 20px; }
}

/* ---- Sell form: steps ---- */
.sell h1 { margin-bottom: 12px; }
.stepper { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0 0 14px; counter-reset: s; }
.stepper li { flex: 1; }
.stepper button { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; font-size: .72rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.stepper span { width: 100%; height: 4px; border-radius: 4px; background: var(--line); font-size: 0; }
.stepper .is-current button { color: var(--ink); }
.stepper .is-current span, .stepper .is-done span { background: var(--brand); }
.is-stepped .step { display: none; }
.is-stepped .step.is-current { display: block; }
.step-nav { display: flex; gap: 10px; justify-content: space-between; position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 10px 0; background: linear-gradient(transparent, var(--paper) 25%); z-index: 5; }
.step-nav [data-prev] { flex: 0 0 auto; }
.step-nav [data-next], .step-nav [data-submit] { flex: 1; }
.form:not(.is-stepped) .step-nav [data-next], .form:not(.is-stepped) .step-nav [data-prev] { display: none; }
.field-err { color: var(--danger); font-size: .85rem; font-weight: 500; margin: 6px 0 0; }

/* Category pick */
.cat-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-pill { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.cat-pill.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.sub-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.sub-pick .chip { cursor: pointer; font: inherit; font-size: .9rem; }

/* Title coaching */
.title-field { position: relative; }
.counter { float: right; font-weight: 500; color: var(--muted); font-size: .8rem; }
.counter.is-near { color: var(--warn); }
.coach { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: .9rem; }
.coach p { margin: 0 0 6px; }
.coach .btn { white-space: normal; text-align: left; }
.title-field .suggest li { display: block; }

/* Switches (set of books, WhatsApp) */
.switch { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; }
.switch input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.switch b { display: inline-flex; align-items: center; gap: 6px; }
.switch small { display: block; color: var(--muted); }

/* Price */
.price-help { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--sand); font-size: .9rem; }
.price-help.is-good { background: var(--ok-soft); color: var(--ok); }
.price-help.is-bad { background: var(--danger-soft); color: var(--danger); font-weight: 600; }

/* Photos */
.thumb { cursor: pointer; }
.thumb.has-issue { outline: 2px solid #F2B84B; outline-offset: 1px; }
.photo-warn { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: .88rem; }
.dos { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; font-size: .88rem; }
.dos li { padding: 6px 10px; border-radius: 8px; }
.dos .do { background: var(--ok-soft); color: var(--ok); }
.dos .do::before { content: "✓ "; font-weight: 700; }
.dos .dont { background: var(--danger-soft); color: var(--danger); }
.dos .dont::before { content: "✕ "; font-weight: 700; }
.desc-chips { margin-bottom: 8px; }
.desc-chips .chip { cursor: pointer; font: inherit; font-size: .82rem; padding: 5px 10px; }

/* Preview + success */
.preview { margin-top: 18px; }
.preview-label { font-size: .8rem; font-weight: 600; color: var(--muted); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.preview .card { max-width: 220px; }
.preview .card:hover { transform: none; }
.done { text-align: center; }
.done-icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.done-card { max-width: 240px; margin: 18px auto; text-align: left; }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0; }
.done-feature { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: #FFFAEB; font-size: .92rem; }
@media (min-width: 900px) { .step-nav { position: static; background: none; } }

.req { color: var(--danger); }

.set-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

.report-ad { margin-top: 10px; font-size: .88rem; }
.report-ad summary { cursor: pointer; color: var(--muted); }
.report-ad .chip { cursor: pointer; font: inherit; font-size: .85rem; }

/* My account */
.dash-who { min-width: 0; flex: 1; }
.strength { display: grid; gap: 4px; text-decoration: none; max-width: 280px; margin-top: 4px; }
.strength-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.strength-bar span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.strength small { color: var(--muted); }
.next-step { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--r); background: var(--sand); }
.next-step > div { flex: 1; min-width: 200px; }
.next-step b { display: block; }
.next-step p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.next-icon { display: grid; place-items: center; color: var(--brand); flex: none; }
.next-step .btn { min-height: 40px; padding: 8px 16px; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 4px 0 18px; padding: 0 2px; }
.mini-stats div { display: flex; align-items: baseline; gap: 6px; }
.mini-stats b { font-size: 1.15rem; }
.mini-stats span { color: var(--muted); font-size: .9rem; }
.linklike { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.sold-menu { position: relative; }
.sold-menu summary { cursor: pointer; list-style: none; text-decoration: underline; text-underline-offset: 2px; color: var(--ink-2); }
.sold-menu summary::-webkit-details-marker { display: none; }
.sold-menu > div { position: absolute; z-index: 5; left: 0; top: 140%; width: 240px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 599px) {
  .sold-menu[open] summary::before { content: ""; position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .35); }
  .sold-menu > div { position: fixed; z-index: 71; left: 12px; right: 12px; top: auto; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); width: auto; padding: 18px; border-radius: 16px; }
  .sold-menu > div .btn { flex: 1 1 40%; }
}
.per-ad { margin: 36px auto 8px; max-width: 760px; text-align: center; }
.per-ad .lede { margin-left: auto; margin-right: auto; }
.per-ad-grid { display: grid; gap: 12px; margin: 12px 0 16px; text-align: left; }
@media (min-width: 600px) { .per-ad-grid { grid-template-columns: 1fr 1fr; } }
.per-ad-card { padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.per-ad-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.per-ad-card h3 strong { margin-left: auto; font-size: 1.1rem; }
.per-ad-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.sold-menu p { width: 100%; margin: 0 0 4px; font-weight: 600; }
.my-ad-actions .sold-menu .btn { text-decoration: none; }
.my-ad-actions .sold-menu .btn-brand { color: #fff; }
.how { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.how .steps li { color: var(--ink-2); }
.pkg-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-field { display: flex; align-items: center; gap: 14px; }
.avatar-xl { width: 88px; height: 88px; }
.danger-zone { margin-top: 24px; font-size: .88rem; }
.danger-zone a { color: var(--brand-ink); }
.ig-card { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding: 14px 16px; border-radius: var(--r); background: linear-gradient(120deg, #fdf0f6, #fff4ea); position: relative; }
.ig-card > div { flex: 1; }
.ig-card p { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.ig-x { position: absolute; top: 6px; right: 6px; border: 0; background: none; cursor: pointer; color: var(--muted); }
.help-line { margin-top: 18px; font-size: .88rem; color: var(--muted); }
.seller-page .seller-head { align-items: flex-start; }
.seller-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.seller-badges .pill { display: inline-flex; align-items: center; gap: 4px; }
.seller-bio { max-width: 60ch; margin: 6px 0; }
.seller-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Floating bars (unfinished ad, install) and chat notification prompt */
.float-bar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); z-index: 46; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); font-size: .9rem; font-weight: 500; }
.float-bar span { flex: 1; }
.float-bar img { border-radius: 8px; }
.float-x { border: 0; background: none; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px; }
.single-ad_post .float-bar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 76px); }
@media (min-width: 900px) { .float-bar { left: auto; right: 24px; bottom: 24px; max-width: 420px; } .single-ad_post .float-bar { bottom: 24px; } }
.chat-push { align-self: center; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px dashed var(--line); font-size: .88rem; }
.install-page ol { padding-left: 20px; display: grid; gap: 6px; }
.install-os { margin-top: 24px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }


/* Home: two worlds */
.hero-tag { display: inline-block; margin: 0 0 10px; padding: 4px 12px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; font-size: .85rem; }
.doors { display: grid; gap: 12px; margin-top: 8px; }
.door { padding: 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); }
.door h2 { margin-bottom: 4px; }
.door p { color: var(--muted); margin-bottom: 12px; }
.door-study { border-top: 3px solid var(--ink); }
.door-stories { border-top: 3px solid var(--amber); background: #FFFCF5; }
.shelf-band { margin-top: 28px; background: #FFFCF5; border-top: 1px solid #F1E7D3; border-bottom: 1px solid #F1E7D3; }
.shelf-band .section { padding-bottom: 24px; }
.section-head h2 { display: inline-flex; align-items: center; gap: 8px; }
@media (min-width: 760px) { .doors { grid-template-columns: 1fr 1fr; } }

/* Free books */
.card-price.is-free, .ad-price .is-free { color: var(--ok); }
.free-switch { margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--ok-soft); }
.free-switch b { display: inline-flex; align-items: center; gap: 6px; }

/* Dashboard guides */
.guides { margin-top: 24px; }
.guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.guide-list a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); text-decoration: none; font-weight: 500; }
.guide-list a:hover { border-color: var(--brand); }
.guide-list a span { flex: 1; }
.guide-list .i-book { color: var(--brand); }
.guide-list .i-arrow { color: var(--muted); }
.plan-line { margin: 12px 0 0; padding: 12px 14px; border-radius: var(--r); background: var(--brand-soft); font-size: .92rem; }
.plan-line a { color: var(--brand-ink); font-weight: 600; }
@media (min-width: 760px) { .guide-list { grid-template-columns: repeat(3, 1fr); } }

/* Sign-up questions */
.welcome h1 { margin-top: 4px; }
.about-q legend { font-weight: 600; margin-bottom: 8px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick label { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pick span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); font-weight: 500; }
.pick input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.pick-sub { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.pick-sub span { min-height: 38px; padding: 6px 12px; font-size: .9rem; }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.about-q.is-missing legend { color: var(--danger); }

.prefix-input { display: flex; align-items: center; border: 1px solid #D9D4CA; border-radius: 10px; background: #fff; overflow: hidden; }
.prefix-input span { padding: 0 4px 0 12px; color: var(--muted); white-space: nowrap; font-size: .92rem; }
.field .prefix-input input { border: 0; border-radius: 0; padding-left: 0; min-width: 0; }
.share-ig { margin: 10px 0 0; }
.amz { margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.amz-lead { margin: 0 0 8px; font-weight: 600; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.amz-lead small { color: var(--muted); font-size: .72rem; font-weight: 400; }
.amz-btn { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 14px; border-radius: 10px; background: #FFF4E0; border: 1px solid #F5C66B; color: var(--ink); font-weight: 600; text-decoration: none; }
.amz-btn:hover { background: #FFEBC7; }
.foot-note { display: block; margin-top: 6px; color: var(--muted); font-size: .75rem; }
.empty .amz { max-width: 420px; margin: 18px auto 0; text-align: left; }
.gone-head { display: flex; gap: 16px; align-items: flex-start; padding: 24px 0 8px; }
.gone-img { width: 96px; height: 128px; object-fit: cover; border-radius: var(--r-sm); filter: grayscale(.6); }
.tag-gone { background: var(--sand); color: var(--ink-2); }
.gone-head .tag { position: static; display: inline-block; margin-bottom: 8px; }
.page-404 .maybe { text-align: left; }
.page-404.narrow { max-width: 1200px; }
.hub-link { margin: 12px 0 0; font-weight: 600; }
.hub-link a { color: var(--brand-ink); text-decoration: none; }
.hub-chips { margin-bottom: 20px; }
.hub-note { margin-top: 24px; font-size: .9rem; }
.agree { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); cursor: pointer; }
.agree input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.agree span { font-weight: 600; }
.agree small { display: block; margin-top: 4px; font-weight: 400; color: var(--muted); font-size: .88rem; }
.agree a { color: var(--brand-ink); }
.btn[disabled] { opacity: .45; }

/* Shelf */
.shelf-head { display: flex; align-items: center; gap: 16px; margin: 18px 0 10px; }
.shelf-head h1 { margin: 0 0 4px; font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); }
.shelf-meta { margin: 0; color: var(--muted); }
.seller-page .seller-bio { margin: 0 0 12px; }
.shelf-facts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 18px; }
.shelf-facts .pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; text-decoration: none; }
.shelf-facts a.pill:hover { background: var(--line); }
.shelf-share-btn { margin-left: auto; }
.own-shelf { margin: -8px 0 16px; }
.shelf-share { margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.shelf-share-top { display: flex; gap: 12px; align-items: center; }
.shelf-share-top .i { color: var(--brand); }
.shelf-share-top b { display: block; }
.shelf-url { color: var(--brand-ink); font-weight: 600; word-break: break-all; }
.shelf-share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
@media (max-width: 599px) { .shelf-share-btn { margin-left: 0; } }
.ad-state { font-style: normal; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; border-radius: 4px; background: var(--sand); color: var(--ink-2); }

/* Content pages: Sell books, About, Safety tips, Contact */
.page-hero { padding: 20px 0 8px; }
.hero-tag svg { display: inline-block; vertical-align: -3px; }
.page-hero h1 { max-width: 20ch; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 18px 0 8px; }
.stat-row { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 760px; }
.stat-row li { padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.stat-row b { display: block; font-family: var(--serif); font-size: 1.4rem; color: var(--brand-ink); }
.stat-row span { color: var(--muted); font-size: .85rem; }
@media (min-width: 760px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.step-cards { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.step-cards li { position: relative; padding: 18px 16px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.step-cards b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); margin-bottom: 8px; }
.step-cards h3 { margin: 0 0 4px; }
.step-cards p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (min-width: 760px) { .step-cards { grid-template-columns: repeat(3, 1fr); } }
.prose .compare { overflow-x: auto; margin: 16px 0; }
.prose .compare table { min-width: 560px; font-size: .92rem; background: var(--card); }
.prose .compare th { background: var(--sand); text-align: left; }
.prose .compare tr:first-child td { background: var(--brand-soft); }
.prose .wp-block-details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.prose .wp-block-details summary { cursor: pointer; font-weight: 600; }
.prose .founder { margin: 16px 0; padding: 18px 20px; border-left: 4px solid var(--brand); background: var(--card); border-radius: 0 var(--r) var(--r) 0; font-family: var(--serif); font-size: 1.1rem; }
.prose .founder cite { display: block; margin-top: 8px; font-family: var(--font); font-size: .9rem; font-style: normal; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { display: flex; gap: 14px; align-items: baseline; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.timeline b { font-family: var(--serif); font-size: 1.2rem; color: var(--brand-ink); min-width: 3.2em; }
.timeline p { margin: 0; }
@media (min-width: 900px) { .timeline { grid-template-columns: repeat(4, 1fr); } .timeline li { display: block; } }
.tips .tip { margin: 0 0 12px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--r); }
.tips .tip h3 { margin: 0 0 4px; }
.tips .tip p { margin: 0; color: var(--ink-2); }
.tips .tip:first-of-type { border-left-color: var(--danger); background: #FFF6F4; }
.safe-help { margin-top: 20px; font-weight: 600; }
.safe-help a { color: var(--brand-ink); }
.contact-ways { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 20px; }
.contact-form { margin-top: 24px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.contact-form h2 { margin: 0; }
.contact-form .btn { margin-top: 16px; }

.auth-why { list-style: none; margin: 4px 0 16px; padding: 0; display: grid; gap: 6px; color: var(--ink-2); font-size: .92rem; }
.auth-why li { display: flex; align-items: center; gap: 8px; }
.auth-why svg { color: var(--brand); flex: none; }
.auth-trust { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 14px; }

/* Tap feedback */
.nav-bar { position: fixed; top: 0; left: 0; z-index: 200; height: 3px; width: 0; background: var(--brand); opacity: 0; pointer-events: none; transition: opacity .2s; }
.nav-bar.is-on { opacity: 1; animation: nav-bar 8s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes nav-bar { from { width: 0; } to { width: 92%; } }
.btn:active, .chip:active, .tabbar a:active, .card-link:active { transform: scale(.97); }
.btn:active { filter: brightness(.94); }
a[aria-busy="true"] { pointer-events: none; opacity: .75; }
@media (prefers-reduced-motion: reduce) { .nav-bar.is-on { animation: none; width: 92%; } .btn:active, .chip:active, .tabbar a:active, .card-link:active { transform: none; } }

/* Plans page: centred on wide screens, cards sized to their number */
.packages .listing-head.center .lede { margin-left: auto; margin-right: auto; }
.packages .listing-head.center .pill { display: table; margin: 8px auto 0; }
@media (min-width: 900px) {
  .packages .plans { grid-template-columns: repeat(auto-fit, minmax(220px, 270px)); justify-content: center; }
}
