/* MechConnect web — visual system ported 1:1 from the iOS app's Theme.swift
   (light theme). Same lavender background, deep professional purple accent,
   amber secondary, white cards with soft purple-gray borders, 14–16px
   continuous-corner radii, SF system font stack. */

:root {
  --bg:          #F6F4FB;
  --bg2:         #EBE6F5;
  --card:        #FFFFFF;
  --card-border: #DCD4EC;
  --text:        #1F2937;
  --text2:       #475467;
  --text3:       #667085;
  --accent:      #5B4A9E;
  --accent-text: #FFFFFF;
  --input-bg:    #F0EBF8;
  --input-border:#DCD4EC;
  --divider:     #E4DDF2;
  --chip-bg:     #E5DEF1;
  --chip-bg-on:  #5B4A9E;
  --success:     #15803D;
  --warn:        #B45309;
  --danger:      #B91C1C;
  --star:        #F59E0B;
  --premium:     #7C3AED;
  --warm-accent: #F59E0B;
  --cream:       #EFE9F8;
  --action-blue: #2563EB;
  --radius:      14px;
  --radius-lg:   16px;
  --shadow:      0 1px 3px rgba(31, 41, 55, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }

/* ── App shell ─────────────────────────────────────────────────────── */

#app { min-height: 100dvh; display: flex; flex-direction: column; }

.header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: rgba(246, 244, 251, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--divider);
}
.wordmark {
  font-size: 19px; font-weight: 800; letter-spacing: -0.3px;
  color: var(--text);
  display: inline-flex; align-items: center; gap: 8px;
}
/* MechConnect monogram — the same double-stroked M as the iOS app icon
   and the Wallet pass. currentColor inherits the accent below. */
.wordmark .mc-logo {
  width: 22px; height: 22px; color: var(--accent); flex: 0 0 22px;
}
/* Wordmark type: Calibri regular (per brand), system stack fallback. */
.wordmark .mc-name {
  /* Carlito is metrically identical to Calibri and ships as a webfont,
     so every visitor sees the same wordmark; Calibri kicks in for anyone
     who has it locally before the webfont loads. */
  font-family: "Carlito", Calibri, "Gill Sans", "Trebuchet MS",
               -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
}
.header .sub { font-size: 12px; color: var(--text3); margin-top: 1px; }
.header-spacer { flex: 1; }

.icon-btn {
  position: relative;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg2); color: var(--text);
  font-size: 16px;
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--chip-bg); }
.icon-btn .badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 800;
  display: grid; place-items: center; padding: 0 4px;
}

.content {
  flex: 1; width: 100%;
  max-width: 720px; margin: 0 auto;
  padding: 0 16px 96px;
}
@media (min-width: 900px) { .content { padding-bottom: 32px; } }

/* ── Bottom tab bar (mobile) / card nav (desktop) — never moves,
      never bleeds off-screen: the iOS craft rule, honored here. ── */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; justify-content: space-around;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--divider);
  padding: 6px 0 max(8px, env(safe-area-inset-bottom));
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text3); font-size: 10px; font-weight: 600;
  padding: 4px 14px; border-radius: 10px;
}
.tab .glyph { font-size: 20px; line-height: 1; }
.tab.active { color: var(--accent); }
@media (min-width: 900px) {
  .tabbar {
    max-width: 480px; margin: 0 auto;
    left: 50%; right: auto; transform: translateX(-50%);
    width: 100%;
    border: 1px solid var(--divider);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
  }
}

/* ── Cards & shared components ─────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.section-title { font-size: 17px; font-weight: 600; margin: 18px 0 10px; }
.section-title.lg { font-size: 18px; font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 15px; font-weight: 700;
  border-radius: 12px; padding: 13px 18px;
  transition: filter 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-blue { background: var(--action-blue); color: #fff; }
.btn-ghost { background: var(--bg2); color: var(--text); }
.btn-danger-soft { background: rgba(185, 28, 28, 0.12); color: var(--danger); }
.btn-success { background: var(--success); color: #fff; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.input, textarea.input, select.input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px; color: var(--text);
  outline: none;
}
.input:focus { border-color: var(--accent); }
.field-label {
  display: block; font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text3); margin: 14px 0 6px;
}

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.4px;
  padding: 4px 8px; border-radius: 999px;
}
.pill.accent  { color: var(--accent);      background: rgba(91, 74, 158, 0.12); }
.pill.success { color: var(--success);     background: rgba(21, 128, 61, 0.12); }
.pill.warn    { color: var(--warn);        background: rgba(180, 83, 9, 0.12); }
.pill.danger  { color: var(--danger);      background: rgba(185, 28, 28, 0.12); }
.pill.muted   { color: var(--text3);       background: var(--bg2); }
.pill.blue    { color: var(--action-blue); background: rgba(37, 99, 235, 0.12); }

.avatar {
  border-radius: 50%;
  background: var(--chip-bg); color: var(--accent);
  display: grid; place-items: center;
  font-weight: 800; overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.divider { height: 1px; background: var(--divider); margin: 10px 0; }
.muted { color: var(--text3); font-size: 13px; }
.error-text { color: var(--danger); font-size: 13px; font-weight: 600; margin-top: 8px; }

/* ── Landing (logged out) ──────────────────────────────────────────── */

.landing-hero { text-align: center; padding: 44px 16px 8px; }
.landing-hero .kicker {
  font-size: 12px; font-weight: 800; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--accent);
}
.landing-hero h1 {
  font-size: clamp(30px, 6vw, 44px); font-weight: 800;
  letter-spacing: -0.8px; margin: 10px 0 8px;
}
.landing-hero p { font-size: 16px; color: var(--text2); max-width: 480px; margin: 0 auto; }

.feature-row {
  display: grid; gap: 10px; margin: 26px 0;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .feature-row { grid-template-columns: repeat(3, 1fr); } }
.feature-card { text-align: left; }
.feature-card .glyph { font-size: 24px; }
.feature-card h3 { font-size: 14px; font-weight: 700; margin: 8px 0 4px; }
.feature-card p { font-size: 12.5px; color: var(--text2); line-height: 1.45; }

.auth-card { max-width: 420px; margin: 8px auto 48px; }
.auth-toggle { display: flex; gap: 6px; background: var(--bg2); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.auth-toggle button {
  flex: 1; padding: 9px; border-radius: 9px;
  font-size: 13px; font-weight: 700; color: var(--text2);
}
.auth-toggle button.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

.role-row { display: flex; gap: 8px; }
.role-chip {
  flex: 1; padding: 12px 8px; border-radius: 12px; text-align: center;
  border: 1.5px solid var(--input-border); background: var(--input-bg);
  font-size: 13px; font-weight: 700; color: var(--text2);
}
.role-chip.active { border-color: var(--accent); color: var(--accent); background: rgba(91, 74, 158, 0.08); }

/* ── Home ──────────────────────────────────────────────────────────── */

.greeting { padding: 16px 0 14px; }
.greeting .hi { font-size: 13px; color: var(--text2); }
.greeting h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; margin: 2px 0; }
.greeting .sub { font-size: 14px; color: var(--text2); }

.mech-scroller {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 10px;
  scrollbar-width: none;
}
.mech-scroller::-webkit-scrollbar { display: none; }
.mech-chip {
  flex: 0 0 116px; text-align: center;
  padding: 14px 8px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--card-border);
  box-shadow: var(--shadow); cursor: pointer;
}
.mech-chip .avatar { width: 58px; height: 58px; margin: 0 auto 8px; font-size: 20px; }
.mech-chip .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mech-chip .meta { font-size: 11px; color: var(--text3); margin-top: 3px; }
.mech-chip .meta .star { color: var(--star); }
.mech-chip .meta b { color: var(--text); }

.consult-card {
  display: flex; align-items: center; gap: 12px;
  margin-top: 8px;
}
.consult-card .glyph {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--cream); color: var(--warm-accent);
  display: grid; place-items: center; font-size: 20px;
}
.consult-card h3 { font-size: 15px; font-weight: 700; }
.consult-card p { font-size: 12.5px; color: var(--text2); }

.jobs-pager {
  display: flex; gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  margin-top: 4px;
}
.jobs-pager::-webkit-scrollbar { display: none; }
.job-slide {
  flex: 0 0 100%; scroll-snap-align: center;
  min-height: 300px; display: flex; flex-direction: column; gap: 10px;
  border-radius: var(--radius-lg); cursor: pointer;
}
.job-slide .head { display: flex; align-items: flex-start; gap: 10px; }
.job-slide .cat-glyph {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: var(--cream); color: var(--warm-accent);
  display: grid; place-items: center; font-size: 18px;
}
.job-slide h3 { font-size: 16px; font-weight: 700; }
.job-slide .vehicle { font-size: 12px; color: var(--text2); }
.detail-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }
.detail-row .glyph { width: 16px; color: var(--text3); text-align: center; }
.job-slide .desc { font-size: 13px; color: var(--text2); line-height: 1.45; }
.job-slide .cta { margin-top: auto; text-align: right; font-size: 12px; font-weight: 600; color: var(--accent); }

.empty-block {
  min-height: 300px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-lg); text-align: center;
}
.empty-block .glyph { font-size: 34px; color: var(--text3); }
.empty-block h3 { font-size: 16px; font-weight: 600; color: var(--text2); }
.empty-block p { font-size: 13px; color: var(--text3); }

.page-dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.page-dots span { width: 6px; height: 6px; border-radius: 3px; background: var(--card-border); }
.page-dots span.on { background: var(--accent); }

.fab {
  position: fixed; right: 18px; bottom: 84px; z-index: 55;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 26px;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(91, 74, 158, 0.35);
}
@media (min-width: 900px) { .fab { bottom: 32px; } }

/* ── Job list rows ─────────────────────────────────────────────────── */

.job-row { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.job-row .cat-glyph {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: var(--cream); color: var(--warm-accent);
  display: grid; place-items: center; font-size: 18px;
}
.job-row .info { flex: 1; min-width: 0; }
.job-row h4 { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-row .meta { font-size: 12px; color: var(--text3); }

/* ── Messages ──────────────────────────────────────────────────────── */

.thread-row { display: flex; gap: 12px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--divider); cursor: pointer; }
.thread-row .avatar { width: 46px; height: 46px; font-size: 16px; }
.thread-row .info { flex: 1; min-width: 0; }
.thread-row .name { font-size: 14px; font-weight: 700; }
.thread-row .preview { font-size: 13px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-row .when { font-size: 11px; color: var(--text3); }
.thread-row .unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

.chat { display: flex; flex-direction: column; height: calc(100dvh - 180px); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 12px 2px; display: flex; flex-direction: column; gap: 8px; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble {
  max-width: 78%; padding: 10px 13px; border-radius: 16px;
  font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word;
  background: var(--card); border: 1px solid var(--card-border); color: var(--text);
}
.bubble-row.mine .bubble { background: var(--accent); border-color: var(--accent); color: #fff; }
.bubble .when { display: block; font-size: 10px; opacity: 0.65; margin-top: 4px; }

.sr-card {
  max-width: 82%; padding: 10px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--card-border);
  display: flex; flex-direction: column; gap: 7px;
}
.sr-card .tag-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sr-card h4 { font-size: 14px; font-weight: 800; }
.sr-card .desc { font-size: 12px; color: var(--text2); }
.sr-card .actions { display: flex; gap: 8px; margin-top: 2px; }
.sr-card .actions .btn { padding: 8px 0; font-size: 13px; flex: 1; border-radius: 10px; }

.composer { display: flex; gap: 8px; padding: 10px 0 4px; }
.composer .input { flex: 1; }

/* ── Profile / mechanic viewer ─────────────────────────────────────── */

.profile-head { text-align: center; padding: 18px 0 6px; }
.profile-head .banner {
  height: 96px; border-radius: var(--radius-lg); margin-top: 10px;
  background: linear-gradient(120deg, #5B4A9E, #7C3AED, #F59E0B);
}
.profile-head .avatar { width: 84px; height: 84px; font-size: 30px; margin: -42px auto 8px; border: 4px solid var(--bg); }
.profile-head h2 { font-size: 20px; font-weight: 800; display: inline-flex; gap: 6px; align-items: center; }
.profile-head .seal { color: var(--success); }
.profile-head .meta { font-size: 13px; color: var(--text2); margin-top: 2px; }
.profile-actions { display: flex; gap: 10px; margin: 14px 0; }
.profile-actions .btn { flex: 1; }

.modal-veil {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(31, 41, 55, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 640px) { .modal-veil { align-items: center; } }
.modal {
  width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto;
  background: var(--bg); border-radius: 20px 20px 0 0; padding: 18px 16px 24px;
}
@media (min-width: 640px) { .modal { border-radius: 20px; } }
.modal h2 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  z-index: 200; background: var(--text); color: #fff;
  font-size: 13px; font-weight: 600;
  padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.toast.show { opacity: 1; }

.hidden { display: none !important; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--chip-bg); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ── App-parity header (logo tile, name + stars, pills) ─────────────── */
.brand-tile {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow);
}
.brand-tile img { width: 100%; height: 100%; display: block; }
/* Inline SVG line icons — baseline-align inside buttons and rows. */
.ic { vertical-align: -0.18em; }
.pill-btn .ic, .role-chip .ic, .btn .ic { margin-right: 2px; }
.hdr-stack { display: flex; flex-direction: column; line-height: 1.25; }
.hdr-name {
  font-family: "Carlito", Calibri, -apple-system, sans-serif;
  font-size: 17px; font-weight: 700; color: var(--text);
}
.hdr-sub { font-size: 12px; color: var(--text2); }
.hdr-stars { font-size: 12px; color: var(--star); letter-spacing: 1px; }
.hdr-stars .num { color: var(--text2); font-weight: 700; letter-spacing: 0; margin-left: 3px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 999px; padding: 8px 14px;
  font-size: 13px; font-weight: 700; color: var(--text);
  box-shadow: var(--shadow); position: relative;
}
.gear-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--card-border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text2); box-shadow: var(--shadow);
}

/* ── Browse page (title row, round buttons, search) ─────────────────── */
.browse-head { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.browse-head h2 { flex: 1; font-size: 22px; font-weight: 800; }
.round-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--card-border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: var(--text2);
}
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 12px; padding: 11px 12px; margin: 12px 0 14px;
}
.search-bar input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 15px; color: var(--text);
}
.search-bar .mag { color: var(--text3); font-size: 14px; }


/* ── Branded boot loader: logo over an accent glow, spinner beneath. ── */
.boot-loader {
  min-height: 70vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  position: relative;
}
.boot-glow {
  position: absolute; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle,
    rgba(90, 63, 204, 0.35) 0%,
    rgba(90, 63, 204, 0.12) 45%,
    transparent 70%);
  filter: blur(6px);
  animation: bootPulse 2.2s ease-in-out infinite;
}
@keyframes bootPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50%      { transform: scale(1.12); opacity: 1; }
}
.boot-logo {
  width: 84px; height: 84px; border-radius: 20px;
  position: relative; z-index: 1;
  box-shadow: 0 8px 30px rgba(90, 63, 204, 0.35);
}
.boot-loader .spinner { position: relative; z-index: 1; }
.boot-text {
  position: relative; z-index: 1;
  font-size: 13px; font-weight: 600; color: var(--text3);
}

/* ── App Store ad card on the landing page. ───────────────────────── */
.appstore-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 26px 20px; margin: 18px 0;
}
.appstore-card .as-logo {
  width: 64px; height: 64px; border-radius: 15px;
  box-shadow: 0 6px 20px rgba(16, 24, 64, 0.25);
}
.appstore-card .as-name {
  font-family: "Carlito", Calibri, -apple-system, sans-serif;
  font-size: 20px; color: var(--text);
}
.appstore-card .as-desc {
  font-size: 13px; color: var(--text2); max-width: 320px; line-height: 1.45;
}
.appstore-card .as-badge {
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: 8px;
  background: #000; color: #fff;
  border-radius: 10px; padding: 8px 16px;
  line-height: 1.1; text-align: left;
}
.appstore-card .as-badge small {
  font-size: 9px; font-weight: 400; letter-spacing: 0.2px;
}
.appstore-card .as-badge span { font-size: 15px; font-weight: 700; }


/* ── Browse extras ─────────────────────────────────────────────────── */
.round-btn.on { color: var(--star); border-color: var(--star); }
.pill-btn.small { padding: 7px 12px; font-size: 12px; }
.section-label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text3); margin: 8px 2px 8px;
}
.star-btn {
  background: none; color: var(--text3); padding: 4px; margin-left: -4px;
}
.star-btn.on { color: var(--star); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--chip-bg); color: var(--accent);
  font-size: 12px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px;
}
.photo-strip { display: flex; gap: 8px; overflow-x: auto; }
.photo-strip img {
  width: 92px; height: 92px; object-fit: cover; border-radius: 10px; flex: 0 0 92px;
}
.rank { font-weight: 900; color: var(--accent); width: 34px; }

/* ── Map ───────────────────────────────────────────────────────────── */
#map-canvas {
  height: min(62vh, 560px); border-radius: var(--radius-lg);
  border: 1px solid var(--card-border); box-shadow: var(--shadow);
  overflow: hidden; z-index: 0;
}
.leaflet-container { font: inherit; }

/* ── Hub ───────────────────────────────────────────────────────────── */
.hub-chips { display: flex; gap: 8px; margin: 4px 0 14px; overflow-x: auto; }
.hub-chip {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 999px; padding: 8px 14px;
  font-size: 13px; font-weight: 700; color: var(--text2); white-space: nowrap;
}
.hub-chip.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.hub-body {
  font-size: 13px; color: var(--text2); line-height: 1.45; margin: 4px 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.market-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.market-card { padding: 10px; }
.market-card img, .market-card .ph {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px;
  background: var(--input-bg); display: flex; align-items: center;
  justify-content: center; color: var(--text3);
}
.mk-title { font-size: 13px; font-weight: 700; margin-top: 6px; }
.mk-price { font-size: 14px; font-weight: 800; color: var(--accent); }


/* ── Profile header rows (name / @user + stars / skill + location) ── */
.uname-row {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  margin-top: 2px;
}
.skill-row {
  display: flex; align-items: baseline; gap: 12px; justify-content: center;
  margin-top: 6px;
}
.skill-row .skill { font-size: 14px; font-weight: 700; color: var(--text); }
.skill-row .loc { font-size: 13px; color: var(--text2); }
.lb-badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 6px 12px; border-radius: 999px;
  background: rgba(240, 177, 40, 0.15); color: #a06b00;
  font-size: 12px; font-weight: 800;
}


/* ── Split landing (welcome ad left, auth right) ───────────────────── */
.landing-split { display: flex; min-height: 100vh; }
.landing-left {
  flex: 1; position: relative; overflow: hidden;
  background: #101840;
  color: #fff;
  padding: 48px 44px;
  display: flex; flex-direction: column; justify-content: center;
}
.ll-glow {
  position: absolute; top: -120px; right: -120px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.5), transparent 65%);
}
.ll-brand {
  display: flex; align-items: center; gap: 10px; margin-bottom: 34px;
  position: relative;
}
.ll-brand img { width: 44px; height: 44px; border-radius: 11px; }
.ll-brand span {
  font-family: "Carlito", Calibri, sans-serif; font-size: 26px; font-weight: 700;
}
.ll-head {
  font-size: clamp(34px, 4.2vw, 54px); font-weight: 800;
  line-height: 1.06; letter-spacing: -1px; position: relative;
}
.ll-head em { font-style: normal; color: #8b6cf5; }
.ll-sub {
  margin-top: 18px; font-size: 15px; line-height: 1.55;
  color: rgba(255, 255, 255, 0.75); max-width: 420px; position: relative;
}
.ll-points { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.ll-points div {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.85);
}
.landing-right {
  flex: 1; position: relative;
  padding: 60px 28px 28px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px;
}
.landing-right .auth-card { width: 100%; max-width: 420px; margin: 0; }
.landing-gear { position: absolute; top: 16px; right: 16px; }
.landing-menu {
  position: absolute; top: 58px; right: 16px; z-index: 30;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 14px; box-shadow: 0 10px 34px rgba(16, 24, 64, 0.18);
  display: flex; flex-direction: column; min-width: 210px; overflow: hidden;
}
.landing-menu a, .landing-menu button {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 15px; font-size: 14px; font-weight: 600;
  color: var(--text); text-align: left; background: none;
}
.landing-menu a:hover, .landing-menu button:hover { background: var(--input-bg); }
.landing-foot {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  justify-content: center;
  font-size: 12px; color: var(--text3); margin-top: 6px;
}
.landing-foot a { color: var(--accent); font-weight: 700; }
.appstore-card.compact {
  flex-direction: row; text-align: left; gap: 12px;
  padding: 14px 16px; margin: 0; width: 100%; max-width: 420px;
}
.appstore-card.compact .as-logo { width: 44px; height: 44px; border-radius: 11px; }
.appstore-card.compact .as-desc { max-width: none; }
.appstore-card.compact .as-badge { margin: 0 0 0 auto; flex: 0 0 auto; }
@media (max-width: 860px) {
  .landing-split { flex-direction: column; }
  .landing-left { padding: 40px 24px; min-height: 340px; }
  .landing-right { padding-top: 22px; }
  .landing-gear { position: fixed; }
  .landing-menu { position: fixed; }
}

/* signup extras */
.tos-row {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  font-size: 13px; color: var(--text2);
}
.tos-row a { color: var(--accent); font-weight: 700; }
#pin-map {
  height: 200px; border-radius: 12px; margin-top: 10px;
  border: 1px solid var(--card-border); overflow: hidden; z-index: 0;
}
.exp-chip {
  background: var(--input-bg); border-radius: 10px; padding: 9px 11px;
  font-size: 13px; color: var(--text2); margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.exp-chip b { color: var(--text); }
.exp-del { margin-left: auto; color: var(--danger); font-weight: 800; background: none; }
.exp-form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

/* verify screen */
.verify-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px; position: relative;
}
.verify-skip { position: absolute; top: 16px; right: 16px; }

/* tab mark */
.tab-mark { width: 22px; height: 22px; object-fit: contain; display: block; }

/* ── Dark mode ─────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #12141c;
  --card: #1c1f2b;
  --card-border: #2a2e3f;
  --input-bg: #232736;
  --input-border: #343950;
  --chip-bg: #2b2450;
  --divider: #2a2e3f;
  --text: #f2f2f7;
  --text2: #b9bcc9;
  --text3: #7e8294;
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] .header { background: rgba(20, 22, 32, 0.92); }
[data-theme="dark"] .tabbar { background: rgba(24, 26, 38, 0.96); }
[data-theme="dark"] .landing-menu { box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5); }

.step-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.filter-modal { max-height: 82vh; overflow-y: auto; }
.seg-row { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-chip {
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 999px; padding: 7px 12px;
  font-size: 12.5px; font-weight: 700; color: var(--text2);
}
.seg-chip.active {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text);
}


/* ── Modal overlay: centered, dark scrim (was missing → bottom-left) ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(12, 14, 30, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.modal-backdrop .modal {
  width: 100%; max-width: 420px;
  background: var(--card); border-radius: 20px;
  padding: 20px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  max-height: 85vh; overflow-y: auto;
}

/* thread menu + rows */
.dots-btn {
  background: none; color: var(--text3); font-size: 20px; font-weight: 800;
  padding: 4px 8px; border-radius: 8px;
}
.dots-btn:hover { background: var(--input-bg); }
.menu-row {
  display: block; width: 100%; text-align: left;
  padding: 13px 12px; border-radius: 10px;
  font-size: 14.5px; font-weight: 600; color: var(--text);
  background: none;
}
.menu-row:hover { background: var(--input-bg); }
.menu-row.danger { color: var(--danger); }

/* settings */
.set-card { padding: 4px 6px; }
.set-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 13px 10px; background: none;
  font-size: 14.5px; font-weight: 600; color: var(--text);
  border-bottom: 1px solid var(--divider); text-align: left;
}
.set-card .set-row:last-child { border-bottom: none; }
.set-row:hover { background: var(--input-bg); border-radius: 10px; }
.set-val { color: var(--text3); font-size: 13px; font-weight: 500; max-width: 55%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch {
  width: 42px; height: 25px; border-radius: 999px;
  background: var(--input-border); position: relative; flex: 0 0 42px;
  transition: background 0.15s;
}
.switch .knob {
  position: absolute; top: 2.5px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: left 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch.on { background: var(--accent); }
.switch.on .knob { left: 19px; }
.made-with {
  text-align: center; color: var(--text3); font-size: 12.5px;
  margin: 26px 0 10px;
}
.made-with .heart { color: #e0245e; }

.forum-media {
  width: 100%; max-height: 340px; object-fit: cover;
  border-radius: 12px; margin: 8px 0 6px; display: block;
  background: #000;
}
/* Google Places dropdown above modals */
.pac-container { z-index: 300; }


/* margins requested: filter row above map, archive row above inbox */
.browse-head { margin-bottom: 14px; }

/* budget chip under map dots */
.map-budget {
  background: #fff; border: 1px solid rgba(0,0,0,0.15);
  border-radius: 999px; padding: 1px 7px;
  font-size: 11px; font-weight: 800; color: #1c1b22;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.map-budget::before { display: none; }
.gm-budget {
  background: #fff; border-radius: 999px; padding: 1px 7px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* forum cards clickable */
.forum-card { cursor: pointer; }
.forum-card:hover { border-color: var(--accent); }

/* ── Media viewer ─────────────────────────────────────────────────── */
#viewer-root .viewer-backdrop {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(5, 6, 14, 0.92);
  display: flex; align-items: center; justify-content: center;
}
.viewer-stage {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  touch-action: none; overflow: hidden;
}
.viewer-media {
  max-width: 94vw; max-height: 88vh;
  border-radius: 8px; user-select: none;
  transition: transform 0.05s linear;
}
.viewer-x {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: #fff;
  font-size: 16px; font-weight: 800;
}
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: #fff;
  font-size: 26px; font-weight: 800; line-height: 1;
}
.viewer-nav.prev { left: 14px; }
.viewer-nav.next { right: 14px; }
.viewer-count {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.8); font-size: 13px; font-weight: 700;
}


/* ── Custom video player (matches the iOS MechVideoPlayer) ─────────── */
.mc-player {
  position: relative; width: 100%; margin: 8px 0 6px;
  border-radius: 12px; overflow: hidden; background: #000;
}
.mc-player video { width: 100%; max-height: 380px; display: block; }
.vp-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(10, 10, 16, 0.55); backdrop-filter: blur(6px);
  color: #fff; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.25s;
}
.vp-center svg { width: 26px; height: 26px; margin-left: 2px; }
.vp-bar {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  display: flex; align-items: center; gap: 9px;
  background: rgba(10, 10, 16, 0.6); backdrop-filter: blur(8px);
  border-radius: 999px; padding: 7px 12px;
  transition: opacity 0.25s;
}
.vp-bar button {
  background: none; color: #fff; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center; flex: 0 0 22px;
}
.vp-bar button svg { width: 18px; height: 18px; }
.vp-track {
  flex: 1; height: 5px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.28); cursor: pointer;
  touch-action: none;
}
.vp-fill {
  height: 100%; width: 0%; border-radius: 999px; background: #fff;
}
.vp-time {
  color: rgba(255, 255, 255, 0.85); font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums; flex: 0 0 auto;
}
.mc-player.hide-controls .vp-bar,
.mc-player.hide-controls .vp-center { opacity: 0; pointer-events: none; }
.mc-player:fullscreen { display: flex; align-items: center; background: #000; }
.mc-player:fullscreen video { max-height: 100vh; width: 100%; }
.viewer-video { width: min(94vw, 900px); }
.viewer-video .mc-player { margin: 0; }

/* ── Rich job rows (browse board) ─────────────────────────────── */
.job-row-rich { flex-direction: column; align-items: stretch; gap: 8px; }
.job-row-rich .jr-top { display: flex; gap: 12px; align-items: flex-start; }
.job-row-rich h4 { white-space: normal; }
.jr-vehicle { color: var(--text2); }
.jr-poster { display: flex; align-items: center; gap: 6px; margin-top: 6px;
  font-size: 12px; color: var(--text2); }
.jr-poster .avatar { flex: 0 0 auto; }
.jr-image { width: 100%; max-height: 220px; object-fit: cover;
  border-radius: 12px; display: block; }

/* ── Job detail modal ─────────────────────────────────────────── */
.jobdetail { max-height: 88vh; overflow-y: auto; }
.jd-head { display: flex; align-items: flex-start; gap: 10px; }
.jd-report { flex: 0 0 auto; color: var(--text3); }
.jd-report:hover { color: #e5484d; }
.jd-poster { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.jd-poster-name { font-weight: 700; font-size: 14px; }
.jd-row { display: flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--text2); margin: 4px 0; }
.jd-map { width: 100%; height: 180px; border-radius: 12px; overflow: hidden;
  margin-top: 10px; background: var(--chip-bg); }
.jd-desc { font-size: 13px; color: var(--text2); line-height: 1.5; margin-top: 10px;
  white-space: pre-wrap; }
.jd-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px; margin-top: 10px; }
.jd-media img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }

/* ── Bid form ─────────────────────────────────────────────────── */
.jd-bid { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.jd-bid .seg { display: flex; gap: 6px; margin: 8px 0 12px; }
.seg-btn { flex: 1; padding: 9px; border: 1px solid var(--border);
  background: var(--card); border-radius: 10px; font-weight: 700; font-size: 13px;
  color: var(--text2); cursor: pointer; }
.seg-btn.active { background: var(--action-blue); color: #fff; border-color: transparent; }
.bid-fields { display: flex; flex-direction: column; gap: 8px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text3); }
.fld input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg2, var(--card)); color: var(--text); font-size: 14px; }
.btn-block { width: 100%; }

/* ── Active-bid badge + row-right column ──────────────────────── */
.jr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  flex: 0 0 auto; }
.active-bid-badge { font-size: 11px; font-weight: 800; color: #fff;
  background: var(--action-blue); padding: 3px 9px; border-radius: 999px;
  white-space: nowrap; }

/* ── Job-detail back button ───────────────────────────────────── */
.jd-back { flex: 0 0 auto; color: var(--text2); }
.jd-back:hover { color: var(--text); }

/* SEO content — present in the DOM for crawlers, off-screen for users.
   (Not display:none, which search engines discount; the app's JS clears
   #app on load but this sibling block stays crawlable in the static HTML.) */
.seo-content {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  border: 0; padding: 0; margin: -1px;
}

/* ── Marketplace ──────────────────────────────────────────────── */
.market-map { width: 100%; height: 200px; border-radius: 14px; overflow: hidden;
  margin-bottom: 14px; background: var(--chip-bg); }
.market-card { cursor: pointer; }
.mk-orig { text-decoration: line-through; color: var(--text3); font-size: 12px;
  font-weight: 600; margin-left: 4px; }
.mk-loc { font-size: 11px; color: var(--text3); display: flex; align-items: center;
  gap: 4px; margin-top: 2px; }

/* ── Profile redesign (web) ───────────────────────────────────── */
.profile-head .banner { height: 200px !important; }
.profile-head .avatar { width: 104px !important; height: 104px !important;
  margin: -52px auto 8px !important; font-size: 36px !important; }
.seal { color: var(--success); font-size: 0.8em; }
.skill-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  justify-content: center; }

/* Followers / following clickable boxes */
.follow-card { display: flex; gap: 12px; padding: 0 !important; background: none !important;
  border: none !important; box-shadow: none !important; }
.follow-box { flex: 1; text-align: center; padding: 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border); cursor: pointer; }
.follow-n { font-size: 22px; font-weight: 800; color: var(--text); }
.follow-row { display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px; border: none; background: none; cursor: pointer; text-align: left;
  border-radius: 10px; }
.follow-row:hover { background: var(--chip-bg); }

/* Completed-job boxes */
.cj-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.cj-box, .cert-box { display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px; border-radius: 12px; background: var(--card);
  border: 1px solid var(--border); cursor: pointer; text-align: left; }
.cj-box:hover, .cert-box:hover { border-color: var(--action-blue); }
.cj-glyph { width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; background: var(--chip-bg); color: var(--accent); flex: 0 0 auto; }
.cj-info { flex: 1; min-width: 0; }
.cj-info b { font-size: 14px; color: var(--text); }
.cj-chev { transform: rotate(180deg); color: var(--text3); flex: 0 0 auto; }
.cj-more { width: 100%; padding: 10px; margin-top: 8px; border: none; background: none;
  color: var(--action-blue); font-weight: 700; font-size: 13px; cursor: pointer; }

/* Social media boxes with avatar on top */
.social-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0; }
.social-box { flex: 0 0 auto; width: 84px; text-align: center; text-decoration: none;
  padding: 12px 8px; border-radius: 12px; background: var(--card);
  border: 1px solid var(--border); cursor: pointer; }
.social-avatar { width: 44px; height: 44px; margin: 0 auto 6px; border-radius: 50%;
  display: grid; place-items: center; background: var(--chip-bg); color: var(--accent); }
.social-name { font-size: 11px; font-weight: 700; color: var(--text);
  text-transform: capitalize; }

/* Experience timeline */
.section-toggle { display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none; cursor: pointer; padding: 0; }
.section-chev { color: var(--text3); transform: rotate(-90deg); transition: transform .2s; }
.section-chev.open { transform: rotate(90deg); }
.timeline { margin-top: 12px; }
.tl-item { display: grid; grid-template-columns: 46px 16px 1fr; align-items: start;
  gap: 8px; position: relative; padding-bottom: 14px; }
.tl-item:not(:last-child) .tl-dot::after { content: ""; position: absolute; left: 50%;
  top: 14px; bottom: -14px; width: 2px; background: var(--border); transform: translateX(-50%); }
.tl-year { font-size: 12px; font-weight: 800; color: var(--text2); text-align: right;
  padding-top: 1px; }
.tl-dot { position: relative; width: 12px; height: 12px; border-radius: 50%;
  background: var(--action-blue); margin: 3px auto 0; }
.tl-body { font-size: 14px; color: var(--text); }
.cert-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
