/* SwiftGigs — big-tech UX patterns (additive; does not rename CSS vars)
 *
 * Every rule here now derives from qg-tokens.css. The body.light overrides this
 * file used to carry are gone rather than tokenized: the base rules use
 * --surface, --border, --text and --text-muted, which already flip with the
 * theme, so an override could only ever restore the pre-rebrand palette.
 */

/* Command search */
.qg-cmd-overlay {
  position: fixed; inset: 0; z-index: 9500;
  background: var(--scrim);
  display: none; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 24px; backdrop-filter: blur(8px);
}
.qg-cmd-overlay.open { display: flex; }
.qg-cmd-box {
  width: min(640px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.qg-cmd-input {
  width: 100%; border: none; outline: none;
  padding: 18px 20px; font-size: 18px; font-family: inherit;
  background: transparent; color: var(--text);
}
.qg-cmd-hint {
  padding: 0 20px 12px; font-size: 12px;
  color: var(--text-muted);
}
.qg-cmd-results { max-height: 50vh; overflow: auto; padding: 0 8px 12px; }
.qg-cmd-group {
  font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600;
  color: var(--text-muted); padding: 10px 12px 4px;
}
.qg-cmd-item {
  display: block; width: 100%; text-align: left;
  padding: 12px 14px; border: none; border-radius: 12px;
  background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.qg-cmd-item:hover, .qg-cmd-item.active { background: var(--surface-alt); }
.qg-cmd-item-title { font-size: 14px; font-weight: 500; }
.qg-cmd-item-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.qg-nav-search-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text); cursor: pointer;
  font-size: 15px; display: inline-flex; align-items: center; justify-content: center;
  margin-right: 6px;
}

/* Activity feed */
.qg-activity-card {
  margin: 0 16px 20px; padding: 16px 18px; border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.qg-activity-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.qg-activity-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.qg-activity-row:first-of-type { border-top: none; }
.qg-activity-ico { font-size: 18px; line-height: 1.2; flex-shrink: 0; }
.qg-activity-text { font-size: 13px; line-height: 1.45; flex: 1; }
.qg-activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Posttask progress */
.qg-post-progress {
  display: flex; gap: 6px; align-items: center; margin: 0 0 18px;
  padding: 10px 12px; border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.qg-post-step {
  flex: 1; min-width: 70px; text-align: center; font-size: 11px;
  color: var(--text-muted); position: relative; padding-top: 10px;
}
.qg-post-step::before {
  content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 4px;
  border-radius: 4px; background: var(--border);
}
.qg-post-step.done, .qg-post-step.current { color: var(--text); }
.qg-post-step.done::before { background: var(--accent); }
.qg-post-step.current::before { background: var(--accent); }
.qg-budget-guide {
  margin-top: 8px; font-size: 12px; line-height: 1.5;
  color: var(--text-muted);
}

/* Status timeline */
.qg-timeline {
  display: flex; gap: 4px; margin: 12px 0 4px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; padding-bottom: 2px;
}
.qg-tl-step {
  flex: 1; min-width: 64px; text-align: center; font-size: 10px;
  color: var(--text-muted); position: relative; padding-top: 18px;
}
.qg-tl-step::before {
  content: ''; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface-alt); border: 2px solid var(--border);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
}
.qg-tl-step.done { color: var(--text); }
.qg-tl-step.done::before {
  background: var(--accent); border-color: var(--accent);
  content: '✓'; color: var(--accent-text); font-size: 8px; line-height: 12px; text-align: center;
}
.qg-tl-step.current { color: var(--text); font-weight: 600; }
.qg-tl-step.current::before {
  background: var(--accent); border-color: var(--accent);
}

/* Undo toast */
.qg-undo-toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(20px); z-index: 9600;
  background: var(--surface); color: var(--text); border-radius: 14px;
  padding: 12px 14px; display: none; align-items: center; gap: 12px;
  border: 1px solid var(--border);
  max-width: min(420px, calc(100vw - 24px)); opacity: 0;
  transition: opacity 0.2s, transform 0.2s; font-size: 13px;
}
.qg-undo-toast.show { display: flex; opacity: 1; transform: translateX(-50%) translateY(0); }
.qg-undo-toast button {
  border: 1px solid var(--border); background: var(--surface-alt); color: var(--text);
  border-radius: 8px; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer;
  min-height: 36px;
}
.qg-undo-count { opacity: 0.55; font-size: 11px; }

/* Legacy injected completeness card — disabled; use #profileCompleteCard */
.qg-complete-card { display: none !important; }
.qg-complete-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.qg-complete-pct { font-weight: 600; color: var(--accent); }
.qg-complete-bar {
  height: 6px; border-radius: 6px; background: var(--surface-alt); overflow: hidden; margin-bottom: 10px;
}
.qg-complete-bar > i {
  display: block; height: 100%; background: var(--accent);
  border-radius: 6px; transition: width 0.4s ease;
}
.qg-complete-item {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  color: inherit; font: inherit; font-size: 13px; padding: 8px 0; cursor: pointer;
  border-top: 1px solid var(--border);
}
.qg-complete-item:hover { color: var(--accent); }

/* Session modal */
.qg-session-overlay {
  position: fixed; inset: 0; z-index: 9700; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: var(--scrim);
}
.qg-session-overlay.open { display: flex; }
.qg-session-card {
  width: min(360px, 100%); background: var(--surface); border-radius: 14px;
  padding: 24px; border: 1px solid var(--border); text-align: center;
  color: var(--text);
}
.qg-session-card h2 { font-size: 18px; margin: 0 0 8px; font-weight: 700; }
.qg-session-card p { font-size: 14px; line-height: 1.5; color: var(--text-muted); margin: 0 0 18px; }
.qg-session-card button {
  width: 100%; min-height: 48px; border: none; border-radius: 12px;
  background: var(--primary); color: var(--primary-text);
  font: inherit; font-weight: 600; cursor: pointer;
}

/* Shortcuts cheat sheet */
.qg-shortcuts-overlay {
  position: fixed; inset: 0; z-index: 9550; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: var(--scrim);
}
.qg-shortcuts-overlay.open { display: flex; }
.qg-shortcuts-card {
  width: min(400px, 100%); background: var(--surface); border-radius: 14px;
  padding: 22px; border: 1px solid var(--border);
  color: var(--text);
}
.qg-shortcuts-card h2 { font-size: 16px; margin: 0 0 14px; }
.qg-shortcut-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; padding: 8px 0; border-top: 1px solid var(--border);
}
.qg-shortcut-row kbd {
  font-family: inherit; font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: var(--surface-alt); border: 1px solid var(--border);
}

/* New pill + saving + micro confirm */
.qg-new-pill {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent-on-soft); margin-left: 6px;
}
.qg-saving-dot {
  font-size: 11px; color: var(--text-muted); margin-left: 6px;
}
.qg-micro-check {
  position: absolute; pointer-events: none; z-index: 100;
  width: 28px; height: 28px; border-radius: 50%;
  /* --bg reads correctly on --green in both themes: the dark-mode green is
     light and the light-mode green is dark, and --bg inverts with it. */
  background: var(--green); color: var(--bg); font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  animation: qgMicroCheck 0.7s ease forwards;
}
@keyframes qgMicroCheck {
  0% { transform: scale(0.4); opacity: 0; }
  40% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* Sticky invite CTA */
.qg-sticky-invite {
  display: none;
  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 CTA, so it has to track --bg, not --surface. */
  background: linear-gradient(180deg, transparent, var(--bg) 28%);
}
.qg-sticky-invite a, .qg-sticky-invite button {
  display: block; width: 100%; min-height: 48px; border: none; border-radius: 12px;
  background: var(--primary); color: var(--primary-text);
  font: inherit; font-weight: 600; cursor: pointer; text-align: center;
  text-decoration: none; line-height: 48px;
}
@media (max-width: 640px) {
  body.qg-other-profile .qg-sticky-invite { display: block; }
  body.qg-other-profile { padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)) !important; }
  .modal-footer .apply-btn, .modal-footer #applyBtn, .modal-footer button.primary {
    width: 100%; min-height: 48px;
  }
}

/* Destructive safety. The .btn-danger / .decline-btn rule that stood here is
   now in qg-refine.css, which reaches 25 pages to this file's 10 — the two
   declared it differently, both with !important, so the later sheet silently
   won. */
.confirm-ok.is-danger {
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent) !important;
}

@media (prefers-reduced-motion: reduce) {
  .qg-micro-check { animation: none !important; }
}
