/* ============================================================
   Flow reports (social PR A2) — the section-page #reports module
   and the /section/<id>/report form.

   The reported *pill family* lives in components.css next to the
   gauge pills (PR A3 reuses it on list/map); this file owns page
   layout only. Design source: design-pass.md decisions #3
   (per-module disclaimer), #5 (status tap row), #6 (byline +
   coarse-time formats).
   ============================================================ */

/* ---- Section-page module -------------------------------------- */

.reports-module { display: flex; flex-direction: column; gap: var(--space-4); }

.reports-loading,
.reports-count {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

/* ONE disclaimer per module (decision #3): 11px muted with a thin
   warning-border left edge. Non-dismissible by construction. */
.reports-disclaimer,
.report-disclosure {
  font-size: 11px;
  color: var(--text-muted);
  border-left: 2px solid var(--warning-border);
  padding-left: var(--space-3);
  margin: 0;
}

.report-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.report-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) 0 0;
  border-top: 1px solid var(--border-subtle);
}
.report-list .report-row:first-child { border-top: 0; padding-top: 0; }

.report-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Muted coarse-time suffix outside the pill (decision #1). */
.report-when { font-size: 12px; color: var(--text-muted); }
.report-value { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.report-note {
  font-size: 13.5px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

/* Byline (decision #6): @handle 12px link colour; decayed /
   bylineless renders "a paddler" muted italic. */
.report-byline { font-size: 12px; display: flex; align-items: baseline; gap: var(--space-4); }
.report-handle { color: var(--link); font-weight: 600; }
.report-anon { color: var(--text-muted); font-style: italic; }

/* ---- Moderation (PR A4) ----------------------------------------- */

/* The "report" flag affordance: a muted text link, deliberately
   quiet — one step + native confirm(), no reason form in v1. */
.report-flag-form { display: inline; margin-left: auto; }
.report-flag-link {
  font: inherit;
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.report-flag-link:hover { color: var(--link); }

/* Author notice (AR-10): the viewer's OWN hidden rows, sunken +
   flagged "hidden pending review", with the /contact appeal line. */
.reports-own-hidden {
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.reports-own-hidden-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.reports-own-hidden-note a { color: var(--link); }
.report-row.is-hidden { opacity: 0.75; }
.report-row.is-hidden:first-child { padding-top: 0; border-top: 0; }
.report-hidden-flag {
  font-size: 11px;
  padding: 1px var(--space-3);
  border-radius: 999px;
  border: 1px solid var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-fg);
  white-space: nowrap;
}

.reports-earlier summary {
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}
.reports-earlier[open] summary { margin-bottom: var(--space-4); }
.report-row.is-earlier .report-note { color: var(--text-secondary); }

.reports-empty { font-size: 13.5px; color: var(--text-secondary); margin: 0; }
.reports-empty a { color: var(--link); }

/* Entry point on the readout card — small text link under the
   freshness line (social-entry-points card). */
.sd-report-link {
  display: block;
  margin-top: var(--space-2);
  font-size: 12.5px;
  color: var(--link);
}

/* ---- Report form ----------------------------------------------- */

.report-shell .sd-crumbs { margin-bottom: var(--space-4); }

.report-status-field {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.report-status-field legend { padding: 0; }

/* Status tap row (decision #5): five segmented buttons, 3px
   status-colour top border; selected = the status tint; wraps 3+2
   under 400px. Radios stay in the DOM (visually hidden) so the
   row is keyboard- and screen-reader-native. */
.status-tap-row { display: flex; flex-wrap: wrap; gap: 6px; }

.status-tap-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.status-tap {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 10px 6px 9px;
  border: 1px solid var(--border-default);
  border-top: 3px solid var(--border-default);
  border-radius: 8px;
  background: var(--surface-raised);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.status-tap-too-low   { border-top-color: var(--status-too-low-dot); }
.status-tap-low       { border-top-color: var(--status-low-dot); }
.status-tap-good      { border-top-color: var(--status-good-dot); }
.status-tap-high      { border-top-color: var(--status-high-dot); }
.status-tap-very-high { border-top-color: var(--status-very-high-dot); }

.status-tap-input:checked + .status-tap-too-low   { background: var(--status-too-low-bg);   color: var(--status-too-low-fg);   border-color: var(--status-too-low-dot); border-top-width: 3px; }
.status-tap-input:checked + .status-tap-low       { background: var(--status-low-bg);       color: var(--status-low-fg);       border-color: var(--status-low-dot); border-top-width: 3px; }
.status-tap-input:checked + .status-tap-good      { background: var(--status-good-bg);      color: var(--status-good-fg);      border-color: var(--status-good-dot); border-top-width: 3px; }
.status-tap-input:checked + .status-tap-high      { background: var(--status-high-bg);      color: var(--status-high-fg);      border-color: var(--status-high-dot); border-top-width: 3px; }
.status-tap-input:checked + .status-tap-very-high { background: var(--status-very-high-bg); color: var(--status-very-high-fg); border-color: var(--status-very-high-dot); border-top-width: 3px; }

.status-tap-input:focus-visible + .status-tap {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

@media (max-width: 400px) {
  /* 3 + 2 wrap: a 30% basis fits three per row; the remaining two
     stretch across the second. */
  .status-tap { flex: 1 1 30%; }
}

.report-opt { font-weight: 400; color: var(--text-muted); }

.report-estimate-row { display: flex; gap: var(--space-3); }
/* .alerts-field gives inputs/selects width:100%; in the two-up
   estimate row the number takes the room and the unit select
   hugs its content. */
.report-estimate-row input[type="text"] { flex: 1 1 auto; min-width: 0; width: auto; }
.report-estimate-row select { flex: 0 0 auto; width: auto; }

/* .alerts-field styles inputs/selects only — extend the same
   treatment to the note textarea. */
.report-note-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  resize: vertical;
}
.report-note-field textarea:focus {
  outline: 2px solid var(--brand-500);
  outline-offset: 1px;
  border-color: var(--brand-500);
}
.report-note-count {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-top: var(--space-1);
}

.report-anon-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 13.5px;
  color: var(--text-primary);
  cursor: pointer;
}
.report-anon-row input { margin-top: 2px; }

.report-help {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin: var(--space-1) 0 0;
}

.report-handle-row { display: flex; align-items: center; gap: var(--space-2); }
.report-handle-at { color: var(--text-muted); font-weight: 600; }
.report-handle-row input { flex: 1 1 auto; min-width: 0; }

/* --- PR A8: author edit/delete + the "edited" marker --------------- */

/* "· edited" rides inside .report-when and inherits its muted tone;
   the explicit class keeps it targetable and slightly quieter. */
.report-edited { color: var(--text-muted); font-style: italic; }

/* "edit" is an anchor reusing the flag link's muted treatment. */
a.report-edit-link { text-decoration: none; }
a.report-edit-link:hover { text-decoration: underline; }
.report-own-sep { color: var(--text-muted); font-size: 12px; }

/* "edit · delete" cluster on the author's own rows — right-anchored
   as a unit (the inner form must not re-auto-margin). */
.report-own-links {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-left: auto;
}
.report-own-links .report-flag-form { margin-left: 0; }
