/* City Viewer — Report an issue (City Requests flow; docs/design/city-requests.html §5).
   The stepper reuses the shared primitives (.form/.field/.button from forms.css, .service-tile
   from home.css); this file adds only the report-specific pieces: the wizard answers, guidance,
   photo chips, candidate list, and review facts. */

/* Shared <cv-request-list> — one component rendered in the account drawer (narrow) and here on the
   report status page (wide). The rows reflow via a container query, so the host adapts to whichever
   surface it's dropped into. (container-type needs display:block to take effect.) */
cv-request-list { display: block; container-type: inline-size; }
.request-list { display: flex; flex-direction: column; }
.request-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-1);
  border-bottom: 1px solid var(--line-soft);
}
.request-row svg { width: 1.15rem; height: 1.15rem; color: var(--brand); flex: none; }
.request-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.request-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-meta { font-size: .78rem; color: var(--ink-muted); }
.request-status { flex: none; font-size: .82rem; font-weight: 600; color: var(--ink-muted); white-space: nowrap; }

/* Roomier container (the status page) vs. the narrow drawer: more padding, status becomes a pill. */
@container (min-width: 420px) {
  .request-row { padding: var(--space-4) var(--space-2); gap: var(--space-4); }
  .request-label { font-size: 1.05rem; }
  .request-status {
    padding: var(--space-1) var(--space-3);
    border-radius: 999px;
    background: color-mix(in oklab, var(--brand) 10%, transparent);
    color: var(--brand);
  }
}

.report {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-inline: var(--space-4);

  & > * { flex: none; }
}

.report-lead { margin: 0; font-size: .95rem; color: var(--ink); }

.report-back {
  align-self: flex-start;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--brand);
  background: none;
  border: 0;
  cursor: pointer;
}

.report-title { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--brand); }

/* Generic card (emergency interstitial, review, done, status rows) */
.report-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);

  & p { margin: 0; font-size: .92rem; line-height: 1.55; }

  &.is-emergency { border-left: 4px solid var(--accent); }
  &.is-done { align-items: flex-start; }
}

/* Review / status fact rows */
.report-fact {
  display: flex;
  gap: var(--space-3);
  font-size: .88rem;

  & b { flex: 0 0 7rem; color: var(--ink-muted); font-weight: 600; }
  & span { min-width: 0; overflow-wrap: anywhere; }
}

/* Paired inputs (address + search button, first/last, email/phone) */
.report-searchrow {
  display: flex;
  gap: var(--space-2);

  & input { flex: 1; min-width: 0; }
  & .button { flex: none; }
}

/* Location picker — center-pin aerial map (cv-location-picker). The pin is fixed; the map
   moves under it, and the pin's tip (the viewport center) IS the chosen location. */
.report-map {
  position: relative;
  height: min(42vh, 340px);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #1c2430; /* visible only while imagery loads/fails */
}

cv-location-picker {
  position: absolute;
  inset: 0;
  display: block;
  /* The picker owns every touch on it (pan/pinch) — same trap as the sheet grip. */
  touch-action: none;
}

.lpk-svg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;

  &:active { cursor: grabbing; }
}

.lpk-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  /* -92%: the pin glyph's tip sits ~22/24 down its viewBox — this lands the TIP on center. */
  transform: translate(-50%, -92%);
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5));

  & svg { display: block; width: 100%; height: 100%; }
}

.lpk-attr,
.lpk-note {
  position: absolute;
  right: var(--space-2);
  bottom: var(--space-1);
  font-size: .68rem;
  color: rgba(255, 255, 255, .85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
  pointer-events: none;
}

.lpk-note {
  right: auto;
  left: var(--space-2);
  top: var(--space-1);
  bottom: auto;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(12, 18, 28, .75);
  color: #fff;
  font-size: .75rem;
}

/* Viewport tiles fade in on load (mirrors the storm map's rule in lightning.css — both are
   single-bundle global CSS, but the picker shouldn't depend on another view's stylesheet). */
cv-location-picker [data-layer="tiles"] image {
  transition: opacity .25s ease-out;

  &.is-loading { opacity: 0; }
}

.report-map__hint {
  margin: 0;
  font-size: .78rem;
  color: var(--ink-muted);
}

/* Geocoder candidates */
.report-candidates {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.report-candidate {
  width: 100%;
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-3);
  font: inherit;
  font-size: .9rem;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;

  &:hover, &:focus-visible { border-color: var(--brand); }
}

/* The confirmed location */
.report-picked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  background: color-mix(in oklab, var(--success) 10%, var(--surface));
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
}

/* Wizard answers (choice pills) */
.report-answers {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.report-answer {
  width: 100%;
  min-height: var(--tap-min);
  padding: var(--space-3);
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;

  &.is-selected {
    color: var(--ink-on-brand);
    background: var(--brand);
    border-color: var(--brand);
  }
}

/* An answer's TellCaller guidance — appears the moment it's selected */
.report-guidance {
  padding: var(--space-3);
  font-size: .85rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--warning-bg);
  border-left: 4px solid var(--auburn-yellow, #FCC130);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Photos */
.report-photos {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);

  &:empty { display: none; }
}
.report-photo-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: .8rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  max-width: 100%;
  overflow: hidden;

  & button { border: 0; background: none; font: inherit; font-size: 1rem; color: var(--ink-muted); cursor: pointer; }
}

.report-optional { font-weight: 400; color: var(--ink-muted); }
.report-recents { align-self: flex-start; padding: 0; font: inherit; font-weight: 600; color: var(--brand); background: none; border: 0; cursor: pointer; }
.report-submit { width: 100%; }
.report-statuses { display: flex; flex-direction: column; gap: var(--space-3); }

/* Pre-submit "may already be reported" heads-up — nearby open SRs of the same type. */
.report-nearby {
  background: var(--warning-bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.report-nearby[hidden] { display: none; }
.report-nearby__head { display: flex; flex-direction: column; gap: 2px; }
.report-nearby__title { font-weight: 700; color: var(--ink); font-size: .95rem; }
.report-nearby__sub { font-size: .8rem; color: var(--ink-muted); }
.report-nearby__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.report-nearby__item { padding-top: var(--space-2); border-top: 1px solid var(--line-soft); }
.report-nearby__item:first-child { padding-top: 0; border-top: 0; }
.report-nearby__line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.report-nearby__what { font-weight: 600; color: var(--ink); font-size: .9rem; }
.report-nearby__dist { flex: none; white-space: nowrap; font-size: .78rem; color: var(--ink-muted); }
.report-nearby__meta { margin-top: 2px; font-size: .78rem; color: var(--ink-muted); }

/* Transition footer: point to Auburn FixIt for issues filed there (not yet in this app). */
.report-fixit {
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.report-fixit__hint { margin: 0; font-size: .82rem; color: var(--ink-muted); line-height: 1.4; }
.report-fixit__link { width: 100%; }
