/*
 * css/app.css: what the app pages (missions, mission, create) add on top of css/site.css and css/extra.css.
 * Linked after the shell head block. Everything is named pb-*. These rules are unlayered on purpose: they win
 * over the compiled utilities of site.css (which live in @layer utilities) when both set the same property.
 */

/* ---- helpers */
.pb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* other people's text: a long word, an address or a URL wraps inside its own box instead of widening the page */
.pb-wrap { overflow-wrap: anywhere; }
.pb-nums { font-variant-numeric: tabular-nums; }
.pb-row-gap { row-gap: 0.5rem; column-gap: 1rem; }
/* the tab row of /missions: a little tighter on a phone, so the status chips stay on the same line at 390 */
.pb-tabs { display: flex; align-items: center; gap: 0.75rem; }
@media (min-width: 640px) { .pb-tabs { gap: 1rem; } }

/* ---- tap targets: 40 px at least where fingers do the pointing; the desktop look stays the design's own */
@media (pointer: coarse), (max-width: 767px) {
  .pb-tap {
    display: inline-flex;
    min-width: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
  }
  .pb-tap-block { min-height: 40px; }
}

/* a review row is a label around its checkbox: the whole strip is the target */
.pb-row { min-height: 40px; }

/* ---- mission covers: five gradients, all inside the green, teal and ink family. data-v is picked from the id */
.pb-cover { color: #fff; background: linear-gradient(135deg, #0a6b3c, #0fa35b 55%, #34c47c); }
.pb-cover[data-v="1"] { background: linear-gradient(135deg, #0b4f4a, #0e8f82 55%, #35c2ad); }
.pb-cover[data-v="2"] { background: linear-gradient(135deg, #0d0d0d, #0a6b3c 58%, #0fa35b); }
.pb-cover[data-v="3"] { background: linear-gradient(135deg, #1d5a24, #2f9a3c 55%, #6fcf6a); }
.pb-cover[data-v="4"] { background: linear-gradient(135deg, #0d0d0d, #0b4f4a 55%, #0e8f82); }

/* the smallest phones: the card cover is only 272 px wide, so it grows a little and drops the kind label (the tag
   line under the cover says it again) before the label can run into the answers badge */
@media (max-width: 359px) {
  .pb-cover-box { aspect-ratio: 5 / 2; }
  .pb-cover-kind { display: none; }
}

/* the search card on the smallest phones: the placeholder needs the room more than the gap does */
@media (max-width: 359px) {
  .pb-search { gap: 0.5rem; padding: 0.75rem; }
  .pb-search input { padding-left: 0.75rem; padding-right: 0.5rem; }
  .pb-search button { padding-left: 1rem; padding-right: 1rem; }
}

/* ---- skeletons */
.pb-skel {
  display: block;
  border-radius: 6px;
  background: #e6e6e6;
  animation: pb-skel 1.4s ease-in-out infinite;
}
.pb-skel-dark { background: #d9d9d9; }
@keyframes pb-skel { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .pb-skel { animation: none; } }

/* ---- radio chips (the emotion picker, the mission kind). The real radio covers the chip, so the keyboard,
        the screen reader and the finger all meet a native control. */
.pb-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
@media (min-width: 640px) { .pb-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pb-chip { position: relative; display: block; min-width: 0; }
.pb-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.pb-chip span {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 0.375rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: var(--color-surface);
  color: #4b5563;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: break-word;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.pb-chip span i {
  flex: none;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.08em;
  color: #9ca3af;
}
/* the two letter code is decoration (aria-hidden): on a narrow chip the word gets the room */
@media (max-width: 419px) { .pb-chip span i { display: none; } }
.pb-chip:hover span { border-color: #c4c4c4; color: var(--color-ink); }
.pb-chip input:checked + span {
  border-color: var(--color-pb-green);
  background: #0fa35b1a;
  color: #0a6b3c;
  font-weight: 600;
}
.pb-chip input:checked + span i { color: #0a6b3c; }
.pb-chip input:focus-visible + span { outline: 2px solid var(--color-pb-green); outline-offset: 2px; }
.pb-chip input:disabled { cursor: not-allowed; }
.pb-chip input:disabled + span { opacity: 0.5; }

/* ---- the intensity slider and the review checkboxes */
/* a native range input, drawn in the brand: light green track, green fill up to --pb-fill (set by the page
   script as the value moves), a white thumb with a green ring. Height 40 px so a thumb is easy to catch. */
.pb-range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  background: transparent;
  accent-color: var(--color-pb-green);
  cursor: pointer;
}
.pb-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--color-pb-green) var(--pb-fill, 44%), var(--color-pb-mint-100) var(--pb-fill, 44%));
}
.pb-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 2px solid var(--color-pb-green);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #00000033;
}
.pb-range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--color-pb-mint-100); }
.pb-range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--color-pb-green); }
.pb-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-pb-green);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #00000033;
}
.pb-range:focus-visible { outline: none; }
.pb-range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--color-pb-green); outline-offset: 2px; }
.pb-range:focus-visible::-moz-range-thumb { outline: 2px solid var(--color-pb-green); outline-offset: 2px; }
.pb-range:disabled { cursor: not-allowed; opacity: 0.5; }
@media (forced-colors: active) {
  .pb-range { -webkit-appearance: auto; appearance: auto; }
}
.pb-check {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--color-pb-green);
  cursor: pointer;
}
.pb-check:disabled { cursor: not-allowed; }

/* ---- a select that matches the text inputs */
.pb-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 14px;
}

/* ---- disabled form controls read as disabled */
.pb-field:disabled { background-color: var(--color-surface-light); color: #9ca3af; cursor: not-allowed; }
.pb-over { color: #b91c1c; font-weight: 600; }

/* ---- the signal: one hue, the track is a light step of the same green, the words carry the identity */
.pb-bar {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-pb-mint-100);
}
.pb-bar > span {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: 999px;
  background: var(--color-pb-green);
}
@media (forced-colors: active) {
  .pb-bar { border: 1px solid CanvasText; }
  .pb-bar > span { background: CanvasText; forced-color-adjust: none; }
}

/* ---- the review bar stays in reach while an agent works down a long list */
.pb-review-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 1rem -1.25rem -1.25rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 0.75rem 0.75rem;
  background: #fffffff2;
  backdrop-filter: blur(6px);
}

/* words beside a button: they keep a readable measure, and the button drops under them when the row is narrow */
.pb-grow { flex: 1 1 220px; min-width: 0; }

/* ---- the mobile action bar of the mission page: keep the footer and the toasts clear of it */
@media (max-width: 1023px) {
  body.pb-has-bar #root { padding-bottom: 72px; }
  body.pb-has-bar .pb-toasts { bottom: 88px; }
}

/* ---- the numbered how-it-works marks under the not-live notice */
.pb-step-no {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-pb-green);
  border-radius: 999px;
  color: var(--color-pb-green);
  font-size: 10px;
  font-weight: 700;
}
