/* WHY R1503: ProductSubscriptionPanel returns sibling panels outside the
   inset/gapped product-settings-layout. Their zero margins put subscription
   and runtime corners against the outer frame and adjacent provider card.
   Match that existing desktop inset and its <=520px mobile inset; preserve
   the department panel's established bottom spacing and all content/actions. */
.app-shell .rules-view .product-workspace-settings > .product-settings-panel:not(.product-department-panel) {
  margin: .75rem 1rem 0;
}
@media (max-width: 520px) {
  .app-shell .rules-view .product-workspace-settings > .product-settings-panel:not(.product-department-panel) {
    margin-inline: .75rem;
  }
}
/* The existing trial panel had zero inline margins, so its rounded border
   touched the subscription frame. Inset only this nested notice, never the
   shell's mobile-expired notice or sidebar/topbar trial consumers. */
.app-shell .rules-view .product-workspace-settings > .product-settings-panel > .trial-status--panel {
  margin: .75rem;
}
/* Runtime actions are direct children, outside the already-padded forms.
   Keep their label, height, focus treatment and handlers; give the button's
   border/shadow breathing room instead of clipping the card's descendants. */
.app-shell .rules-view .product-workspace-settings > .product-settings-panel[aria-labelledby="runtime-title"] > :is(.primary-button, .secondary-button) {
  margin: 0 .75rem .75rem;
  max-width: calc(100% - 1.5rem);
}
/* The subscription form's filled bottom would otherwise paint square corners
   over the existing 9px card radius. Its inner radius is 9px minus 1px border;
   rounding the fill preserves visible focus, unlike overflow:hidden. */
.app-shell .rules-view .product-workspace-settings > #subscription-payments > .product-settings-form:last-child {
  border-radius: 0 0 8px 8px;
}

/* WHY R1503 REV3: parent phone proof passed the closed-card spacing, then
   opening Add an account record exposed a square canvas form over the 9px
   panel's bottom border. The disclosure is transparent and its open summary
   paints above the form; only the last form paints the offending bottom.
   Account, provider and department share this exact ancestry. Round that
   fill to the existing 8px inner corner only when the open disclosure is the
   panel's last child. Preserve visible focus/shadows: do not clip ancestors. */
.app-shell .rules-view .product-workspace-settings .product-settings-panel > .product-settings-disclosure:last-child[open] > .product-settings-form:last-child {
  border-radius: 0 0 8px 8px;
}
