/* ============================================================
   PIVX Tasks — Page-specific views
   ============================================================ */


/* ============================================================
   LANDING HERO (anonymous home)
   ============================================================ */
.hero {
  position: relative;
  margin: var(--space-xl) auto var(--space-3xl);
  padding: var(--space-3xl) var(--space-xl);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #08080F 0%, #1a0a3a 25%, #0E0E1A 50%, #2E1065 75%, #08080F 100%);
  background-size: 400% 400%;
  animation: meshDrift 20s ease infinite;
  opacity: 0.9;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  /* Both highlights pushed to the right half so left-aligned headline + subtitle
     stay readable against the dark base. */
  background: radial-gradient(ellipse at 80% 30%, rgba(124, 58, 237, 0.32) 0%, transparent 55%),
              radial-gradient(ellipse at 95% 70%, rgba(167, 139, 250, 0.22) 0%, transparent 55%);
  pointer-events: none;
}
/* Faint PIVX shield watermark — sits inside the right-side glow so the
   logo appears to *be* the source of the gradient bloom, like sunlight
   through a stained-glass cathedral window. Sits below `.hero-content`
   in DOM order so the headline/copy paint cleanly over it. */
.hero-shield {
  position: absolute;
  right: -15%;
  top: 10%;
  transform: translateY(-50%);
  width: 500px;
  height: 500px;
  max-width: 60%;
  background: url('/img/pivx-shield.svg') center / contain no-repeat;
  pointer-events: none;
  filter: blur(4px);
  animation: heroShieldBreathe 8s ease-in-out infinite;
}
@keyframes heroShieldBreathe {
  0%, 100% { opacity: 0.05; transform: translateY(-50%) scale(1); }
  50%      { opacity: 0.09; transform: translateY(-50%) scale(1.02); }
}
@media (max-width: 768px) {
  /* On narrow screens the headline takes up most of the hero — pull the
     shield smaller and tuck it further right so it stays scenery, not
     furniture. */
  .hero-shield { width: 320px; height: 320px; right: -10%; opacity: 0.05; }
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: var(--space-lg);
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--purple-light);
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}
.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple-light);
  box-shadow: 0 0 8px var(--purple-light);
  animation: progressGlow 2s ease infinite;
}
.hero-tagline {
  font-family: var(--font-brand);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--purple-light);
  text-transform: uppercase;
  margin-bottom: var(--space-md);
  opacity: 0.8;
}
.hero-headline {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-bright);
  margin-bottom: var(--space-md);
  max-width: 900px;
}
.hero-headline .accent {
  background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 50%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(124, 58, 237, 0.5);
}
.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 620px;
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}
.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Dual-audience split */
.hero-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}
.hero-duo-card {
  position: relative;
  padding: var(--space-xl);
  background: rgba(14, 14, 26, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  transition: all var(--duration-normal) var(--ease-out);
}
.hero-duo-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}
.hero-duo-eyebrow {
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--purple-light);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-duo-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  margin-bottom: 12px;
  line-height: 1.1;
}
.hero-duo-sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .hero { padding: var(--space-2xl) var(--space-lg); border-radius: var(--radius-xl); }
  .hero-duo { grid-template-columns: 1fr; gap: var(--space-md); }
  .hero-duo-card { padding: var(--space-lg); }
  .hero-duo-title { font-size: 22px; }
}


/* ============================================================
   ONBOARDING CHECKLIST (home page first-run card)
   ============================================================ */
.onboarding-card {
  position: relative;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  padding: var(--space-xl);
  border: 1px solid var(--border-popup);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(124, 58, 237, 0.16), transparent 60%),
    rgba(14, 14, 26, 0.7);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-popup);
}
.onboarding-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.onboarding-headline {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  margin: 6px 0 4px;
  line-height: 1.2;
}
.onboarding-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}
.onboarding-progress {
  flex-shrink: 0;
  text-align: right;
  min-width: 120px;
}
.onboarding-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}
.onboarding-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--purple-light));
  border-radius: var(--radius-full);
  transition: width var(--duration-normal) var(--ease-out);
}
.onboarding-progress-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.onboarding-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.onboarding-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-out);
}
.onboarding-item.is-done {
  opacity: 0.55;
}
.onboarding-item:not(.is-done):hover {
  border-color: var(--border-strong);
}
.onboarding-check {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-default);
  background: var(--bg-input);
  color: var(--green);
}
.onboarding-item.is-done .onboarding-check {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.12);
}
.onboarding-check svg { width: 14px; height: 14px; }
.onboarding-item-text { flex: 1; min-width: 0; }
.onboarding-item-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.onboarding-item.is-done .onboarding-item-label { text-decoration: line-through; }
.onboarding-item-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.onboarding-action-pair {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .onboarding-card { padding: var(--space-lg); }
  .onboarding-head {
    flex-direction: column;
  }
  .onboarding-progress {
    width: 100%;
    text-align: left;
  }
  .onboarding-item {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
  .onboarding-action-pair { width: 100%; }
  .onboarding-action-pair .btn { flex: 1; }
}


/* ============================================================
   BROWSE CTA (post-your-own footer card)
   ============================================================ */
.browse-cta {
  margin-top: var(--space-2xl);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  background:
    radial-gradient(140% 100% at 80% 0%, rgba(124, 58, 237, 0.18), transparent 60%),
    rgba(14, 14, 26, 0.6);
  backdrop-filter: blur(12px);
  transition: border-color var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
}
.browse-cta:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glow);
}
.browse-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  padding: var(--space-xl);
}
.browse-cta-text { flex: 1; min-width: 0; }
.browse-cta-eyebrow {
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--purple-light);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.browse-cta-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  margin: 0 0 6px;
  line-height: 1.2;
}
.browse-cta-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
  max-width: 56ch;
}
.browse-cta-btn { flex-shrink: 0; }

@media (max-width: 640px) {
  .browse-cta-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-lg);
    padding: var(--space-lg);
  }
  .browse-cta-title { font-size: 20px; }
}


/* ============================================================
   HOW IT WORKS (tri-column)
   ============================================================ */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-3xl);
}
.how-step {
  position: relative;
  padding: var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.how-step-number {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-family: var(--font-brand);
  font-size: 36px;
  font-weight: 600;
  color: var(--purple);
  opacity: 0.3;
  line-height: 1;
}
.how-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--purple-glow);
  border: 1px solid var(--border-default);
  color: var(--purple-light);
  margin-bottom: var(--space-md);
}
.how-step-icon svg { width: 22px; height: 22px; }
.how-step-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.how-step-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .how-grid { grid-template-columns: 1fr; }
}


/* ============================================================
   FILTER BAR (browse)
   ============================================================ */
.filter-bar {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.filter-search {
  flex: 1 1 280px;
  position: relative;
}
.filter-search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--duration-fast) var(--ease-out);
}
.filter-search input:focus {
  outline: none;
  border-color: var(--purple);
  background: var(--bg-base);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.filter-search input::placeholder { color: var(--text-muted); }
.filter-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.filter-select {
  padding: 12px 36px 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B8BA0' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  transition: all var(--duration-fast) var(--ease-out);
  min-width: 140px;
}
.filter-select:hover { border-color: var(--border-default); }
.filter-select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}


/* ============================================================
   TASK CARD (feed item)
   ============================================================ */
.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-md);
}
.task-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
  overflow: hidden;
  cursor: pointer;
}
.task-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  pointer-events: none;
}
.task-card:hover {
  border-color: var(--border-default);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  color: var(--text-primary);
}
.task-card:hover::before { opacity: 1; }

.task-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}
.task-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.task-card-bounty {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  flex-shrink: 0;
}
.task-card-bounty-amount {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--purple-light);
  line-height: 1;
  text-shadow: 0 0 16px rgba(167, 139, 250, 0.3);
  letter-spacing: -0.01em;
}
.task-card-bounty-unit {
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}
.task-card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
  /* line clamp */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Description row — text on the left filling the available column,
   timestamp tucked to the right at the same bottom baseline. Grid
   plays cleaner with line-clamp than flex (line-clamp's
   `display: -webkit-box` can confuse flex's intrinsic-sizing pass and
   force the timestamp onto a new line). `align-items: end` puts the
   timestamp next to the LAST visible line of the description, whether
   the description wraps to 1 or 2 lines. */
.task-card-desc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--space-md);
}
.task-card-desc {
  min-width: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-card-time {
  font-size: 12px;
  color: #FFFFFF82;
  white-space: nowrap;
}
.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-muted);
}
.task-card-footer a { color: var(--text-secondary); }
.task-card-footer a:hover { color: var(--purple-light); }
/* Multi-worker availability — slots between the creator handle and
   the timestamp. Mono digit so X/Y reads like a count not prose;
   subtle bold on the leading number to put the "still room?" answer
   first. With flex space-between the segment naturally sits centred. */
.task-card-spots {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.task-card-spots strong {
  color: var(--text-bright);
  font-weight: 700;
}
.task-card-rep {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.task-card-rep .check { color: var(--green); }
.task-card-rep .cross { color: var(--text-muted); }

/* Multi-worker progress strip (cards + detail) */
.slots-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.slots-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}
.slots-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple) 0%, var(--green) 100%);
  border-radius: var(--radius-full);
  transition: width 400ms var(--ease-out);
}
.slots-count { white-space: nowrap; color: var(--text-secondary); }
.slots-count strong { color: var(--text-bright); font-weight: 700; }


/* ============================================================
   TASK DETAIL
   ============================================================ */
.task-detail {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-2xl);
  align-items: start;
}
.task-detail-main {
  min-width: 0;
}
.task-detail-side {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-md));
}
.task-detail-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
  font-size: 13px;
  color: var(--text-muted);
}
.task-detail-meta-divider { color: var(--text-muted); opacity: 0.4; }
.task-detail-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-bright);
  line-height: 1.15;
  margin-bottom: var(--space-md);
}
.task-detail-desc {
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.65;
  word-wrap: break-word;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}
/* When markdown-rendered: defer all typography rules to `.md` so block
   elements (h1/h2/lists/code) get their proper margins. */
.task-detail-desc.md { padding: var(--space-lg); }

/* Bounty hero (sidebar) — always-on version of the task-card hover state.
   Two radial highlights (top-right + bottom-left) wrap the amount in purple
   atmosphere, plus a top accent sweep for the "premium" feel. */
.bounty-hero {
  background: linear-gradient(180deg, var(--bg-card-hover) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 28px rgba(124, 58, 237, 0.16);
}
/* Top edge sweep */
.bounty-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--purple-light), transparent 90%);
  opacity: 0.7;
  z-index: 1;
}
/* Atmospheric corner glows */
.bounty-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.22) 0%, transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(167, 139, 250, 0.10) 0%, transparent 50%);
  pointer-events: none;
}
.bounty-hero-label {
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
  position: relative;
}
.bounty-hero-amount {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  position: relative;
  text-shadow: 0 0 32px rgba(124, 58, 237, 0.4);
}
.bounty-hero-unit {
  font-family: var(--font-brand);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--purple-light);
  text-transform: uppercase;
  margin-left: 8px;
  display: inline-block;
  vertical-align: middle;
  margin-bottom: 8px;
}
.bounty-hero-quoted {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  position: relative;
}

/* Task action zone (sidebar below bounty) */
.task-action-zone {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-md);
}
.task-action-zone .field { margin-bottom: var(--space-md); }
.task-action-zone .field:last-of-type { margin-bottom: var(--space-md); }

.task-meta-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}
.task-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}
.task-meta-row dt {
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.task-meta-row dd {
  color: var(--text-primary);
  font-size: 13px;
}

@media (max-width: 1024px) {
  .task-detail { grid-template-columns: 1fr; }
  .task-detail-side { position: static; }
}


/* ============================================================
   WALLET PAGE — receive card layout
   ============================================================ */
.receive-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
}
.receive-qr {
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: white;
  padding: 6px;
  box-shadow: 0 0 0 1px var(--border-default), var(--shadow-glow);
  line-height: 0;
}
.receive-qr svg { display: block; }
.receive-details { flex: 1; min-width: 0; }
@media (max-width: 540px) {
  .receive-card { flex-direction: column; align-items: stretch; gap: var(--space-md); }
  .receive-qr { align-self: center; }
}


/* ============================================================
   VERIFICATION CALLOUT (task detail) + ECHO (proof form)
   ============================================================ */
.verification-callout {
  position: relative;
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.verification-callout::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--purple-light), var(--purple));
}
.verification-callout-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-sm);
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--purple-light);
}
.verification-callout-header svg { width: 14px; height: 14px; }
.verification-callout-body { font-size: 15px; }

/* Echo above the proof submission textarea — same idea, less prominent */
.verification-echo {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--purple-glow);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 14px;
}
.verification-echo-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--purple-light);
}
.verification-echo-label svg { width: 12px; height: 12px; }
.verification-echo-body { font-size: 14px; }


/* ============================================================
   PROOF TIMELINE
   ============================================================ */
.proof-thread {
  position: relative;
  padding-left: 24px;
}
.proof-thread::before {
  content: '';
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 7px;
  width: 1px;
  background: linear-gradient(180deg, var(--border-default) 0%, var(--border-subtle) 100%);
}
.proof-entry {
  position: relative;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
}
.proof-entry::before {
  content: '';
  position: absolute;
  top: 22px;
  left: -23.5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--purple);
  box-shadow: 0 0 12px var(--purple-glow-strong);
}
.proof-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  font-size: 12px;
  color: var(--text-muted);
}
.proof-entry-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}
.proof-entry-body {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.rejection-note {
  border-left: 2px solid var(--red);
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.rejection-reason-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 600;
  margin-bottom: 4px;
}
.rejection-reason {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.proof-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}
.proof-attachment-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.proof-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  transition: all var(--duration-fast) var(--ease-out);
}
.proof-attachment:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
}
.proof-attachment.is-clickable { cursor: pointer; }
.proof-attachment.is-clickable:hover {
  border-color: var(--border-strong);
  background: var(--bg-card);
}
.proof-attachment-icon { color: var(--purple-light); flex-shrink: 0; }
.proof-attachment-icon svg { width: 14px; height: 14px; }
.proof-attachment-name { flex: 1; word-break: break-all; }
.proof-attachment-size { color: var(--text-muted); flex-shrink: 0; font-size: 11px; }
.proof-attachment-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.att-action-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.att-action-btn svg { width: 14px; height: 14px; }
.att-action-btn:hover {
  color: var(--purple-light);
  border-color: var(--border-strong);
  background: var(--bg-card);
}
.att-action-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Inline preview pane — opens beneath the chip. Same purple-tinged
   surface as the popup tokens, but lighter (no shadow), since it lives
   inline with the proof thread rather than floating above it. */
.att-preview {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.att-preview img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: 0 auto;
}
.att-preview video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: black;
}
.att-preview audio { display: block; padding: var(--space-sm); }
.att-preview iframe {
  display: block;
  width: 100%;
  height: 70vh;
  border: 0;
  background: white;
}
.att-preview-text {
  margin: 0;
  padding: var(--space-md);
  max-height: 60vh;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-deep);
  white-space: pre-wrap;
  word-break: break-word;
}
.att-preview-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-md);
  font-size: 12px;
  color: var(--text-muted);
}


/* ============================================================
   PROOF FORM
   ============================================================ */
.proof-form {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.proof-form .field { margin-bottom: var(--space-md); }
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  background: var(--bg-input);
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.dropzone:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}
.dropzone.dragging {
  border-color: var(--purple);
  background: var(--purple-glow);
}
.dropzone-icon {
  width: 32px;
  height: 32px;
  color: var(--purple-light);
  margin-bottom: 8px;
  opacity: 0.7;
}
.dropzone-text {
  font-size: 14px;
  color: var(--text-secondary);
}
.dropzone-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.dropzone input[type="file"] { display: none; }
.dropzone-files {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: var(--space-md);
  width: 100%;
}
.dropzone-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
}
.dropzone-file-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.dropzone-file-remove:hover {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
  background: var(--red-dim);
}


/* ============================================================
   CREATE FORM
   ============================================================ */
.create-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.bounty-input-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}
.bounty-input-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-light), transparent);
  opacity: 0.6;
}
.bounty-input-label {
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}
.bounty-input-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}
.bounty-amount-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--text-bright);
  outline: none;
  letter-spacing: -0.01em;
  padding: 4px 0;
  width: 100%;
  min-width: 0;
}
.bounty-amount-input::placeholder { color: var(--text-muted); opacity: 0.5; }
.bounty-amount-input::-webkit-outer-spin-button,
.bounty-amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bounty-amount-input { -moz-appearance: textfield; }
.bounty-currency-pill {
  flex-shrink: 0;
}
.bounty-input-converted {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  min-height: 18px;
}

/* Category pill row */
.category-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.category-pill {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.category-pill:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
}
.category-pill.active {
  background: var(--purple);
  color: var(--text-bright);
  border-color: var(--purple);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}


/* ============================================================
   ME PAGE: REPUTATION GAUGE
   ============================================================ */
.rep-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
}
.rep-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-light), transparent);
  opacity: 0.4;
}
.rep-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.rep-card-title {
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.rep-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
.rep-stat {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  position: relative;
  overflow: hidden;
}
/* Unified single-reputation variant: a hero number on the left with
   a soft purple bloom, breakdown chips on the right. Replaces the
   old two-stat side-by-side; one card, one identity, one number. */
.rep-stat--unified {
  padding: var(--space-lg) var(--space-xl);
  background: radial-gradient(120% 200% at 0% 50%, rgba(124, 58, 237, 0.10), transparent 55%),
              var(--bg-base);
}
.rep-hero {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}
.rep-hero-number {
  font-family: var(--font-mono);
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-bright);
  text-shadow: 0 0 24px rgba(167, 139, 250, 0.45),
               0 0 48px rgba(124, 58, 237, 0.20);
}
.rep-hero-stats {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  min-width: 0;
}
.rep-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.rep-chip-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-bright);
}
.rep-chip-value.good { color: var(--green); }
.rep-chip-value.bad  { color: var(--red); }
.rep-chip-label {
  font-family: var(--font-brand);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.rep-empty-hint {
  margin-top: var(--space-md);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.rep-stat--unified .rep-stat-bar { margin-top: var(--space-md); height: 6px; }

@media (max-width: 640px) {
  .rep-hero { gap: var(--space-md); }
  .rep-hero-number { font-size: 56px; }
  .rep-hero-stats { grid-template-columns: 1fr; gap: 8px; }
  .rep-chip { flex-direction: row; align-items: baseline; justify-content: space-between; padding: 8px 12px; }
}
.rep-stat-label {
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.rep-stat-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1;
  letter-spacing: -0.02em;
}
.rep-stat-value .completed { color: var(--green); }
.rep-stat-value .divider { color: var(--text-muted); margin: 0 4px; }
.rep-stat-value .abandoned { color: var(--text-muted); }
.rep-stat-value .abandoned.has { color: var(--red); }
.rep-stat-bar {
  margin-top: 10px;
  height: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.rep-stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--green));
  border-radius: var(--radius-full);
  transition: width 600ms var(--ease-out);
}

@media (max-width: 540px) {
  .rep-grid { grid-template-columns: 1fr; }
}


/* ============================================================
   TABS (me page)
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-lg);
}
.tab {
  position: relative;
  padding: 12px 18px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--text-bright); }
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--purple);
  box-shadow: 0 0 12px var(--purple-glow-strong);
  border-radius: var(--radius-full);
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}
.tab.active .tab-count {
  background: var(--purple-glow);
  border-color: var(--border-default);
  color: var(--purple-light);
}


/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-header {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  margin-bottom: var(--space-xl);
}
.profile-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-md);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow-glow);
  animation: float 6s ease-in-out infinite;
}
.profile-avatar::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-light), transparent, var(--purple));
  z-index: -1;
}
.profile-avatar-glyph {
  font-family: var(--font-brand);
  font-size: 28px;
  font-weight: 600;
  color: var(--text-bright);
  text-transform: uppercase;
}
.profile-addr {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto var(--space-sm);
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.profile-addr:hover { border-color: var(--border-default); }
.profile-addr svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }


/* ============================================================
   APPROVE / PAID STATES
   ============================================================ */
.paid-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--green-dim);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-lg);
  color: var(--green);
}
.paid-banner-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 197, 94, 0.15);
  border-radius: 50%;
  flex-shrink: 0;
}
.paid-banner-icon svg { width: 20px; height: 20px; }
.paid-banner-text { flex: 1; }
.paid-banner-title { font-weight: 600; font-size: 15px; color: var(--green); }
.paid-banner-link { font-family: var(--font-mono); font-size: 12px; color: var(--green); opacity: 0.8; word-break: break-all; }
.paid-banner-link:hover { opacity: 1; color: var(--green); }


/* ============================================================
   MARKDOWN — rendered content from task descriptions, etc.
   Class hook: `.md` on the wrapping element.
   ============================================================ */
.md { font-size: 16px; color: var(--text-primary); line-height: 1.65; word-wrap: break-word; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md p { margin: 0 0 1em; }
.md p:last-child { margin-bottom: 0; }
.md a { color: var(--purple-light); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.md a:hover { color: #c4b5fd; }
.md strong { font-weight: 700; color: var(--text-bright); }
.md em { font-style: italic; }
.md del { color: var(--text-muted); text-decoration: line-through; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 {
  margin: 1.4em 0 0.6em;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text-bright);
}
.md h1 { font-size: 1.6em; }
.md h2 { font-size: 1.35em; }
.md h3 { font-size: 1.15em; color: var(--purple-light); }
.md h4 { font-size: 1.05em; color: var(--purple-light); }
.md h5, .md h6 { font-size: 1em; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; }
.md ul, .md ol { margin: 0.5em 0 1em 1.5em; padding: 0; }
.md ul { list-style: disc; }
.md ol { list-style: decimal; }
.md li { margin: 0.2em 0; }
.md li::marker { color: var(--purple-light); }
.md hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-default), transparent);
  margin: 1.5em 0;
}
.md blockquote {
  margin: 1em 0;
  padding: 0.4em 1em;
  border-left: 3px solid var(--purple);
  background: var(--purple-glow);
  color: var(--text-secondary);
  font-style: italic;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.md code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--purple-light);
}
.md pre {
  margin: 1em 0;
  padding: var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}
.md pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: inherit;
}
.md pre[data-lang]::before,
.md pre code[data-lang]::before {
  content: attr(data-lang);
  display: block;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.md .md-table-wrap {
  overflow-x: auto;
  margin: 1em 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.md .md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.md .md-table th, .md .md-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}
.md .md-table th {
  background: var(--bg-card-hover);
  color: var(--text-bright);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.md .md-table tr:last-child td { border-bottom: none; }
.md .md-table tr:hover td { background: rgba(124, 58, 237, 0.04); }
.md img { max-width: 100%; border-radius: var(--radius-md); margin: 0.5em 0; }


/* ============================================================
   MARKDOWN EDITOR (create form)
   ============================================================ */
.md-editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.md-editor-tabs {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 4px;
}
.md-editor-tab {
  padding: 6px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}
.md-editor-tab:hover { color: var(--text-secondary); }
.md-editor-tab.active {
  color: var(--text-bright);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-default);
  border-bottom: none;
}
.md-editor-spacer { flex: 1; }
.md-editor-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.md-editor-help:hover {
  color: var(--purple-light);
  border-color: var(--border-strong);
  background: var(--purple-glow);
}
.md-editor-help svg { width: 14px; height: 14px; }

/* Markdown reference modal */
.md-ref-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.md-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.md-ref-table thead th {
  background: var(--bg-card-hover);
  color: var(--text-bright);
  text-align: left;
  padding: 10px 14px;
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.md-ref-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  vertical-align: top;
}
.md-ref-table td:first-child { width: 45%; min-width: 0; }
.md-ref-src {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--purple-light);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.md-ref-out { font-size: 13px; }
.md-ref-out > *:first-child { margin-top: 0; }
.md-ref-out > *:last-child { margin-bottom: 0; }
.md-ref-out h1 { font-size: 1.2em; }
.md-ref-out h2 { font-size: 1.1em; }
.md-ref-out h3 { font-size: 1em; }
.md-ref-out p, .md-ref-out ul, .md-ref-out ol, .md-ref-out blockquote, .md-ref-out pre { margin: 0.3em 0; }
.md-ref-out pre { padding: 8px 10px; font-size: 11px; }
.md-ref-out .md-table-wrap { margin: 0.3em 0; }

@media (max-width: 540px) {
  .md-ref-table { font-size: 12px; }
  .md-ref-table td { padding: 10px; }
  .md-ref-src { font-size: 11px; }
}
.md-editor-textarea { display: block; min-height: 220px; font-family: var(--font-mono); font-size: 14px; line-height: 1.55; }
.md-editor-preview {
  display: none;
  min-height: 220px;
  padding: var(--space-md) var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.md-editor.preview .md-editor-textarea { display: none; }
.md-editor.preview .md-editor-preview { display: block; }
.md-editor-preview-empty { color: var(--text-muted); font-style: italic; }


/* ============================================================
   MOBILE — page-specific tightening (≤540px / Galaxy S10-class)
   ============================================================ */
@media (max-width: 540px) {
  /* Hero — pull padding in, scale headline down so it fits 360px */
  .hero {
    padding: var(--space-xl) var(--space-md);
    border-radius: var(--radius-lg);
    margin: var(--space-md) auto var(--space-xl);
  }
  .hero-headline { font-size: clamp(28px, 9vw, 36px); line-height: 1.1; }
  .hero-sub { font-size: 15px; margin-bottom: var(--space-lg); }
  .hero-duo { gap: var(--space-sm); margin-top: var(--space-lg); }
  .hero-duo-card { padding: var(--space-md); }
  .hero-duo-title { font-size: 20px; }
  .hero-duo-sub { font-size: 14px; margin-bottom: var(--space-md); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }

  /* Task grid: single column — the 340px minmax overflows on narrow screens */
  .task-grid { grid-template-columns: 1fr; gap: var(--space-sm); }
  .task-card { padding: var(--space-md); gap: var(--space-sm); }
  .task-card-title { font-size: 16px; }
  .task-card-desc { font-size: 13px; }
  .task-card-bounty-amount { font-size: 20px; }

  /* Filter bar: stack vertically */
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-search { flex: 1 1 auto; }
  .filter-select { width: 100%; }

  /* Task detail: tighter spacing, smaller bounty hero */
  .task-detail { gap: var(--space-lg); }
  .task-detail-meta { font-size: 12px; gap: 6px; }
  .task-detail-title { font-size: 24px; line-height: 1.2; }
  .task-detail-desc { padding: var(--space-md); font-size: 15px; }
  .bounty-hero { padding: var(--space-md); }
  .bounty-hero-amount { font-size: 30px; word-break: break-word; }
  .bounty-hero-unit { font-size: 12px; margin-left: 6px; }
  .bounty-hero-quoted { font-size: 12px; }
  .task-action-zone { padding: var(--space-md); }

  /* Proof timeline: tighter, mono attachments wrap */
  .proof-thread { padding-left: 18px; }
  .proof-thread::before { left: 5px; }
  .proof-entry { padding: var(--space-sm) var(--space-md); }
  .proof-entry::before { left: -16px; width: 10px; height: 10px; top: 18px; }
  .proof-form { padding: var(--space-md); }
  .dropzone { padding: var(--space-lg) var(--space-md); }

  /* Create form: bounty hero amount fits */
  .bounty-input-card { padding: var(--space-md); }
  .bounty-amount-input { font-size: 28px; }
  .bounty-currency-pill { transform: scale(0.92); transform-origin: right; }

  /* Reputation card */
  .rep-card { padding: var(--space-md); }
  .rep-stat { padding: var(--space-sm) var(--space-md); }
  .rep-stat-value { font-size: 26px; }

  /* Profile page */
  .profile-header { padding: var(--space-xl) var(--space-sm); }
  .profile-addr { font-size: 12px; max-width: 100%; }

  /* Tabs: scroll horizontally if needed instead of breaking layout */
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; padding: 10px 14px; font-size: 13px; }

  /* How-it-works: reduce visual noise */
  .how-step { padding: var(--space-md); }
  .how-step-number { font-size: 28px; }

  /* Section headers: stack title + actions when both present */
  .section-header { flex-wrap: wrap; gap: var(--space-sm); }
}

/* ── Settings page ──────────────────────────────────────────────── */

.settings-page {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
}
.settings-header h1 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 0 0 6px;
}
.settings-header h1 svg {
  color: var(--purple-light);
}
.settings-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}
.settings-section:first-of-type {
  border-top: none;
  padding-top: var(--space-md);
}
.settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.settings-section-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
}
.settings-section-header p {
  margin: 0;
  font-size: 14px;
  max-width: 60ch;
}

.empty-card {
  padding: var(--space-md);
  text-align: center;
}

/* ── Webhook rows ───────────────────────────────────────────────── */

.webhook-row {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "main actions"
    "deliveries deliveries";
  gap: var(--space-md);
  align-items: start;
}
.webhook-row-main { grid-area: main; min-width: 0; }
.webhook-row-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.webhook-deliveries {
  grid-area: deliveries;
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-sm);
}
.webhook-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.webhook-row-name {
  margin: 0;
  font-size: 16px;
  color: var(--text-bright);
  font-weight: 600;
}
.webhook-row-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
  margin-bottom: 6px;
}
.webhook-row-events {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.webhook-row-meta {
  font-size: 12px;
}

.webhook-deliveries-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.webhook-deliveries-table th,
.webhook-deliveries-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
.webhook-deliveries-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.webhook-delivery-detail {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  max-width: 320px;
  word-break: break-word;
}

/* ── Webhook editor modal ───────────────────────────────────────── */

.webhook-events-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.webhook-event-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.webhook-event-item:hover { background: rgba(255, 255, 255, 0.03); }

/* Custom event-list checkbox: square with brand purple fill + drawn
   tick when checked. Hidden native input still drives state +
   keyboard a11y. */
.webhook-event-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--border-default);
  border-radius: 4px;
  background: var(--bg-card);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.webhook-event-item input[type="checkbox"]:hover {
  border-color: var(--purple-light);
}
.webhook-event-item input[type="checkbox"]:checked {
  background: var(--purple);
  border-color: var(--purple);
}
.webhook-event-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.webhook-event-item input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--purple-light);
  outline-offset: 2px;
}

/* Enabled toggle: iOS-style sliding pill. Same hidden-input trick.
   Pulled visually away from the events list above with extra top
   spacing — it's a logically distinct setting and should breathe. */
.webhook-enabled-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}
.webhook-enabled-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  background: var(--bg-deep);
  border: 1.5px solid var(--border-default);
  cursor: pointer;
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
  flex-shrink: 0;
}
.webhook-enabled-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.18s ease, background 0.18s ease;
}
.webhook-enabled-row input[type="checkbox"]:hover {
  border-color: var(--purple-light);
}
.webhook-enabled-row input[type="checkbox"]:checked {
  background: var(--purple);
  border-color: var(--purple);
}
.webhook-enabled-row input[type="checkbox"]:checked::after {
  transform: translateX(18px);
  background: #fff;
}
.webhook-enabled-row input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--purple-light);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  /* Stack the section header so the action buttons don't crush the
     section title + description on the left. */
  .settings-section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .webhook-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "actions"
      "deliveries";
  }
  .webhook-row-actions { justify-content: flex-start; }

  /* The deliveries log has 5 columns and won't shrink past its
     content width. Let the wrapper scroll horizontally on small
     screens rather than blowing out the row. */
  .webhook-deliveries { overflow-x: auto; }
  .webhook-deliveries-table { min-width: 480px; }
  .webhook-delivery-detail { max-width: 200px; }
}

/* ── Webhook payload-format docs modal ──────────────────────────── */

.format-section-title {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-family: var(--font-brand);
}

.code-block {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0 0 var(--space-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.format-event {
  margin-top: var(--space-md);
}
.format-event-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.format-event-kind {
  background: var(--purple-glow);
  color: var(--purple-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-mono);
}

