/* Targeted spacing and status badge alignment, 2026-10-22.
   Preserve the existing app corner system and all hidden/access gates. */
:root[data-astra-app="true"] #platformPolicyRiskPanel > .section-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  gap: 10px 16px;
}
:root[data-astra-app="true"] #platformPolicyRiskPanel > .section-title > div {
  display: contents;
}
:root[data-astra-app="true"] #platformPolicyRiskPanel > .section-title h2 {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  min-width: 0;
  line-height: 1.45;
}
:root[data-astra-app="true"] #platformPolicyRiskPanel > .section-title p {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  line-height: 1.65;
}
:root[data-astra-app="true"] #platformPolicyRiskBadge {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  flex-shrink: 0;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 8px;
  line-height: 1.3;
}

:root[data-astra-app="true"] .period-report-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  margin-block: 20px;
  min-width: 0;
}
:root[data-astra-app="true"] .period-report-panel > :is(h3, p) { margin: 0; }
:root[data-astra-app="true"] .period-report-panel > p { line-height: 1.65; }
:root[data-astra-app="true"] .period-report-form label { display: grid; gap: 8px; }
:root[data-astra-app="true"] .period-report-actions,
:root[data-astra-app="true"] .account-session-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
:root[data-astra-app="true"] :is(.period-report-actions, .period-report-form, .account-session-actions) > button {
  min-height: 42px;
  padding: 10px 14px;
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: anywhere;
}
:root[data-astra-app="true"] .period-report-panel > :is(#periodReportStatus, .period-report-output):empty {
  display: none;
}

:root[data-astra-app="true"] .supabase-security-card > div:first-child {
  display: grid;
  gap: 12px;
}
:root[data-astra-app="true"] :is(.supabase-security-card, .supabase-recovery-card) p { line-height: 1.65; }
:root[data-astra-app="true"] .supabase-recovery-card { gap: 16px; }
/* Do not set display on these IDs: the hidden attribute controls access/state. */
:root[data-astra-app="true"] :is(#accountSessionsPanel, #supabaseMfaSetup, #accountRecoveryAdmin) {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--astra-line);
}
:root[data-astra-app="true"] #accountSessionsPanel > h4 { margin: 0 0 10px; }
:root[data-astra-app="true"] #accountSessionsPanel > p { margin: 10px 0; }
:root[data-astra-app="true"] .account-session-actions { margin-block: 14px; }
:root[data-astra-app="true"] #supabaseMfaInstruction { margin-bottom: 12px; }
:root[data-astra-app="true"] #accountRecoveryAdmin > h4 { margin: 0 0 10px; }
:root[data-astra-app="true"] #accountRecoveryAdmin > p { margin: 0 0 14px; }
:root[data-astra-app="true"] #accountRecoveryAdmin > button { margin-bottom: 14px; }
:root[data-astra-app="true"] #accountRecoveryAdminStatus:empty { display: none; }

@media (max-width: 520px) {
  :root[data-astra-app="true"] #platformPolicyRiskPanel > .section-title { grid-template-columns: minmax(0, 1fr); }
  :root[data-astra-app="true"] #platformPolicyRiskBadge { grid-column: 1; grid-row: 2; justify-self: start; }
  :root[data-astra-app="true"] #platformPolicyRiskPanel > .section-title p { grid-row: 3; }
}

/* Brand caption and saved content matrix: readable groups and centered scores. */
:root[data-astra-variant="next"] .sidebar .brand {
  align-items: center;
  line-height: 1.5;
  padding-inline: 0;
  /* The identity link is not an inline reference link. */
  text-decoration: none !important;
}
:root[data-astra-variant="next"] .sidebar .brand > span:last-child {
  min-width: 0;
  line-height: 1.5;
}
:root[data-astra-variant="next"] .sidebar .brand > span:last-child small {
  display: block;
  margin-top: 7px;
  font-size: 8px;
  line-height: 1.65;
  letter-spacing: 1.1px;
  text-decoration: none;
}
:root[data-astra-variant="next"] .sidebar .brand-mark { flex-shrink: 0; }

:root[data-astra-app="true"] #customerVideoMatrixBody > tr > td {
  padding: 18px 14px;
}
:root[data-astra-app="true"] #customerVideoMatrixBody > tr > td:first-child {
  vertical-align: top;
}
:root[data-astra-app="true"] #customerVideoMatrixBody > tr > td:not(:first-child) {
  vertical-align: middle;
  text-align: center;
}
:root[data-astra-app="true"] #customerVideoMatrixBody .video-name {
  line-height: 1.55;
}
:root[data-astra-app="true"] #customerVideoMatrixBody .video-meta {
  margin-block: 8px 12px;
  line-height: 1.65;
}
:root[data-astra-app="true"] #customerVideoMatrixBody .video-source-warning {
  margin-block: 0 12px;
  line-height: 1.6;
}
:root[data-astra-app="true"] #customerVideoMatrixBody > tr > td:first-child > button {
  margin: 0 8px 12px 0;
  min-height: 40px;
  padding: 9px 12px;
  line-height: 1.45;
}
:root[data-astra-app="true"] #customerVideoMatrixBody .matrix-source-details {
  margin-top: 2px;
  line-height: 1.6;
}
:root[data-astra-app="true"] #customerVideoMatrixBody .matrix-source-details p {
  margin-block: 10px;
}
