/* Native-style app shell. Active on phones and when installed (body.app-mode, set in app.js). */
.m-only { display: none !important; }
.app-mode .m-only { display: flex !important; }
.app-mode .d-back, .app-mode .dash-head, .app-mode .page-head h1 { display: none !important; }

.app-mode { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain; background: var(--bg); }
.app-mode .wrap { padding-left: 16px; padding-right: 16px; }
.app-mode .input, .app-mode .textarea, .app-mode select, .app-mode input { font-size: 16px; } /* stops iOS zooming into fields */
.app-mode .abar, .app-mode .tabbar, .app-mode .chip, .app-mode .btn { -webkit-user-select: none; user-select: none; }
.app-mode .btn:active, .app-mode .qa:active, .app-mode .cat-tile:active { transform: scale(.97); }
.app-mode .card:active, .app-mode .list-item:active, .app-mode .ios-row:active, .app-mode .thread:active { background: #f1f1ee; }
.app-mode .talent-card:hover { transform: none; box-shadow: none; }
.app-mode main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); min-height: 60vh; }
.app-mode.no-tabs main { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.app-mode.has-dock main { padding-bottom: calc(118px + env(safe-area-inset-bottom)); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Top app bar */
.abar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 4px; min-height: calc(54px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 6px 0; background: rgba(250, 250, 248, .88); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: .5px solid transparent; transition: border-color .2s; }
.abar.scrolled { border-bottom-color: var(--line-2); }
.abar-title { flex: 1; min-width: 0; text-align: center; font-size: 17px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abar-root .abar-title { text-align: left; font-size: 30px; font-weight: 800; letter-spacing: -.035em; padding: 4px 0 0 10px; }
.abar-push .abar-r { min-width: 44px; }
.abar-home { justify-content: space-between; padding-left: 16px; padding-right: 10px; }
.abar-home .logo { font-size: 21px; }
.abar-r { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }
.abar-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 0; background: none; color: var(--ink); position: relative; cursor: pointer; flex: none; }
.abar-btn:active { background: #ebebe8; }
.dot-badge { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: #ff3b30; border: 2px solid var(--bg); }

/* Bottom tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: flex; background: rgba(255, 255, 255, .9); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--line-2); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding-top: 6px; font-size: 10.5px; font-weight: 600; color: #9a9aa2; position: relative; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on .tb-ico svg { stroke-width: 2.4; }
.tabbar a.center .tb-ico { width: 46px; height: 34px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.tabbar a.center { color: var(--ink); }
.badge { position: absolute; top: 5px; left: calc(50% + 5px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff3b30; color: #fff; font-size: 11px; font-weight: 700; font-style: normal; display: grid; place-items: center; }
.badge.static { position: static; flex: none; }

/* Docked primary actions (Hire, Submit proposal, Confirm…) and chat composer */
#dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 65; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--line-2); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
#dock:empty { display: none; }
#dock .btn { margin-top: 0 !important; }
#dock .btn + .btn { margin-top: 8px !important; }
#dock .note { font-size: 12.5px; padding: 8px 12px; margin: 0 0 8px !important; }
#dock .note:last-child { margin-bottom: 0 !important; }
#dock .cta-row { display: flex; gap: 8px; }
#dock .cta-row .btn { margin: 0 !important; }
#dock .cta-row .cta-msg { flex: 0 0 auto; width: auto; padding: 0 16px; }
#dock .cta-row .btn-lg { flex: 1; }
#dock .hire-dock { display: flex; align-items: center; gap: 12px; }
#dock .hire-dock .btn { flex: 1; }
.cta-sum { flex-direction: column; font-size: 12px; line-height: 1.2; }
.cta-sum b { font-size: 17px; }
#dock .composer { display: flex; gap: 8px; align-items: center; }
.composer .input { border-radius: 999px; height: 44px; background: #f4f4f1; border-color: transparent; }
.send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; cursor: pointer; }

/* Transitions */
.app-mode main.push-in { animation: pushIn .3s cubic-bezier(.2, .8, .2, 1); }
.app-mode main.pop-in { animation: popIn .3s cubic-bezier(.2, .8, .2, 1); }
.app-mode main.fade-in { animation: fadeIn .22s ease; }
@keyframes pushIn { from { transform: translateX(36px); opacity: 0; } }
@keyframes popIn { from { transform: translateX(-36px); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }

/* Pull to refresh */
#ptr { height: 0; overflow: hidden; display: none; align-items: flex-end; justify-content: center; color: var(--ink-3); transition: height .2s; }
.app-mode #ptr { display: flex; }
#ptr span { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 8px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); }
#ptr.ready { color: var(--accent); }
#ptr.spin span { animation: spin .7s linear infinite; }

/* Bottom sheets instead of centered modals */
.app-mode .modal-bg { align-items: flex-end; padding: 0; }
.app-mode .modal { max-width: none; border-radius: 22px 22px 0 0; padding: 10px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 90vh; animation: sheetUp .3s cubic-bezier(.2, .8, .2, 1); }
.app-mode .modal::before { content: ''; display: block; width: 38px; height: 5px; border-radius: 3px; background: #d6d6d2; margin: 0 auto 14px; }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-title { font-size: 19px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 12px; }
.sheet-filters h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 16px 0 8px; }
.sheet-filters { display: block; }
.sheet-filters .opt { display: inline-flex; margin: 0 6px 6px 0; border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 14px; }
.sheet-filters .opt .count { display: none; }
.app-mode .toast { bottom: calc(92px + env(safe-area-inset-bottom)); border-radius: 14px; max-width: calc(100% - 32px); text-align: center; }
.app-mode .lightbox { padding: calc(20px + env(safe-area-inset-top)) 12px calc(20px + env(safe-area-inset-bottom)); }
.app-mode .lightbox .lb-nav { display: none; }

/* List screens */
.app-mode .filters { display: none !important; }
.app-mode .browse { display: block; padding-bottom: 20px; }
.app-mode .page-head { padding: 4px 16px 10px; }
.app-mode .toolbar { margin-bottom: 12px; }
.app-mode .toolbar .select { height: 40px; }
.chipbar { gap: 8px; overflow-x: auto; padding: 4px 16px 6px; scrollbar-width: none; }
.chipbar::-webkit-scrollbar { display: none; }
.chipbar .chip { flex: none; height: 34px; padding: 0 14px; font-size: 13.5px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; }
.chipbar .chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.app-mode .talent-card { border-radius: 18px; }
.app-mode .grid-2c, .app-mode .grid-2, .app-mode .grid-3 { grid-template-columns: 1fr; gap: 14px; }

/* Detail screens */
.app-mode .profile-hero { padding-top: 6px !important; }
.app-mode .profile-id { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.app-mode .profile-id h1 { justify-content: center; font-size: 25px; }
.app-mode .profile-id .row.wrap-row { justify-content: center; }
.app-mode .portfolio { grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 0 -16px; }
.app-mode .portfolio .item { border-radius: 0; }
.app-mode .profile-grid { gap: 18px; padding-bottom: 20px; }
.app-mode .side-card { box-shadow: none; }
.app-mode .timeline div { font-size: 10.5px; }

/* Forms: keep the main button reachable above the keyboard/home indicator */
.app-mode .form-shell { padding-top: 12px; }
.app-mode .form-shell form > .btn-lg:last-child,
.app-mode .form-shell form > .row.between:last-child { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 5; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.app-mode .form-shell form > .row.between:last-child { background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-radius: 18px; padding: 8px; border: 1px solid var(--line); }
.app-mode .seg { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }

/* App home */
.app-home { padding-top: 4px; }
.hello { font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.app-search { display: flex; align-items: center; gap: 10px; margin-top: 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 0 14px; height: 50px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
.app-search input { flex: 1; border: 0; outline: 0; background: none; min-width: 0; height: 100%; }
.cat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.cat-tile { position: relative; aspect-ratio: 1 / 1.05; border-radius: 16px; overflow: hidden; background: #ddd; display: flex; align-items: flex-end; color: #fff; isolation: isolate; transition: transform .1s; }
.cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.cat-tile::before { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0, 0, 0, .65)); z-index: -1; }
.cat-tile span { display: flex; align-items: center; gap: 5px; padding: 10px; font-size: 13px; font-weight: 700; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 0 12px; }
.sec-h h2 { font-size: 20px; font-weight: 800; letter-spacing: -.025em; }
.sec-h a { font-size: 14px; font-weight: 600; color: var(--accent); }
.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 16px 4px; margin: 0 -16px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.mini-t { flex: 0 0 188px; scroll-snap-align: start; scroll-margin-left: 16px; }
.mini-t .img { aspect-ratio: 4 / 3.3; border-radius: 16px; overflow: hidden; position: relative; background: #eee; }
.mini-t .img img { width: 100%; height: 100%; object-fit: cover; }
.rate-pill { position: absolute; left: 8px; bottom: 8px; background: rgba(255, 255, 255, .94); border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 700; }
.stack-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.stack-list > *, .job-row .row > * { min-width: 0; }
.job-row { display: block; padding: 14px 16px; border-radius: 16px; }
.qgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qa { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-align: center; transition: transform .1s; }
.qa .ico { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 14px 10px; }
.trust div { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.trust span { width: 32px; height: 32px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.join-card { margin-top: 14px; padding: 18px; background: var(--ink); color: #fff; border-color: var(--ink); }
.join-card .muted { color: #b9b9c2; }
.join-card .btn { background: #fff; color: var(--ink); }
.earn { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-top: 16px; background: var(--ink); color: #fff; border-color: var(--ink); }
.earn > div { flex: 1; display: flex; flex-direction: column; }
.earn .muted { color: #a9a9b2; font-size: 12.5px; }
.earn b { font-size: 22px; letter-spacing: -.03em; }
.install-card { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; }
.install-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--ink); display: grid; place-items: center; flex: none; }
.install-ico .logo-mark { background: transparent; border: 2.5px solid #fff; width: 22px; height: 22px; border-radius: 6px; }
.install-steps { padding-left: 20px; margin: 0 0 18px; line-height: 1.7; }
.install-steps svg { vertical-align: -3px; }

/* Account (settings-style lists) */
.me-card { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 18px; }
.welcome-card { padding: 24px 20px; text-align: center; margin-bottom: 22px; }
.welcome-card .logo-mark { display: inline-block; margin-bottom: 12px; }
.welcome-card h2 { font-size: 22px; margin-bottom: 6px; }
.welcome-card p.muted { margin-bottom: 18px; }
.ios-h { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 6px 8px; font-weight: 600; }
.ios-group { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 18px; }
.ios-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; min-height: 52px; border: 0; border-bottom: .5px solid var(--line); background: none; font-size: 15.5px; text-align: left; cursor: pointer; color: var(--ink); }
.ios-row:last-child { border-bottom: 0; }
.ios-row .grow { flex: 1; }
.ios-row.danger { color: #d92d20; }
.ios-row.danger .ios-ico { background: #fdecec; color: #d92d20; }
.ios-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: #f1f1ee; color: var(--ink-2); flex: none; }
.ios-select { border: 0; background: #f1f1ee; border-radius: 10px; height: 34px; padding: 0 8px; font-weight: 600; font-size: 14px; }

/* Inbox + chat */
.thread-list { background: var(--surface); border-top: .5px solid var(--line); border-bottom: .5px solid var(--line); }
.thread { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: .5px solid var(--line); }
.thread:last-child { border-bottom: 0; }
.thread .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0 4px; }
.chat { display: flex; flex-direction: column; gap: 5px; padding: 10px 0 12px; }
.chat-day { align-self: center; font-size: 11.5px; color: var(--ink-3); margin: 12px 0 6px; font-weight: 600; }
.bub { max-width: 80%; padding: 9px 13px; border-radius: 19px; font-size: 15.5px; line-height: 1.35; white-space: pre-line; word-wrap: break-word; }
.bub.out { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.bub.in { align-self: flex-start; background: #e9e9e6; color: var(--ink); border-bottom-left-radius: 6px; }
.bub small { display: block; font-size: 10.5px; opacity: .65; margin-top: 2px; text-align: right; }

/* Dashboards & admin */
.app-mode .stat-row { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.app-mode .stat b { font-size: 21px; }
.app-mode .tabs { position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 20; background: var(--bg); margin: 0 -16px 16px; padding: 0 12px; scrollbar-width: none; }
.app-mode .tabs::-webkit-scrollbar { display: none; }
.app-mode .list-item { padding: 14px 16px; flex-wrap: wrap; }
.app-mode .list-item .grow { min-width: 60%; }
html, body { max-width: 100%; }
.app-mode { overflow-x: hidden; }
.pstrip, .app-mode .pstrip.m-only { display: grid !important; grid-template-columns: repeat(3, 1fr); margin: 16px 0 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.pstrip > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; text-align: center; }
.pstrip > div + div { border-left: 1px solid var(--line); }
.pstrip b { font-size: 16px; letter-spacing: -.02em; display: flex; align-items: center; gap: 5px; }
.pstrip span { font-size: 11.5px; color: var(--ink-3); }
body:not(.app-mode) .pstrip { display: none !important; }
