/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:             #0e1117;
  --surface:        #161b22;
  --card:           #1c2128;
  --card-hover:     #22272e;
  --border:         #30363d;
  --text:           #e6edf3;
  --text-muted:     #7d8590;
  --accent:         #7c6af5;
  --gold:           #e3b341;
  --green:          #3fb950;
  --nav-h:          58px;
  --bottom-nav-h:   0px;
  --radius:         10px;
  --shadow:         0 8px 32px rgba(0,0,0,.5);
  --transition:     150ms ease;

  /* Category gradient backgrounds */
  --cat-yard_work:  linear-gradient(135deg, #14532d 0%, #166534 50%, #15803d 100%);
  --cat-gardening:  linear-gradient(135deg, #1a3a1a 0%, #2d6a2d 50%, #3d8b3d 100%);
  --cat-cleaning:   linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 50%, #2563eb 100%);
  --cat-errands:    linear-gradient(135deg, #431407 0%, #9a3412 50%, #c2410c 100%);
  --cat-delivery:   linear-gradient(135deg, #312e81 0%, #4338ca 50%, #4f46e5 100%);
  --cat-moving:     linear-gradient(135deg, #7f1d1d 0%, #991b1b 50%, #b91c1c 100%);
  --cat-pet_care:   linear-gradient(135deg, #713f12 0%, #92400e 50%, #b45309 100%);
  --cat-tech_help:  linear-gradient(135deg, #164e63 0%, #0e7490 50%, #0891b2 100%);
  --cat-handyman:   linear-gradient(135deg, #451a03 0%, #78350f 50%, #92400e 100%);
  --cat-general:    linear-gradient(135deg, #1c2128 0%, #2d333b 50%, #373e47 100%);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }

/* ── Nav ───────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .5rem;
  padding: 0 1.75rem;
}

nav .brand {
  font-size: 1rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--gold); margin-right: auto;
}
nav .brand::before { content: "⚔ "; }

nav .nav-link {
  color: var(--text-muted); font-size: .875rem;
  padding: .35rem .7rem; border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
nav .nav-link:hover { color: var(--text); background: var(--card); }

nav .nav-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; cursor: pointer;
  transition: filter var(--transition);
}
nav .nav-avatar:hover { filter: brightness(1.15); }

nav .nav-signout form { display: inline; }
nav .nav-signout button {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-size: .8rem;
  padding: .3rem .7rem; border-radius: 6px;
  cursor: pointer; font-family: inherit;
  transition: all var(--transition);
}
nav .nav-signout button:hover { color: var(--text); border-color: var(--text-muted); }

/* ── Main ──────────────────────────────────────────────────── */
main { max-width: 1140px; margin: 0 auto; padding: 2rem 1.75rem; }

/* ── Page Header ───────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.75rem; gap: 1rem;
}
.page-header h1 { margin-bottom: .2rem; }
.page-subtitle { color: var(--text-muted); font-size: .875rem; }

h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; margin-bottom: 1.5rem; }
h2 { font-size: 1.15rem; font-weight: 600; }

/* ── Flash Messages ────────────────────────────────────────── */
.flash {
  padding: .75rem 1.1rem; border-radius: var(--radius);
  margin-bottom: 1.5rem; font-size: .875rem; font-weight: 500;
}
.flash-notice { background: rgba(63,185,80,.1); border: 1px solid rgba(63,185,80,.3); color: #56d364; }
.flash-alert  { background: rgba(248,81,73,.1); border: 1px solid rgba(248,81,73,.3); color: #f87171; }

/* ── Filter Bar ────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: .4rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.filter-btn {
  padding: .35rem .8rem; border-radius: 20px;
  font-size: .8rem; font-weight: 500;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.filter-btn:hover { color: var(--text); border-color: var(--text-muted); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Quest Grid ────────────────────────────────────────────── */
.quests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
}

/* ── Quest Card ────────────────────────────────────────────── */
.quest-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex; flex-direction: column;
  position: relative; cursor: pointer;
}
.quest-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(124,106,245,.45);
}

.quest-card-hero {
  height: 72px; display: flex; align-items: center; gap: .6rem;
  padding: 0 1.1rem;
}
.quest-cat-icon { font-size: 1.75rem; line-height: 1; }
.quest-cat-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255,255,255,.75);
}

.quest-card-body { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }

.quest-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }

.quest-title-link {
  font-size: .975rem; font-weight: 600; color: var(--text); line-height: 1.35;
  transition: color var(--transition);
}
.quest-title-link:hover { color: var(--accent); }
/* Stretched link — makes the whole card clickable */
.quest-title-link::after { content: ""; position: absolute; inset: 0; }
/* Lift interactive elements above the stretched-link overlay */
.status-badge, .quest-card-footer .btn, .quest-card-footer .quest-location,
.quest-card-footer .quest-assignee { position: relative; z-index: 1; }

.quest-description {
  font-size: .825rem; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.5;
}

.quest-pay-row { display: flex; align-items: baseline; gap: .75rem; margin-top: .1rem; }
.quest-pay { font-size: 1.5rem; font-weight: 800; color: var(--green); letter-spacing: -.02em; }
.quest-duration { font-size: .8rem; color: var(--text-muted); }

.quest-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: .65rem; border-top: 1px solid var(--border);
  font-size: .775rem; color: var(--text-muted);
}
.quest-location, .quest-assignee { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }

/* ── Status Badges ─────────────────────────────────────────── */
.status-badge {
  display: inline-block; padding: .2rem .6rem; border-radius: 20px;
  font-size: .7rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; white-space: nowrap;
  cursor: pointer; border: none; font-family: inherit;
  transition: filter var(--transition), transform var(--transition); line-height: 1.6;
}
.status-badge:hover  { filter: brightness(1.2); transform: scale(1.05); }
.status-badge:active { transform: scale(.97); }

.status-open             { background: rgba(56,139,253,.15); color: #79c0ff; border: 1px solid rgba(56,139,253,.3); }
.status-claimed          { background: rgba(188,140,255,.12); color: #d2a8ff; border: 1px solid rgba(188,140,255,.3); }
.status-in_progress      { background: rgba(227,179,65,.13); color: #e3b341; border: 1px solid rgba(227,179,65,.3); }
.status-proof_submitted  { background: rgba(245,160,70,.13); color: #fb923c; border: 1px solid rgba(245,160,70,.3); }
.status-completed        { background: rgba(63,185,80,.12); color: #56d364; border: 1px solid rgba(63,185,80,.3); }
.status-paid             { background: rgba(63,185,80,.2); color: #4ade80; border: 1px solid rgba(63,185,80,.5); font-weight: 800; }
.status-disputed         { background: rgba(248,81,73,.1); color: #f87171; border: 1px solid rgba(248,81,73,.3); }
.status-cancelled        { background: rgba(139,148,158,.08); color: #8b949e; border: 1px solid rgba(139,148,158,.2); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .5rem 1rem; border-radius: 7px;
  font-size: .875rem; font-weight: 500; cursor: pointer;
  text-decoration: none; border: 1px solid transparent;
  transition: all var(--transition); line-height: 1; font-family: inherit;
}
.btn-primary   { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-secondary:hover { color: var(--text); border-color: var(--text-muted); }
.btn-danger    { background: transparent; color: #f87171; border-color: rgba(248,113,113,.3); }
.btn-danger:hover { background: rgba(248,113,113,.08); }
.btn-success   { background: var(--green); color: #000; border-color: var(--green); font-weight: 600; }
.btn-success:hover { filter: brightness(1.1); }
.btn-claim     {
  background: var(--gold); color: #000; border-color: var(--gold);
  font-size: 1.05rem; font-weight: 700; padding: .7rem 1.5rem;
  width: 100%; justify-content: center;
}
.btn-claim:hover { filter: brightness(1.08); }
.btn-sm { padding: .28rem .65rem; font-size: .78rem; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; max-width: 600px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.field { margin-bottom: 1.25rem; }
.field label {
  display: block; font-size: .825rem; font-weight: 500;
  color: var(--text-muted); margin-bottom: .4rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.field input, .field textarea, .field select {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); padding: .55rem .8rem;
  font-size: .9rem; transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,106,245,.15);
}
.field textarea { min-height: 120px; resize: vertical; }
.field select { appearance: none; cursor: pointer; }
.field-hint { display: block; font-size: .775rem; color: var(--text-muted); margin-top: .3rem; }

.form-errors {
  background: rgba(248,81,73,.08); border: 1px solid rgba(248,81,73,.3);
  border-radius: 7px; padding: .75rem 1rem; margin-bottom: 1.25rem;
  color: #f87171; font-size: .85rem;
}

/* ── Skill Tags ────────────────────────────────────────────── */
.skill-checkboxes { display: flex; flex-wrap: wrap; gap: .5rem; }

.skill-check-label {
  display: flex; align-items: center; gap: .35rem;
  padding: .35rem .75rem; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .825rem; cursor: pointer;
  transition: all var(--transition);
}
.skill-check-label:hover { border-color: var(--accent); color: var(--accent); }
.skill-check-label input { display: none; }

.skill-toggle {
  padding: .35rem .75rem; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); font-size: .825rem; cursor: pointer;
  font-family: inherit; transition: all var(--transition);
}
.skill-toggle:hover { border-color: var(--accent); color: var(--accent); }
.skill-toggle.active { background: rgba(124,106,245,.15); border-color: var(--accent); color: var(--accent); }

.skill-tag {
  display: inline-block; padding: .2rem .55rem; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .78rem; margin-right: .3rem;
}

.quest-skills-required { margin-bottom: 1rem; font-size: .875rem; color: var(--text-muted); }

/* ── Quest Detail ──────────────────────────────────────────── */
.quest-detail {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; max-width: 760px;
}

.quest-detail-hero {
  height: 120px; display: flex; align-items: center; gap: 1rem; padding: 0 2rem;
}
.quest-hero-icon { font-size: 3rem; line-height: 1; }
.quest-hero-cat {
  font-size: .8rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.7);
}

.quest-detail-content { padding: 1.75rem 2rem; }

.quest-detail-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: 1.25rem;
}
.quest-detail-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .5rem; }
.quest-detail-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.quest-detail-pay { text-align: right; flex-shrink: 0; }
.pay-amount { font-size: 2.25rem; font-weight: 900; color: var(--green); letter-spacing: -.03em; line-height: 1; }
.pay-label  { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }

.meta-chip {
  padding: .2rem .6rem; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .78rem; color: var(--text-muted);
}

.quest-detail-body {
  color: var(--text-muted); line-height: 1.75; font-size: .925rem;
  margin-bottom: 1.5rem;
}

.quest-actions {
  display: flex; flex-direction: column; gap: .75rem;
  padding-top: 1.5rem; border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}

.approve-actions { display: flex; gap: .75rem; }

.quest-mgmt-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }

.completed-banner {
  background: rgba(63,185,80,.12); border: 1px solid rgba(63,185,80,.3);
  color: #56d364; padding: 1rem 1.25rem; border-radius: var(--radius);
  text-align: center; font-weight: 700; font-size: 1.05rem;
}

.quest-footer-meta { font-size: .8rem; color: var(--text-muted); margin-top: 1rem; }

/* ── Proof Section ─────────────────────────────────────────── */
.proof-section { margin-bottom: 1.5rem; }
.proof-section h3 { font-size: .95rem; margin-bottom: .75rem; color: var(--text-muted); }
.proof-grid { display: flex; gap: .75rem; flex-wrap: wrap; }
.proof-photo { width: 140px; height: 140px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

.proof-upload-form { display: flex; flex-direction: column; gap: .75rem; }
.proof-upload-label {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1rem; border: 2px dashed var(--border); border-radius: 8px;
  cursor: pointer; font-size: .875rem; color: var(--text-muted);
  transition: border-color var(--transition);
}
.proof-upload-label:hover { border-color: var(--accent); color: var(--accent); }
.proof-file-input { display: none; }

/* ── Profile ───────────────────────────────────────────────── */
.profile-wrap { max-width: 600px; }

.profile-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 2rem;
  display: flex; align-items: center; gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.profile-avatar-lg {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; flex-shrink: 0;
}
.profile-info h1 { margin-bottom: .3rem; }
.profile-stats { display: flex; gap: 1rem; font-size: .875rem; color: var(--text-muted); }

.stripe-connected { color: var(--green); font-size: .9rem; }

/* ── Auth ──────────────────────────────────────────────────── */
.auth-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--nav-h)); padding: 2rem;
}
.auth-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.5rem;
  width: 100%; max-width: 400px;
}
.auth-card h1 { margin-bottom: 1.75rem; font-size: 1.35rem; }
.auth-footer { margin-top: 1rem; font-size: .825rem; color: var(--text-muted); text-align: center; }
.auth-footer a { color: var(--accent); }
.auth-footer a:hover { text-decoration: underline; }

/* ── My Quests ─────────────────────────────────────────────── */
.mine-sections { display: flex; flex-direction: column; gap: 2.5rem; }
.mine-section  { }
.section-heading { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.count-badge {
  padding: .1rem .5rem; border-radius: 10px; font-size: .75rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
}
.empty-msg { color: var(--text-muted); font-size: .9rem; }
.empty-msg a { color: var(--accent); }

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 4rem 2rem; color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-illustration { margin-bottom: 1.25rem; display: flex; justify-content: center; }
.empty-state h2 { margin-bottom: .5rem; color: var(--text); }
.empty-state p  { margin-bottom: 1.5rem; }

/* ── Marketplace Hero ──────────────────────────────────────── */
.marketplace-hero {
  margin: -2rem -1.75rem 2rem;
  background: linear-gradient(135deg, #0d1117 0%, #161b22 40%, #1c2532 100%);
  background-image: url('https://images.unsplash.com/photo-1529156069898-49953e39b3ac?w=1200');
  background-size: cover;
  background-position: center 30%;
  position: relative;
  overflow: hidden;
}
.marketplace-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(13,17,23,.92) 0%, rgba(22,27,34,.85) 50%, rgba(28,37,50,.9) 100%);
}
.marketplace-hero-content {
  position: relative; z-index: 1;
  max-width: 640px; margin: 0 auto;
  padding: 4rem 1.75rem; text-align: center;
}
.marketplace-hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 900;
  letter-spacing: -.04em; line-height: 1.1;
  margin-bottom: 1rem; color: var(--text);
}
.marketplace-hero-sub {
  font-size: 1.05rem; color: var(--text-muted); line-height: 1.65;
  margin-bottom: 2rem;
}
.marketplace-hero-ctas { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* ── Extra Button Variants ─────────────────────────────────── */
.btn-lg { padding: .7rem 1.5rem; font-size: .975rem; }
.btn-gold { background: var(--gold); color: #000; border-color: var(--gold); font-weight: 700; }
.btn-gold:hover { filter: brightness(1.08); }

/* ── Category Description ──────────────────────────────────── */
.category-description {
  color: var(--text-muted); font-size: .875rem;
  margin-bottom: 1.25rem; font-style: italic;
}

/* ── Quest Card Hero Image Overlay ─────────────────────────── */
.quest-card-hero-overlay {
  display: flex; align-items: center; gap: .6rem;
  padding: 0 1.1rem; width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.3) 100%);
  border-radius: 0;
}

/* ── Quest Detail Hero Overlay ─────────────────────────────── */
.quest-hero-overlay {
  display: flex; align-items: center; gap: 1rem;
  padding: 0 2rem; width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,.35) 100%);
}

/* ── AI Verdict Card ───────────────────────────────────────── */
.ai-verdict-card {
  border-radius: var(--radius); padding: 1rem 1.25rem;
  margin-bottom: 1.5rem; border: 1px solid;
}
.ai-verdict-approved {
  background: rgba(63,185,80,.08);
  border-color: rgba(63,185,80,.3);
  color: #56d364;
}
.ai-verdict-rejected {
  background: rgba(248,81,73,.08);
  border-color: rgba(248,81,73,.3);
  color: #f87171;
}
.ai-verdict-uncertain {
  background: rgba(227,179,65,.08);
  border-color: rgba(227,179,65,.3);
  color: #e3b341;
}
.ai-verdict-header {
  display: flex; align-items: center; gap: .6rem;
  font-size: .875rem; flex-wrap: wrap;
}
.ai-verdict-badge { font-weight: 700; }
.ai-confidence {
  margin-left: auto; font-size: .775rem;
  opacity: .75; font-weight: 500;
}
.ai-explanation {
  margin-top: .6rem; font-size: .825rem;
  opacity: .85; line-height: 1.55; font-style: italic;
}

/* ── Skill Description ─────────────────────────────────────── */
.skill-desc {
  font-size: .775rem; color: var(--text-muted);
  margin: .3rem 0 0 1.5rem; line-height: 1.5;
}
.skill-check-wrapper { display: flex; flex-direction: column; }

/* ── Verification Method Radio ─────────────────────────────── */
.radio-group { display: flex; flex-direction: column; gap: .6rem; }
.radio-label {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .75rem 1rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: .875rem;
  transition: all var(--transition);
}
.radio-label:hover { border-color: var(--accent); }
.radio-label input[type="radio"] { margin-top: .15rem; flex-shrink: 0; accent-color: var(--accent); }
.radio-label-content strong { display: block; margin-bottom: .15rem; }
.radio-label-content span { color: var(--text-muted); font-size: .8rem; }

/* ── Mobile Bottom Navigation ───────────────────────────────── */
.mobile-bottom-nav { display: none; }

.mobile-nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: .4rem 0;
  color: var(--text-muted); text-decoration: none;
  font-size: .6rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  transition: color var(--transition);
  min-height: 44px; cursor: pointer;
}
.mobile-nav-item:hover,
.mobile-nav-item.active { color: var(--accent); }

.mobile-nav-icon { font-size: 1.25rem; line-height: 1; }
.mobile-nav-label { line-height: 1; }

.mobile-nav-post { color: var(--accent); }
.mobile-nav-post-btn {
  width: 44px; height: 44px;
  background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 300; line-height: 1; color: #fff;
  box-shadow: 0 4px 16px rgba(124,106,245,.45);
  transition: filter var(--transition), transform var(--transition);
}
.mobile-nav-post:hover .mobile-nav-post-btn { filter: brightness(1.12); transform: scale(1.06); }

/* ── Hotwire Native ─────────────────────────────────────────── */

/* Hide the web nav when running inside the native app shell.
   The iOS/Android shell provides its own native navigation chrome. */
.turbo-native nav { display: none; }
/* Also hide mobile bottom nav — native shell provides tabs */
.turbo-native .mobile-bottom-nav { display: none; }

/* Remove top padding from main — native shell handles the status bar */
.turbo-native main {
  padding-top: env(safe-area-inset-top, 1rem);
}

/* Safe area padding for devices with home indicator (iPhone X+) */
.turbo-native body {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Pull the marketplace hero flush to the top on native (no nav offset) */
.turbo-native .marketplace-hero { margin-top: 0; }

/* Larger tap targets for native touch (min 44pt per Apple HIG) */
.turbo-native .btn { min-height: 44px; }
.turbo-native .filter-btn { min-height: 36px; }

/* ── Responsive / Mobile-first ──────────────────────────────── */
@media (max-width: 768px) {
  :root { --bottom-nav-h: 62px; }

  /* ── Bottom nav: visible on mobile ── */
  .mobile-bottom-nav {
    display: flex; align-items: stretch;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0));
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }

  /* ── Main: pad bottom so content clears the fixed bottom nav ── */
  body.authenticated main {
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0) + 1.5rem);
  }

  /* ── Top nav: hide text links for authenticated users (bottom nav takes over) ── */
  body.authenticated nav .nav-link,
  body.authenticated nav .nav-signout { display: none; }
  nav { padding: 0 1rem; }

  /* ── Layout ── */
  main { padding: 1.25rem 1rem; }

  /* ── Quest grid: single column ── */
  .quests-grid { grid-template-columns: 1fr; gap: .85rem; }

  /* ── Quest detail: full width, compact ── */
  .quest-detail { max-width: 100%; }
  .quest-detail-content { padding: 1.25rem 1rem; }
  .quest-detail-hero { height: 90px; padding: 0 1.1rem; }
  .quest-hero-icon { font-size: 2.25rem; }
  .quest-detail-top { flex-direction: column; gap: .75rem; }
  .quest-detail-pay { text-align: left; }
  .pay-amount { font-size: 1.75rem; }

  /* ── Forms: full width, compact padding ── */
  .form-card { padding: 1.25rem 1rem; max-width: 100%; }
  .form-row { grid-template-columns: 1fr; }

  /* ── Auth: stack from top ── */
  .auth-wrap { align-items: flex-start; padding: .75rem; min-height: auto; }
  .auth-card { padding: 1.5rem 1.25rem; }

  /* ── Marketplace hero: compact ── */
  .marketplace-hero { margin: -1.25rem -1rem 1.5rem; }
  .marketplace-hero-content { padding: 2.5rem 1.25rem; }

  /* ── Page header: stack on mobile ── */
  .page-header { flex-direction: column; gap: .75rem; }
  .page-header .btn { width: 100%; justify-content: center; }

  /* ── Touch targets: 44px minimum ── */
  .btn { min-height: 44px; padding: .65rem 1rem; }
  .btn-sm { min-height: 36px; padding: .35rem .8rem; }
  .filter-btn { min-height: 40px; padding: .5rem .9rem; }

  /* ── Action buttons: full width on quest show ── */
  .quest-actions .btn { width: 100%; justify-content: center; }
  .approve-actions { flex-direction: column; }
  .approve-actions .btn { width: 100%; justify-content: center; }
  .quest-mgmt-actions .btn { flex: 1; justify-content: center; min-width: 0; }

  /* ── Profile: full width ── */
  .profile-wrap { max-width: 100%; }
  .profile-card { padding: 1.1rem; gap: 1rem; }
  .profile-avatar-lg { width: 52px; height: 52px; font-size: 1.25rem; }

  /* ── Filter bar: horizontally scrollable ── */
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; -webkit-overflow-scrolling: touch; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-btn { flex-shrink: 0; }

  /* ── Escrow card ── */
  .escrow-row { font-size: .8rem; }

  /* ── Proof photos ── */
  .proof-photo { width: 110px; height: 110px; }

  /* ── Review stars ── */
  .star-label { font-size: 2rem; }

  /* ── Claim form btn ── */
  .btn-claim { font-size: 1rem; padding: .85rem 1.5rem; }

  /* ── My quests sections ── */
  .mine-sections { gap: 1.75rem; }

  h1 { font-size: 1.3rem; }
}

/* ── Profile link (inline user handle link) ────────────────── */
.profile-link {
  color: var(--accent); font-weight: 600;
  transition: opacity var(--transition);
}
.profile-link:hover { opacity: .8; }

/* ── Reviews ───────────────────────────────────────────────── */
.reviews-section {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.reviews-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }

.review-card {
  padding: .9rem 0;
}
.review-header {
  display: flex; align-items: center; gap: .75rem;
  flex-wrap: wrap; margin-bottom: .4rem;
}
.review-stars { display: flex; gap: 1px; font-size: 1rem; }
.review-stars .star { color: var(--border); }
.review-stars .star.filled { color: var(--gold); }
.review-meta { font-size: .8rem; color: var(--text-muted); }
.review-body { font-size: .875rem; color: var(--text); line-height: 1.6; }
.review-divider { border: none; border-top: 1px solid var(--border); margin: .1rem 0; }

/* Review form card */
.review-form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}
.review-form-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .3rem; }
.review-prompt { font-size: .875rem; color: var(--text-muted); margin-bottom: 1rem; }
.review-textarea {
  width: 100%; background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: .65rem .85rem;
  font-size: .875rem; font-family: inherit; resize: vertical;
  transition: border-color var(--transition);
}
.review-textarea:focus { outline: none; border-color: var(--accent); }

/* CSS-only interactive star rating (reverse order trick) */
.star-rating-field {
  display: flex; flex-direction: row-reverse;
  justify-content: flex-end; gap: 2px;
  margin-bottom: 1rem;
}
.star-radio { display: none; }
.star-label {
  font-size: 1.75rem; cursor: pointer;
  color: var(--border); transition: color var(--transition);
}
/* Fill all stars up to and including the selected one */
.star-radio:checked ~ .star-label,
.star-label:hover,
.star-label:hover ~ .star-label {
  color: var(--gold);
}

/* ── Instant Payout toggle ─────────────────────────────────── */
/* ── Escrow Card ────────────────────────────────────────────── */
.escrow-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 1.25rem; overflow: hidden;
}
.escrow-summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: .75rem 1rem; cursor: pointer; list-style: none; user-select: none;
  font-size: .875rem;
}
.escrow-summary::-webkit-details-marker { display: none; }
.escrow-title { font-weight: 600; }
.escrow-status-chip {
  font-size: .7rem; font-weight: 600; padding: .2rem .6rem;
  border-radius: 20px; text-transform: uppercase; letter-spacing: .04em;
}
.escrow-open, .escrow-claimed, .escrow-in_progress { background: rgba(59,130,246,.15); color: #93c5fd; }
.escrow-proof_submitted, .escrow-completed        { background: rgba(234,179,8,.15);  color: #fde68a; }
.escrow-paid                                       { background: rgba(34,197,94,.15);  color: #86efac; }
.escrow-disputed                                   { background: rgba(249,115,22,.15); color: #fdba74; }
.escrow-cancelled, .escrow-refunded                { background: rgba(100,116,139,.15);color: #94a3b8; }

.escrow-body { padding: 0 1rem 1rem; }
.escrow-flow { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin-bottom: .85rem; }
.escrow-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .5rem .75rem; font-size: .875rem;
}
.escrow-row + .escrow-row { border-top: 1px solid var(--border); }
.escrow-row-total { background: rgba(255,255,255,.03); font-weight: 700; }
.escrow-fee { color: var(--text-muted); }
.escrow-net { color: var(--green); }
.escrow-narrative { font-size: .825rem; color: var(--text-muted); line-height: 1.55; }
.escrow-narrative p { margin: 0 0 .35rem; }
.escrow-ref { font-size: .75rem !important; margin-top: .5rem !important; }
.escrow-ref code { background: rgba(255,255,255,.07); padding: .1em .35em; border-radius: 4px; font-size: .85em; }

/* ── Rating Gate Notice ─────────────────────────────────────── */
.gate-notice {
  background: rgba(185,28,28,.12); border: 1px solid rgba(185,28,28,.4);
  border-radius: 8px; padding: 1rem 1.1rem; margin-bottom: .5rem;
  font-size: .875rem; line-height: 1.5;
}
.gate-notice strong { display: block; margin-bottom: .35rem; color: #fca5a5; }
.gate-notice p { margin: 0 0 .35rem; color: var(--text); }
.gate-your-stats { color: var(--text-muted) !important; font-size: .8rem !important; }
.gate-notice-identity { border-color: rgba(124,106,245,.4); background: rgba(124,106,245,.08); }
.gate-notice-identity strong { color: #c4b5fd; }
.identity-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  background: rgba(124,106,245,.15); color: #c4b5fd;
  border: 1px solid rgba(124,106,245,.35);
  border-radius: 20px; padding: .15rem .55rem; font-size: .75rem; font-weight: 600;
}

.claim-form { display: flex; flex-direction: column; gap: .75rem; }
.instant-payout-toggle {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .75rem 1rem;
}
.instant-payout-label {
  display: flex; align-items: flex-start; gap: .6rem;
  cursor: pointer; font-size: .9rem;
}
.instant-checkbox { margin-top: 2px; accent-color: var(--gold); cursor: pointer; }
.instant-toggle-text { display: flex; flex-direction: column; gap: .15rem; }
.instant-fee-note { font-size: .78rem; color: var(--text-muted); }
.instant-fee-note em { display: block; font-style: normal; }
.instant-badge {
  display: inline-block; background: rgba(227,179,65,.15);
  color: var(--gold); border: 1px solid rgba(227,179,65,.35);
  border-radius: 4px; font-size: .7rem; font-weight: 600;
  padding: 1px 5px; margin-left: .35rem; vertical-align: middle;
}

/* ── PWA Install prompt (future) ───────────────────────────── */
.pwa-install-banner {
  display: flex; align-items: center; gap: .75rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: .75rem 1.75rem; font-size: .85rem; color: var(--text-muted);
}
.pwa-install-banner button {
  margin-left: auto; background: var(--accent); color: #fff;
  border: none; border-radius: 6px; padding: .35rem .85rem;
  font-size: .8rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.pwa-install-banner button:hover { filter: brightness(1.1); }

/* ── Leaflet maps ───────────────────────────────────────────── */
.quests-map-wrap {
  margin: 0 0 1.25rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.quests-map { height: 280px; }
@media (min-width: 768px) { .quests-map { height: 360px; } }

.quest-location-section { margin: 1.25rem 0; }
.quest-location-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .5rem;
}
.quest-location-header h3 { margin: 0; }
.quest-detail-map {
  height: 240px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
@media (min-width: 768px) { .quest-detail-map { height: 300px; } }

/* ── Clickable location chip ─────────────────────────────────── */
.meta-chip-link {
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, color 0.15s;
}
.meta-chip-link:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Quest Chat ──────────────────────────────────────────────── */
.quest-chat-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.chat-heading {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  max-height: 400px;
  overflow-y: auto;
}
.chat-message {
  display: flex;
}
.chat-message-mine  { justify-content: flex-end; }
.chat-message-theirs { justify-content: flex-start; }
.chat-bubble {
  max-width: 70%;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.chat-message-mine .chat-bubble {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chat-sender {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.75;
}
.chat-body { margin: 0; font-size: 0.9rem; white-space: pre-wrap; }
.chat-time { font-size: 0.65rem; opacity: 0.55; align-self: flex-end; }

/* Offer card */
.chat-message-offer { justify-content: center; }
.offer-card {
  background: var(--card);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  text-align: center;
  min-width: 240px;
  max-width: 340px;
}
.offer-header { margin-bottom: 0.5rem; }
.offer-amount { color: var(--gold); font-weight: 700; }
.offer-actions { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.5rem; }
.offer-status { font-size: 0.85rem; display: block; margin-top: 0.25rem; }
.offer-status-pending  { color: var(--text-muted); }
.offer-status-accepted { color: var(--green); }
.offer-status-declined { color: #f85149; }

/* Negotiate price form */
.offer-form-details { margin-bottom: 0.75rem; }
.offer-form-details summary { cursor: pointer; display: inline-block; }
.offer-toggle { list-style: none; }
.offer-form-body { margin-top: 0.5rem; }
.offer-form { display: inline-flex; }
.offer-input-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
}
.offer-currency { color: var(--text-muted); font-weight: 600; }
.offer-input {
  background: transparent;
  border: none;
  color: var(--text);
  width: 90px;
  font-size: 0.9rem;
  outline: none;
}

/* Message input */
.message-form { margin-top: 0.5rem; }
.message-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}
.message-textarea {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  resize: none;
  font-family: inherit;
}
.message-textarea:focus { outline: none; border-color: var(--accent); }

/* ── Leaderboard ───────────────────────────────────────────── */
.leaderboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 768px) {
  .leaderboard-grid { grid-template-columns: 1fr; }
}

.leaderboard-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.leaderboard-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.leaderboard-section-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: background var(--transition);
}
.leaderboard-row--podium {
  border-color: color-mix(in srgb, var(--gold) 30%, var(--border));
}
.leaderboard-row:hover { background: var(--card-hover); }

.leaderboard-rank {
  font-size: 1.2rem;
  min-width: 2rem;
  text-align: center;
}

.leaderboard-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}

.leaderboard-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.leaderboard-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leaderboard-name:hover { color: var(--accent); }

.leaderboard-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.leaderboard-value {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  margin-left: auto;
}
.leaderboard-value--gold { color: var(--gold); }
.leaderboard-value--star { color: var(--gold); }

.leaderboard-empty {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 1rem 0;
  text-align: center;
}

/* ── Recurring Quests ──────────────────────────────────────── */
.badge-recurring {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  white-space: nowrap;
}
.quest-badges { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

.recurring-options {
  margin-top: 0.75rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.recurring-templates-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.recurring-template-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
@media (max-width: 600px) {
  .recurring-template-row { flex-direction: column; align-items: flex-start; }
}
.recurring-template-info { flex: 1; min-width: 0; }
.recurring-template-title { font-weight: 600; font-size: 0.95rem; }
.recurring-template-title:hover { color: var(--accent); }
.recurring-template-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.recurring-template-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.toggle-label input[type="checkbox"] { width: 1rem; height: 1rem; }
