/* SwiftGigs — UX overhaul layer (trust, a11y, mobile, polish). Additive; does not rename CSS vars. */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 10px 16px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 14px;
  font-weight: 500;
  border-radius: 0 0 10px 0;
  text-decoration: none;
}
.skip-link:focus,
.skip-link:focus-visible {
  left: 0;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

main#main,
#main.qg-main {
  animation: qgMainIn 0.25s ease;
}

/* Safety net: if chat content was wrapped in #main, preserve body flex column layout */
body.qg-page-chat > #main.qg-main,
body.page-chat > #main.qg-main,
body.qg-page-chat > main#main,
body.page-chat > main#main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.qg-page-chat > #main.qg-main .chat-scroll,
body.page-chat > #main.qg-main .chat-scroll,
body.qg-page-chat > main#main .chat-scroll,
body.page-chat > main#main .chat-scroll,
body.qg-page-chat #chatScroll,
body.page-chat #chatScroll {
  flex: 1 1 auto;
  min-height: 0;
}
@keyframes qgMainIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body {
  overflow-x: hidden;
  font-size: max(14px, 1em);
  line-height: 1.5;
}

/* Readable muted text (WCAG-minded) */
.tc-cat,
.tc-info,
.tab-lbl,
.app-legal-footer,
.signup-trust,
.field-hint,
.modal-sub,
.results-txt,
.empty-txt,
.signup-subtitle {
  /* !important is a readability floor against older page CSS. --text-muted
     already flips with the theme, so the body.light twin that stood here is
     deleted. .tab-lbl is inert either way: qg-shell.css sets the same token
     at higher specificity, also !important. */
  color: var(--text-muted) !important;
}

.nav-beta-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--money-soft);
  border: 1px solid color-mix(in srgb, var(--green) 28%, transparent);
  vertical-align: middle;
  white-space: nowrap;
}

.qg-trust-footer {
  text-align: center;
  padding: 20px 16px calc(96px + env(safe-area-inset-bottom, 0px));
  font-size: 12px;
  line-height: 1.75;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.qg-trust-footer .qg-foot-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 15px;
  background: var(--grad-wordmark);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 6px;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .qg-trust-footer .qg-foot-brand {
    background: none;
    color: var(--primary);
    -webkit-text-fill-color: var(--primary);
  }
}
.qg-trust-footer .qg-foot-co { margin-bottom: 8px; }
.qg-trust-footer a {
  color: var(--text-muted);
  text-decoration: none;
}
.qg-trust-footer a:hover { color: var(--text); text-decoration: underline; }
.qg-trust-footer .qg-foot-links { margin: 8px 0; }
.qg-trust-footer .qg-foot-email { word-break: break-word; }

.qg-pipeda-line {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}

.qg-field-error {
  display: none;
  margin-top: 4px;
  font-size: 12px;
  color: var(--danger);
  line-height: 1.4;
}
.qg-field-error.show { display: block; }
.qg-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 25%, transparent) !important;
}
.qg-submit-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  min-height: 1.2em;
}

.qg-tip-wrap { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.qg-tip-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.qg-tip-pop {
  display: none;
  position: absolute;
  z-index: 80;
  left: 0;
  top: calc(100% + 6px);
  width: min(260px, 70vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}
.qg-tip-wrap.open .qg-tip-pop { display: block; }

.qg-onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--scrim);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}
.qg-onboard-overlay.open { display: flex; }
.qg-onboard-card {
  width: min(400px, 100%);
  border-radius: 14px;
  padding: 24px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.qg-onboard-step { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.qg-onboard-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; line-height: 1.35; }
.qg-onboard-sub { font-size: 14px; line-height: 1.55; color: var(--text-muted); margin-bottom: 20px; }
.qg-onboard-btn {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.qg-onboard-skip {
  display: block;
  width: 100%;
  margin-top: 10px;
  min-height: 40px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.qg-onboard-skip:hover { color: var(--text); }

.qg-hint-banner {
  margin: 10px 16px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.qg-online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 25%, transparent);
  margin-left: 6px;
  vertical-align: middle;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 640px) {
  .price-grid,
  .field-row,
  .mode-grid,
  .actions-grid,
  .stats-grid,
  .modal-btns,
  .confirm-btns {
    grid-template-columns: 1fr !important;
  }
  .stats-grid { grid-template-columns: 1fr 1fr !important; }

  .modal-overlay.open,
  .confirm-overlay.open {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-overlay.open .modal,
  .confirm-overlay.open .confirm-box,
  .qg-sheet {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 90vh;
    overflow: auto;
  }
  .modal-handle,
  .qg-sheet-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 8px auto 14px;
  }

  .mode-row,
  .cat-row,
  .chips-row,
  .filter-row {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mode-row::-webkit-scrollbar,
  .cat-row::-webkit-scrollbar,
  .chips-row::-webkit-scrollbar { display: none; }

  .tc-title,
  .task-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }

  .bubble,
  .tc-desc,
  .task-desc {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .act-btn,
  .accept-btn,
  .submit-btn,
  .empty-btn {
    min-height: 48px;
    margin: 4px 0;
  }

  .qg-sticky-post-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    padding: 10px 16px;
    /* Fades the page out behind the bar, so it tracks --bg, not --surface. */
    background: linear-gradient(180deg, transparent, var(--bg) 30%);
  }
  .qg-sticky-post-bar .submit-btn,
  .qg-sticky-post-bar #postBtn,
  .qg-sticky-post-bar .post-btn {
    width: 100%;
    min-height: 52px;
  }
  body.qg-page-posttask {
    padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

.qg-section {
  padding: 16px;
}
@media (min-width: 768px) {
  .qg-section { padding: 24px; }
}

.tab-bar .tab-item {
  min-height: 48px;
  gap: 4px;
}
.tab-bar .tab-lbl { font-size: 10px; }
.tab-unread-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--danger-text);
  font-size: 10px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
}
.tab-item { position: relative; }
.tab-item.has-unread .tab-unread-badge { display: inline-flex; }

.qg-beta-free-note {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

.qg-field-hint,
.field-hint.qg-field-hint {
  font-size: 12px;
  line-height: 1.5;
  margin: 4px 0 8px;
  color: var(--text-muted);
}

/* Contrast / readability pass — informational muted text floor */
/* The ":root, body" and "body.light" blocks that stood here redeclared
   --text-muted and --text-faint as fixed alphas, shadowing qg-tokens.css on
   every page that loads this sheet. The eight other vars they declared
   (--time-color, --desc-color, --info-color, --results-color, --empty-color,
   --read-preview, --pill-inactive-color, --cat-inactive-color) had no
   consumers anywhere in the repo, so both blocks are deleted outright. */

/* Chat timestamps + read receipts */
.bubble-time,
.bubble-check,
.date-divider {
  font-size: 11px;
  color: var(--text-muted);
}

/* Notification panel body — tokens (qg-bell.css owns the panel).
   Every rule below used to be followed by a body.light / html.light twin
   declaring the identical token. Those were no-ops — the token already flips
   with the theme — so they are deleted rather than kept. */
.qg-bell-item-body {
  color: var(--text-muted);
}
.qg-bell-item-time,
.qg-bell-empty {
  color: var(--text-muted);
}

/* Task card price stands out in meta / price row */
.tc-price,
.tc-meta-price,
.task-price {
  color: var(--green);
  font-weight: 700;
}
.tc-meta {
  color: var(--text-muted);
}
.tc-info {
  color: var(--text-muted);
  font-size: 11px;
}

.empty-state .empty-btn { margin-top: 14px; }

@media (max-width: 640px) {
  .modal-handle,
  .qg-sheet-handle {
    display: block;
  }
}
@media (min-width: 641px) {
  .modal-handle,
  .qg-sheet-handle { display: none; }
}
