/* =========================================================
   JOINTRIP — app.css
   The phone look: loaded only on screens up to 880px wide (media attribute on the <link>),
   after style.css, so desktop is never affected. It turns the site into an app:
   slim top bar with a back arrow, role-based bottom tabs, no website footer, smaller
   calmer type, compact cards and lists, and pop-ups that slide up as bottom sheets.
   Nothing here changes what a page does, only how it looks.
   ========================================================= */
:root { --hd: 54px; --tab-h: 62px; --r: 16px; --r-sm: 12px; }

/* ---------- type: app sizes ---------- */
body { font-size: .9375rem; line-height: 1.5; }
h1 { font-size: 1.5rem; letter-spacing: -.025em; line-height: 1.15; }
h2 { font-size: 1.15rem; line-height: 1.2; }
h3 { font-size: 1rem; line-height: 1.25; }
.eyebrow { font-size: .68rem; letter-spacing: .1em; }
.muted, small { font-size: .8rem; }
.section { padding-block: 22px; }
.section.tight { padding-block: 16px 22px; }
.sec-head { margin-bottom: 14px; gap: 10px; align-items: center; flex-wrap: nowrap; }
.sec-head h2 { font-size: 1.12rem; margin-top: 2px; }
.sec-head p { font-size: .86rem; margin-top: 4px; }
.sec-head .eyebrow { display: none; }
.sec-head .link { font-size: .85rem; flex: none; }
.veh-title, .dash-head h1, .ex-head h1 { font-size: 1.45rem; }

/* ---------- buttons and fields: thumb-sized, not bigger ---------- */
.btn { min-height: 44px; padding: 0 18px; font-size: .9rem; }
.btn-lg { min-height: 48px; font-size: .95rem; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .8rem; }
.icon-btn { width: 38px; height: 38px; }
input, select, textarea { font-size: 16px !important; } /* 16px stops iPhones zooming into a field */
.field > span, .field label { font-size: .82rem; }

/* ---------- top bar ---------- */
.app-header { border-bottom-color: transparent; box-shadow: 0 1px 0 var(--line); }
.hd { gap: 10px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
.logo { font-size: 1.15rem; gap: 8px; }
.logo-mark { width: 28px; height: 28px; }
#themeBtn { display: none; } /* Appearance lives in Profile / More */
.hd-right .btn { min-height: 34px; padding: 0 14px; font-size: .82rem; }
.hd-right .av.sm { width: 32px; height: 32px; }
/* inner pages: back arrow + page name, like an app screen */
.hd-back { display: grid; width: 36px; height: 36px; border: 0; background: none; margin-left: -6px; }
.hd-back .ic { width: 22px; height: 22px; }
html:not(.pg-root) .logo { display: none; }
html:not(.pg-root) .hd-title { display: block; flex: 1; min-width: 0; font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* tab pages other than Home: the page name as a large title in the bar */
html.pg-root:not(.pg-home) .logo { display: none; }
html.pg-root:not(.pg-home) .hd-title { display: block; flex: 1; font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -.025em; }
/* the account button sits in the Profile tab instead */
.hd-account .hd-me { display: none; }

/* ---------- bottom tabs ---------- */
.tabbar { grid-template-columns: repeat(var(--tabs, 4), 1fr); padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -1px 0 var(--line); border-top: 0; }
.tabbar a, .tabbar button { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 50px; padding: 4px 0; border: 0; background: none; font: inherit; font-size: .66rem; font-weight: 600; color: var(--muted); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tabbar a .ic, .tabbar button .ic { width: 23px; height: 23px; }
.tabbar a[aria-current] { color: var(--fg); }
.tabbar a[aria-current] .ic { color: var(--brand); }
.tabbar .tab-pub .ic { width: 42px; height: 30px; padding: 5px 10px; border-radius: 11px; margin-top: 0; }
.tabbar .tab-me .av { width: 25px; height: 25px; font-size: .6rem; border: 2px solid transparent; }
.tabbar .tab-me[aria-current] .av { border-color: var(--brand); }
body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); }
#toast { bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom, 0px)); font-size: .85rem; padding: 10px 16px; max-width: calc(100vw - 32px); white-space: normal; text-align: center; }

/* ---------- no website footer on phones (its links are in Profile / More) ---------- */
.app-footer { display: none; }

/* ---------- "More" list (Profile page and the More sheet) ---------- */
.ac-more { display: block; margin-top: 18px; }
.ml { display: grid; gap: 14px; }
.ml-group { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ml-group:empty { display: none; }
.ml-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--fg); font: inherit; font-size: .92rem; text-align: left; text-decoration: none; cursor: pointer; }
.ml-row:first-child { border-top: 0; }
.ml-row:active { background: var(--surface-2); }
.ml-row > .ic:first-child { width: 20px; height: 20px; color: var(--fg-2); }
.ml-row > span { flex: 1; }
.ml-chev { width: 16px; height: 16px; color: var(--muted); }
.ml-val { font-style: normal; color: var(--muted); font-size: .85rem; }
.ml-out { color: var(--coral); justify-content: center; }
.ml-out > .ic:first-child { color: var(--coral); }
.ml-out > span { flex: none; }
.ml-in { color: var(--brand-text); font-weight: 600; }
.ml-in > .ic:first-child { color: var(--brand-text); }
.ml-foot { text-align: center; color: var(--muted); font-size: .74rem; padding: 4px 0 8px; }
.ml-foot a { color: inherit; }

/* ---------- pop-ups become bottom sheets ---------- */
.dlg, .auth-dlg { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 88vh; overflow: auto; animation: sheetUp .26s cubic-bezier(.2, .8, .2, 1); padding-bottom: env(safe-area-inset-bottom, 0px); }
.dlg::backdrop, .auth-dlg::backdrop { background: rgba(10, 8, 6, .45); backdrop-filter: none; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } }
.dlg form { padding: 22px 18px 18px; gap: 14px; }
.dlg h2 { font-size: 1.15rem; }
.dlg-acts { flex-direction: column-reverse; flex-wrap: nowrap; gap: 8px; }
.dlg-acts .btn { flex: none !important; width: 100%; }
.dlg form::before, .auth-dlg-in::before, .sheet-grab { content: ''; display: block; width: 38px; height: 5px; border-radius: 9px; background: var(--line); margin: -8px auto 2px; }
.auth-dlg-in { padding: 22px 20px 20px; gap: 12px; }
.auth-dlg h2 { font-size: 1.25rem; }
.auth-x { top: 12px; right: 12px; }
.sheet-in { display: grid; gap: 14px; padding: 18px 16px 20px; }
.sheet-in h2 { font-size: 1.15rem; padding-left: 4px; }
.sheet .sheet-grab { margin: -4px auto 0; }
.rv-sheet { width: 100vw; max-height: 92vh; }
.rvs-hero { height: 104px; }
.rvs-stars button { width: 52px; height: 52px; }

/* ---------- home: a short feed ---------- */
.m-hide { display: none !important; }
.m-only { display: block; }
.hero { background: var(--bg); }
.hero::after { display: none; }
.hero-in { padding-block: 18px 6px; gap: 0; grid-template-columns: minmax(0, 1fr); }
.hero-in > * { min-width: 0; }
.hero h1 { font-size: 1.6rem; line-height: 1.12; }
.hero h1 em { display: block; }
.hero-lead { font-size: .9rem; margin: 6px 0 16px; }
.who { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gut)) 10px; padding: 0 var(--gut); }
.who::-webkit-scrollbar { display: none; }
.who-q { display: none; }
.who button { flex: none; padding: 7px 12px 7px 10px; font-size: .82rem; }
.who button .ic { width: 15px; height: 15px; }
.who-line { font-size: .82rem; min-height: 0; margin-bottom: 12px; }
.search { box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -14px rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 18px; padding: 4px; gap: 2px; }
.search label { padding: 8px 12px; border-radius: 12px; }
.search label > span:first-child { font-size: .64rem; }
.search .btn { min-height: 46px; border-radius: 13px; }
.hero-proof { gap: 6px 14px; margin-top: 14px; font-size: .76rem; }
.hero-proof .ic { width: 14px; height: 14px; }
.m-cats { padding-block: 10px 4px !important; }
.hero-routes { display: none !important; } /* phones: the trip carousel below does this job */
.m-cats .rail { margin: 0 calc(-1 * var(--gut)); padding: 0 var(--gut) 4px; }
.m-featured { padding-top: 14px !important; }
/* home: trips as a sideways carousel */
.m-featured .grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gut); gap: 12px; margin: 0 calc(-1 * var(--gut)); padding: 2px var(--gut) 8px; scrollbar-width: none; }
.m-featured .grid::-webkit-scrollbar { display: none; }
.m-featured .grid > * { flex: 0 0 78%; scroll-snap-align: start; }
.m-more { padding-block: 6px 26px; }
.m-more .wrap { display: grid; gap: 10px; }
.m-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); text-decoration: none; color: var(--fg); }
.m-link > span:nth-child(2) { flex: 1; display: grid; gap: 1px; }
.m-link b { font-size: .9rem; }
.m-link small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.m-link-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--surface); color: var(--brand-text); flex: none; }
.m-link-ic .ic { width: 19px; height: 19px; }
.m-link > span:last-child .ic, .ml-chev { width: 16px; height: 16px; color: var(--muted); transform: rotate(-90deg); } /* the chev icon points down */
.rail .cat { min-height: 0; padding: 7px 13px 7px 10px; font-size: .82rem; gap: 7px; border-radius: 999px; }
.rail .cat .ic { width: 16px; height: 16px; }

/* ---------- trip cards: compact ---------- */
.grid { gap: 12px; }
.tcard { border-radius: 16px; }
.tcard:hover { transform: none; box-shadow: none; }
.tc-media { aspect-ratio: 16 / 9; }
.tc-body { padding: 12px 14px 14px; gap: 6px; }
.tcard h3 { font-size: 1rem; }
.tc-route { font-size: .72rem; }
.tc-when, .tc-fill, .tc-host { font-size: .78rem; }
.tc-cat, .tc-hot, .tc-flag { font-size: .68rem; padding: 4px 8px; }
.tc-price b { font-size: 1.05rem; }
.tc-price small { font-size: .7rem; }
.tc-save { width: 34px; height: 34px; }
/* Explore and lists: photo on the left, details on the right (about 3 trips per screen) */
#exGrid .tcard, #myList .tcard, .list-cards .tcard { display: grid; grid-template-columns: 112px minmax(0, 1fr); }
#exGrid .tc-media, #myList .tc-media, .list-cards .tc-media { aspect-ratio: auto; height: 100%; min-height: 128px; }
#exGrid .tc-media > span:not(.ph-label), #myList .tc-media > span:not(.ph-label), .list-cards .tc-media > span:not(.ph-label) { display: none; }
#exGrid .tc-body, #myList .tc-body, .list-cards .tc-body { padding: 10px 12px; gap: 4px; }
#exGrid .seat-strip, #myList .seat-strip, .list-cards .seat-strip, #exGrid .tc-people, #myList .tc-people, .list-cards .tc-people { display: none; }
#exGrid .tc-save, #myList .tc-save, .list-cards .tc-save { top: 6px; left: 6px; right: auto; width: 30px; height: 30px; }

/* Explore: the bar already says "Explore"; search is one compact card */
.ex-head { padding-block: 10px 4px; border-bottom: 0; background: none; }
.ex-head .eyebrow, .ex-head h1 { display: none; }
.ex-head .search { grid-template-columns: 1fr 1fr; }
.ex-head .search .filter-btn { grid-column: 1 / -1; min-height: 40px; border: 0; border-radius: 12px; background: var(--surface-2); font-size: .85rem; }
#fRail { margin-top: 10px !important; margin-inline: calc(-1 * var(--gut)); padding: 0 var(--gut) 2px; }
.ex-head + .section { padding-top: 6px; }
.ex-bar { margin-bottom: 10px; }
.ex-bar p { font-size: .82rem; color: var(--muted); }
.ex-bar .select { min-height: 34px; padding-block: 0; font-size: .82rem !important; border-radius: 999px; }
.filters.open { padding: 14px; border-radius: 16px; margin-bottom: 12px; }
/* list cards: no host line or extra people, the price sits beside the route */
#exGrid .tc-host, #myList .tc-host, .list-cards .tc-host { display: none; }
#exGrid .tc-foot, #myList .tc-foot, .list-cards .tc-foot { margin-top: 2px; padding-top: 0; border: 0; }
#exGrid .tc-price, #myList .tc-price, .list-cards .tc-price { display: flex; align-items: baseline; gap: 4px; }
#exGrid .tc-price small, #myList .tc-price small { font-size: .7rem; }
#exGrid .tc-route, #myList .tc-route { font-size: .66rem; }

/* ---------- lists, panels, tables ---------- */
.card, .panel { border-radius: 16px; }
.panel { padding: 16px; }
.panel-head h2 { font-size: 1.02rem; }
.kpi { padding: 14px; border-radius: 16px; }
.kpi b { font-size: 1.35rem; }
.kpi small, .kpi .delta { font-size: .74rem; }
.notice { font-size: .84rem; border-radius: 14px; padding: 11px 13px; }
.tbl { font-size: .84rem; }
.tabs { margin-bottom: 14px; }
.tabs button { padding: 7px 14px; font-size: .86rem; }
.trip-row { padding: 10px; gap: 12px; border-radius: 16px; }
.trip-row h3 { font-size: .98rem; }
.trip-row p { font-size: .8rem; }

/* ---------- trip page ---------- */
.trip-hero .crumbs { display: none; }
.trip-hero h1 { font-size: 1.45rem; }
.trip-hero-in { padding-block: 70px 16px; }
.trip-hero .chips { gap: 6px; margin-top: 10px; }
.trip-hero .chips > * { font-size: .74rem; padding: 5px 10px; }
.trip-hero .chips .ic { width: 14px; height: 14px; }
.trip-main { gap: 22px; }
.trip-main h2, .seat-head h2 { font-size: 1.1rem; }
.lead { font-size: .95rem; line-height: 1.55; }
.vibes { gap: 6px; margin-top: 10px; }
.vibes > * { font-size: .78rem; padding: 5px 11px; }
.seat-head { gap: 8px; }
.like-pick { font-size: .8rem; }
.like-pick .select { min-height: 32px; font-size: .8rem !important; }
.legend { font-size: .72rem; gap: 6px 12px; }
.list-card { padding: 14px; border-radius: 14px; }
.list-card h3 { font-size: .95rem; }
.ticks li { font-size: .86rem; }
.stops li { font-size: .86rem; }
.host-card { padding: 14px; border-radius: 16px; }
#moreWrap .grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gut); gap: 12px; margin: 0 calc(-1 * var(--gut)); padding: 2px var(--gut) 8px; scrollbar-width: none; }
#moreWrap .grid > * { flex: 0 0 78%; scroll-snap-align: start; }

/* ---------- checkout: one clean form, the pay button always in reach ---------- */
body[data-page="checkout"] #coBack, body[data-page="checkout"] main h1 { display: none !important; }
body[data-page="checkout"] .section.tight { padding-top: 12px; }
.co-main { gap: 12px; }
.co-main > .card { padding: 16px; border-radius: 16px; }
.co-main h2 { font-size: 1.02rem; gap: 10px; }
.co-main h2 .n { width: 24px; height: 24px; font-size: .78rem; border-radius: 8px; }
.hold { padding: 10px 14px; font-size: .84rem; border-radius: 14px; }
.opts .opt { padding: 12px; border-radius: 14px; }
.opts .opt b { font-size: .9rem; }
.opts .opt small { font-size: .76rem; }
.summary { border-radius: 16px; }
.summary .sum-body { padding: 16px; }
.book-note { font-size: .78rem; }
body[data-page="checkout"] .tabbar { display: none; }
body[data-page="checkout"] { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
#payBtn { position: fixed; z-index: 75; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto; min-height: 50px; font-size: .95rem; box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
body[data-page="checkout"]::after { content: ''; position: fixed; z-index: 74; left: 0; right: 0; bottom: 0; height: calc(76px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--bg) 35%); pointer-events: none; }

/* ---------- tab pages: the bar shows the page name, so the page's own big heading goes ---------- */
.my-head, body[data-page="mytrips"] main .wrap > .eyebrow:first-child { display: none; }
.ac-back { display: none !important; } /* the bar has the back arrow; the Profile tab is always there */
body[data-page="account"] .ac-wrap > .eyebrow { display: none; }
.ac-photo .av.xl { width: 72px; height: 72px; font-size: 1.3rem; border-width: 3px; }
.ac-photo { flex-direction: row !important; align-items: center !important; gap: 14px; }
.ac-card { padding: 16px; gap: 14px; border-radius: 16px; }
.ac-app { padding: 14px; border-radius: 16px; }
body[data-page="account"] .veh-title { font-size: 1.1rem; margin-top: 4px; }
.dash-head { margin-bottom: 14px; gap: 10px; }
.dash-head .eyebrow, .dash-head p, .dash-head-acts { display: none; }
.dash-head h1 { font-size: 1.3rem; }
body[data-page="create"] .dash-head { display: none; }
.tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; }
.trip-row { grid-template-columns: 72px minmax(0, 1fr); align-items: start; }
.trip-row .slot { height: 72px; border-radius: 12px; }
.trip-row .acts .btn { min-height: 34px; padding: 0 13px; font-size: .8rem; }
.trip-row .status { font-size: .7rem; padding: 3px 8px; }
#upList h3, #upList b { font-size: .95rem; }
#upList p, #upList small, #upList .muted { font-size: .78rem; }
.kpis { gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; margin-bottom: 4px; }
.kpi.main { grid-column: 1 / -1; padding: 14px 16px; }
.kpi.main b { font-size: 1.7rem; }
.kpi.main .spark { height: 34px; }
.kpi:not(.main) { padding: 11px 12px; gap: 2px; }
.kpi:not(.main) b { font-size: 1.15rem; }
.kpi:not(.main) small { font-size: .68rem; line-height: 1.25; }
.kpi:not(.main) .delta { font-size: .66rem; line-height: 1.25; }
.ci-hero { padding: 16px; border-radius: 18px; }
.ci-hero h1 { font-size: 1.25rem; }
.ci-hero p { display: none; }
.wiz-steps button { font-size: .82rem; }
.wiz-steps button i { width: 24px; height: 24px; font-size: .75rem; }

/* ---------- decorations: the cut-out pictures and floating shapes are for big screens ---------- */
.cutout, .vec-float { display: none !important; }

/* ---------- ticket: the ticket itself is the screen ---------- */
.confirm-top { padding: 4px 0 14px; gap: 6px; }
.confirm-top .ok-ring { width: 46px; height: 46px; }
.confirm-top .ok-ring .ic { width: 22px; height: 22px; }
.confirm-top h1 { font-size: 1.35rem; }
.confirm-top p { font-size: .86rem; }
.ticket { border-radius: 20px; }
.tk-main { padding: 18px; gap: 12px; }
.tk-route { font-size: 1.25rem; gap: 10px; }
.tk-route b, .tk-route span { font-size: 1.25rem; }
.tk-grid { gap: 10px 14px; }
.tk-grid small, .tk-grid dt { font-size: .64rem; }
.tk-grid b, .tk-grid dd { font-size: .9rem; }
.tk-side { padding: 20px 18px; }
.tk-care, .tk-host { padding: 13px 14px; border-radius: 16px; gap: 10px; margin-top: 12px; }
.tk-care b { font-size: .9rem; }
.tk-care p { font-size: .82rem; }
.next-steps { gap: 10px; margin-top: 14px; }
.next-steps .card { padding: 13px 14px; grid-template-columns: auto 1fr; align-items: center; gap: 2px 12px; }
.next-steps .card .ic { grid-row: span 2; }
.next-steps h3 { font-size: .92rem; }
.next-steps p { font-size: .8rem; }

/* ---------- sticky "Book" bar on the trip page ---------- */
.mbar { bottom: 0; padding-top: 10px; box-shadow: 0 -1px 0 var(--line), 0 -10px 24px -18px rgba(0,0,0,.3); }
.mbar b { font-size: 1.12rem; }
.mbar .btn { min-height: 46px; padding: 0 22px; }
body.has-mbar { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

/* ---------- smooth scrolling ----------
   A see-through bar with backdrop-filter: blur() makes the phone re-blur everything that scrolls
   under it, every frame; over the ticket (shadows, torn edges, QR) that is what made scrolling stutter.
   Solid bars look the same and cost nothing. */
.app-header, .tabbar, .mbar { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.app-header, .tabbar { background: var(--surface); }
/* the scanned ticket: its torn-paper shadow is drawn once into its own layer, which the phone then
   only moves while scrolling (one soft shadow instead of two) */
.ticket.used { filter: drop-shadow(0 8px 12px rgba(20, 16, 8, .15)); transform: translateZ(0); }
.ticket:not(.used), #tkQR { transform: translateZ(0); }
/* page fades between pages stay, but short */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .12s; }

/* ---------- search landing pages (routes/, trips/, about/) ---------- */
.lp-hero { padding-block: 14px 16px; }
.lp-crumbs { display: none; } /* the bar has the back arrow; the breadcrumb data is still in the page */
.lp-hero h1 { font-size: 1.5rem; }
.lp-lead { font-size: .92rem; margin: 8px 0 14px; }
.lp-facts { grid-template-columns: 1fr 1fr; gap: 8px; }
.lp-facts li { padding: 9px 11px; border-radius: 12px; }
.lp-facts li:last-child { grid-column: 1 / -1; }
.lp-facts b { font-size: .84rem; }
.lp-body { gap: 20px; }
.lp-body h2 { font-size: 1.08rem; }
.lp-body p, .lp-body li { font-size: .9rem; }

/* ---------- motion: quick, small ---------- */
.btn:active, .ml-row:active, .m-link:active, .tcard:active { transform: scale(.985); }
* { -webkit-tap-highlight-color: transparent; }
