/* Record page template (A22; macros/pr/record_page.html).
   Header: type badge, whom a save affects, the save state. Two columns on
   desktop (sections, then a 320px side column: used by, activity, the
   destructive action); one column from tablet down, the side cards after the
   sections. Also the save-state note and the dirty mark a staged field
   carries (shared with the settings form). */

.pr-recordpage { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--pr-space-lg); }
.pr-recordpage > * { min-width: 0; }

.pr-recordpage__head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--pr-space-sm) var(--pr-space-md); min-height: 24px; }
.pr-recordpage__scope { flex: 1 1 auto; min-width: 0; font-size: 0.75rem; line-height: 1.4; color: var(--pr-text-secondary); }
.pr-recordpage__skelhead { width: 220px; height: 14px; }

.pr-recordpage__cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--pr-space-xl); align-items: start; margin: 0; }
.pr-recordpage__main, .pr-recordpage__side { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--pr-space-lg); min-width: 0; }

.pr-recordpage__sec { display: grid; gap: var(--pr-space-lg); align-content: start; }
.pr-recordpage__sechead { display: flex; align-items: baseline; gap: var(--pr-space-md); }
.pr-recordpage__sechead > h2 { flex: 1; min-width: 0; }
.pr-recordpage__list { display: grid; gap: var(--pr-space-md); margin: 0; padding: 0; list-style: none; font-size: 0.85rem; line-height: 1.45; }
.pr-recordpage__item { color: var(--pr-text-primary); }
.pr-recordpage__note { display: block; font-size: 0.75rem; line-height: 1.4; color: var(--pr-text-caption); }
.pr-recordpage__text { font-size: 0.85rem; line-height: 1.5; }
.pr-recordpage__side .pr-recordpage__sec > p { font-size: 0.85rem; line-height: 1.5; }
/* A list of checkboxes in a section (the sites in a set): two columns, one on a phone. */
.pr-recordpage__checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pr-space-sm) var(--pr-space-xl); }

/* "All changes saved": the live script hides it while changes are staged. */
.pr-savestate { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 0.75rem; line-height: 1.4; color: var(--pr-text-secondary); white-space: nowrap; }
.pr-savestate[hidden] { display: none; }
.pr-savestate .pr-ico { color: var(--pr-text-secondary); }

/* A staged field carries the dirty mark: the brand bar the table uses for an
   unsaved row, beside the field, until it is saved or discarded. */
.pr-field.is-dirty, .pr-opt.is-dirty { position: relative; }
.pr-field.is-dirty::before, .pr-opt.is-dirty::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--pr-space-md));
  width: 3px; border-radius: var(--pr-radius-xs);
  background: var(--pr-brand-text);
}

@media (max-width: 1024px) {
  .pr-recordpage__cols { grid-template-columns: minmax(0, 1fr); gap: var(--pr-space-lg); }
}

@media (max-width: 768px) {
  .pr-recordpage { gap: var(--pr-space-md); }
  .pr-recordpage__cols, .pr-recordpage__main, .pr-recordpage__side { gap: var(--pr-space-md); }
  .pr-recordpage__scope { flex-basis: 100%; }
  .pr-recordpage__checks { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pr-field.is-dirty::before, .pr-opt.is-dirty::before { left: calc(-1 * var(--pr-space-sm)); }
}
