/* The Report a problem page (public/report-problem.html, public/operator/report-problem-page.js): the form, the thank-you
   and the owner's reports. Cards, option rows, fields, chips and buttons come from portal.css; this adds the reports as
   hairline rows that open into their progress, and the progress timeline. */
.portal-status:empty { display: none; }

/* ---- Writing a report ----------------------------------------------------------------------------------- */
.report-type { min-width: 0; margin: 0 0 var(--space-2); padding: 0; border: 0; }
.report-type > .group-title { padding: 0; }
.report-type > .option-row:last-child { margin-bottom: var(--space-1); }
.portal-actions + .portal-status { margin-top: var(--space-3); }

/* The thank-you: a note in place, and the thing focus moves to once the report is sent. */
.report-thanks h2 { margin: 0 0 2px; font-size: var(--fs-md); }
.report-thanks p { margin: 0; }
.report-thanks:focus { outline: var(--focus); outline-offset: var(--focus-offset); }

/* ---- The owner's reports: a hairline row each, opening into where it has got to -------------------------- */
.report-list { display: block; margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.report-list > .report-item { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.report-list > .report-item:last-child { border-bottom: 0; }
.report-item > .report-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  justify-content: stretch;
  gap: var(--space-2) var(--space-3);
  width: 100%;
  min-height: var(--control-h);
  padding: var(--space-2) 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.report-item > .report-item-head:hover .report-item-title strong { color: var(--metal); }
.report-item > .report-item-head:focus-visible { outline: var(--focus); outline-offset: -2px; border-radius: 0; }
.report-item-head::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0 3px 3px 0;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.report-item-head[aria-expanded="true"]::after { margin: 3px 3px 0 0; transform: rotate(-135deg); }
.report-item-title { display: grid; gap: 2px; min-width: 0; }
.report-item-title strong { overflow-wrap: anywhere; }
.report-item-meta { color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.report-item > .report-item-body { padding: 0 0 var(--space-4); border-top: 0; }

/* Progress: a dot for each step, filled once it is done, joined by a line. */
.report-steps { display: grid; margin: var(--space-1) 0 var(--space-3); padding: 0; list-style: none; }
.report-step { position: relative; display: flex; justify-content: space-between; gap: var(--space-3); padding: 0 0 14px 28px; color: var(--muted); }
.report-step::before { content: ""; position: absolute; left: 4px; top: 4px; width: 12px; height: 12px; border: 2px solid var(--line-control); border-radius: 50%; background: var(--surface); }
.report-step::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.report-step:last-child { padding-bottom: 0; }
.report-step:last-child::after { display: none; }
.report-step.done { color: var(--ink); }
.report-step.done::before { border-color: var(--ok); background: var(--ok); }
.report-step.current { font-weight: 600; }
.report-step-time { flex: none; color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.report-message-text { margin: var(--space-3) 0 0; padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.report-item-body > .portal-small { margin: var(--space-3) 0 0; }

@media (max-width: 520px) {
  .report-item > .report-item-head { grid-template-columns: minmax(0, 1fr) auto; }
  .report-item-title { grid-column: 1 / -1; }
  .report-item-head > .chip { justify-self: start; }
}
