/* VESTA mobile UX pass (branch mobile-ux). Loaded last.
   House style: Newsreader + Inter (unchanged), bone #F6F3EE, ink #1D1B18, muted #6F6A63, fades only (no slides/scales).
   Shared pieces (filter sheet, browse cards, date strip, booking summary) work at every width;
   layout changes that only make sense on a phone are scoped to max-width 859px (the existing tab breakpoint). */
:root { --m-bone: #F6F3EE; --m-ink: #1D1B18; --m-muted: #6F6A63; --m-line: rgba(29,27,24,0.12); --mbar-h: 64px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- verified mark (only when the API says verified) and tags ---------- */
.verified { display: inline-flex; vertical-align: middle; margin-left: 6px; color: var(--m-ink); }
.verified svg { fill: var(--m-ink); }
.tag { display: inline-block; font-size: 12px; color: var(--m-muted); border: 1px solid var(--m-line); border-radius: 999px; padding: 2px 10px; }

/* ---------- catalog ---------- */
.catalog-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.catalog-search input { min-width: 0; min-height: 48px; font-size: 16px; box-sizing: border-box; }
.catalog-search .btn { min-height: 48px; }
.quick-row { display: flex; gap: 8px; align-items: center; margin: 4px 0 12px; min-width: 0; }
.quick-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; min-width: 0; padding: 2px 0; }
.quick-chips::-webkit-scrollbar { display: none; }
.quick-chips .chip { flex: 0 0 auto; white-space: nowrap; }
.filter-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.filter-btn svg, .back-link svg, .mbar svg, .trust-rows svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.recent-row { display: flex; gap: 10px; align-items: center; margin: 0 0 12px; }
.recent-row .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.recent-row .chip { flex: 0 0 auto; }

.reader-card { padding: 14px; align-items: start; grid-template-columns: 72px minmax(0, 1fr); transition: opacity .15s; }
.reader-card img, .reader-card .avatar { width: 72px; height: 72px; border-radius: 20px; }
.reader-card:active { opacity: .7; }
.rc-name { font-size: 16px; }
.rc-line { margin: 2px 0 6px; }
.rc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.rc-price { font-size: 14px; margin-bottom: 2px; }

/* filter bottom sheet */
.fsheet[hidden] { display: none; }
.fsheet { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; animation: mfade .2s ease; }
.fsheet-scrim { position: absolute; inset: 0; background: rgba(29,27,24,0.32); }
.fsheet-panel { position: relative; width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--m-bone); color: var(--m-ink); border-radius: 20px 20px 0 0; }
.fsheet-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 0 20px; }
.fsheet-head h2 { font-family: var(--font-serif); font-weight: 400; font-size: 26px; margin: 0; }
.fsheet-x { min-height: 44px; min-width: 44px; padding: 0 14px; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--m-muted); }
.fsheet-body { overflow-y: auto; padding: 8px 20px 16px; }
.fsheet fieldset { border: 0; margin: 0 0 16px; padding: 0; }
.fsheet legend { font-size: 13px; font-weight: 500; color: var(--m-muted); margin-bottom: 8px; padding: 0; }
.fchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip input { position: absolute; opacity: 0; pointer-events: none; }
.fchip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--m-line); background: #fff; font-size: 14px; cursor: pointer; transition: background .15s, color .15s; }
.fchip input:checked + span { background: var(--m-ink); color: var(--m-bone); border-color: var(--m-ink); }
.fchip input:focus-visible + span { outline: 2px solid var(--m-ink); outline-offset: 2px; }
.fsheet .field input, .fsheet .field select { background: #fff; min-height: 48px; }
.fsheet-foot { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--m-line); background: var(--m-bone); }
.fsheet-foot .btn { min-height: 48px; justify-content: center; }
body.sheet-open { overflow: hidden; }
@media (min-width: 860px) { .fsheet { align-items: center; } .fsheet-panel { border-radius: 20px; } }

/* ---------- profile ---------- */
.desk-meta { margin: 6px 0 4px; }
.desk-price { margin: 0 0 12px; font-size: 15px; }
.desk-price .num { font-size: 18px; }
.trust-rows { list-style: none; padding: 0; margin: 4px 0 16px; display: grid; gap: 10px; font-size: 14px; }
.trust-rows li { display: flex; gap: 10px; align-items: center; color: var(--m-ink); }
.trust-rows svg { color: var(--m-muted); flex: 0 0 auto; }
.next-row { margin: 0 0 12px; }
.next-row .small { margin: 0 0 6px; }
.next-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.next-chips .see-all { background: transparent; border: 1px solid var(--m-line); }
.sticky-book .book-cta { flex: 1; justify-content: center; text-align: center; min-height: 48px; display: inline-flex; align-items: center; }

/* ---------- booking ---------- */
.back-face { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; font-size: 14px; background: var(--pill-bg); }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--m-muted); }
.step-h { font-family: var(--font-sans); font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--m-muted); margin: 18px 0 8px; }
.len-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.len-grid .len { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 8px 14px; border: 1px solid var(--m-line); border-radius: 14px; background: #fff; font: inherit; font-size: 14px; color: var(--m-ink); text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.len-grid .len .num { font-size: 13px; color: var(--m-muted); }
.len-grid .len.on { background: var(--m-ink); color: var(--m-bone); border-color: var(--m-ink); }
.len-grid .len.on .num { color: var(--m-bone); }
.date-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; scroll-snap-type: x proximity; }
.date-strip::-webkit-scrollbar { display: none; }
.day { flex: 0 0 auto; width: 58px; min-height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 1px solid var(--m-line); border-radius: 14px; background: #fff; font: inherit; color: var(--m-ink); cursor: pointer; scroll-snap-align: start; transition: background .15s, color .15s; }
.day .d-wd, .day .d-mo { font-size: 11px; color: var(--m-muted); }
.day .d-n { font-size: 20px; font-weight: 500; }
.day.on { background: var(--m-ink); border-color: var(--m-ink); color: var(--m-bone); }
.day.on .d-wd, .day.on .d-mo { color: var(--m-bone); }
.tz-note { margin: 6px 0 0; }
.slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot-grid button.slot { min-height: 48px; padding: 0 6px; font-size: 14px; transition: background .12s, color .12s; }
.book-summary { position: sticky; bottom: 0; z-index: 26; display: flex; align-items: center; gap: 12px; margin: 16px -20px 0; padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); background: var(--m-bone); border-top: 1px solid var(--m-line); }
.bs-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; color: var(--m-muted); }
.bs-text strong { font-size: 15px; font-weight: 500; color: var(--m-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-summary .btn { min-height: 48px; flex: 0 0 auto; opacity: .55; transition: opacity .15s; }
.book-summary .btn.ready { opacity: 1; }

/* ---------- bottom tab bar (phones) ---------- */
.mbar { display: none; }
@keyframes mfade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fsheet { animation: none; } * { transition: none !important; } }

@media (max-width: 859px) {
  html, body { overflow-x: clip; }   /* safety net only (clip keeps position:sticky working); the causes are fixed above */
  .mbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--m-bone); border-top: 1px solid var(--m-line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--mbar-h); font-size: 11px; font-weight: 500; color: var(--m-muted); transition: color .15s; }
  .mbar a.on { color: var(--m-ink); }
  .mbar a.on svg { stroke-width: 2; }
  .has-mbar .tabs, .has-mbar .pills { display: none; }
  .has-mbar .with-rail { padding-bottom: calc(var(--mbar-h) + env(safe-area-inset-bottom)); }
  .has-mbar .feed, .has-mbar .feed-item { height: calc(100vh - var(--mbar-h) - env(safe-area-inset-bottom)); }
  .has-mbar .with-rail:has(.feed) { padding-bottom: 0; }
  .has-mbar .sticky-book { bottom: calc(var(--mbar-h) + env(safe-area-inset-bottom)); background: var(--m-bone); backdrop-filter: none; border-top: 1px solid var(--m-line); }
  .has-mbar .book-summary { bottom: calc(var(--mbar-h) + env(safe-area-inset-bottom)); padding-bottom: 10px; }
  .has-mbar .v3-sheet, .has-mbar .sheet { z-index: 60; }

  /* Sign in / For readers: part of the page header, scrolls away with it (no floating overlay). */
  .corner { position: absolute; top: 8px; right: 12px; gap: 4px; }
  .corner-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }
  .corner-pill { min-height: 44px; height: auto; }
  a.corner-pill#for-readers, body:has(.lp) a.corner-pill#for-readers { height: 44px; background: var(--m-bone); color: var(--m-ink); border: 1px solid var(--m-ink); box-shadow: none; }   /* outlined: the page keeps one filled button */
  .lp-card h3 a, .lp-name a { display: inline-flex; align-items: center; min-height: 44px; }
  .corner-menu { top: 52px; }

  /* 44px tap targets */
  .chip, .lp-chip, .intent-chips .chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; font-size: 14px; box-sizing: border-box; }
  span.chip { min-height: 32px; }   /* read-only labels, not tappable */
  .btn, a.btn, button.btn, .btn.slim, .seg button, .seg a, .sleek, .lp-btn-outline, .lp-play { min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
  .topbar .wordmark, .lp-bar .wordmark { display: inline-flex; align-items: center; min-height: 44px; }
  .footer nav { gap: 0 4px; }
  .footer nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
  .lp a.lp-link, .lp-link { display: inline-flex; align-items: center; min-height: 44px; }
  .list-line a, .section-head a.small { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }
  .stars button { width: 44px; height: 44px; }
  .field input, .field select, .field textarea { min-height: 48px; font-size: 16px; box-sizing: border-box; }
  .desk-hero { padding-bottom: 40px; }
  .wide { padding-bottom: 32px; }
}

/* ---------- circular Reader photos: the photo fills the circle edge to edge ----------
   The circle (wrapper or the face itself) clips with overflow:hidden + 50% radius; the img
   fills it at 100% with object-fit:cover, framed a little high so faces stay in view. */
.story-face, .story-face.mini { overflow: hidden; border-radius: 50%; padding: 0; background: transparent; flex: none; line-height: 0; }
.reader-card .story-face { width: 72px; height: 72px; }
.story-face > img, .story-face > .avatar, .story-face > .desk-photo,
.reader-card .story-face > img, .reader-card .story-face > .avatar {
  display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0;
  border-radius: 50%; object-fit: cover; object-position: center 25%; aspect-ratio: auto;
}
.story-face > .avatar, .story-face > div.desk-photo { display: grid; place-items: center; line-height: 1; }
.story-face.mini { width: 84px; height: 84px; }
.story-face:has(> .desk-photo) { width: 168px; height: 168px; }
.back-face, .corner-face, .c-face, .v3-avatar, .v3-pf-photo, .intent-head .avatar, .acct-mem-head .avatar,
.story-tray-item img, .v3-call-connecting img {
  overflow: hidden; border-radius: 50% !important; padding: 0; border: 0; flex: none;
  object-fit: cover; object-position: center 25%;
}
