/* Card header bands (DESIGN.md, "Card header bands"). Opt in the header ROW of a
   card with data-card-band="lead" or "helper": at most one of each per page, and
   every other card header stays neutral. The band bleeds to the card's edges and
   rounds its own top corners, so the card is never forced to clip its contents.
   Loaded last, after the page styles and the shared button standard.

   Page styles reach selectors such as `body.ow-clarity-dashboard .dx .a-money
   :is(...)`. The unmatched id inside :is() lifts every rule here above them
   without !important; it never has to exist in the document. */
.ow [data-card-band]:is([data-card-band], #ow-card-band) {
  --card-band-x: var(--ow-card-pad-x, 16px);
  --card-band-top: var(--ow-card-pad-y, 16px);
  --card-band-radius: var(--radius-card, 16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  box-sizing: border-box;
  margin: calc(-1 * var(--card-band-top)) calc(-1 * var(--card-band-x)) 14px;
  padding: 14px var(--card-band-x);
  border-radius: calc(var(--card-band-radius) - 1px) calc(var(--card-band-radius) - 1px) 0 0;
}
.ow [data-card-band]:is([data-card-band], #ow-card-band) :is(h1, h2, h3, h4) { margin: 0; }
/* An icon-and-title header keeps its parts together instead of spreading them. */
.ow [data-card-band][data-card-band-align="start"]:is([data-card-band], #ow-card-band) { justify-content: flex-start; }

/* Lead: the public hero's purple with the action lime as a rule. One per page,
   on the card that carries the page's main number or status. */
.ow [data-card-band="lead"]:is([data-card-band], #ow-card-band) {
  background: linear-gradient(135deg, var(--brand-purple-fill-1), var(--brand-purple-fill-2));
  box-shadow: inset 0 -3px 0 var(--ink-purple-lime);
  border-bottom: 0;
  padding-bottom: 17px;
  color: #fff;
}
/* Status pills are chips, not band text: they and their dot keep their own colours. */
.ow [data-card-band="lead"]:is([data-card-band], #ow-card-band) :is(h1, h2, h3, h4, p, span, b, small, strong, div, li, dt, dd, time, label):not(.ow-pill, .ow-pill *) { color: #fff; }
.ow [data-card-band="lead"]:is([data-card-band], #ow-card-band) :is(.ow-muted, .a-billed, .rn-meta, small) { color: rgba(255, 255, 255, .9); }
/* A status shown as coloured text with a dot, rather than as a pill, cannot keep its own
   colour here: amber or green on this purple does not reach 4.5:1. The pill exclusion above
   covers real chips, which sit on their own background and are unaffected. */
.ow [data-card-band="lead"]:is([data-card-band], #ow-card-band) .rn-state:not(.ow-pill) { color: #fff; }

/* Links and secondary buttons become white outline buttons. Shared product
   buttons read these variables; plain links take the same values directly.
   The lime primary button stays in the card body. */
.ow [data-card-band="lead"]:is([data-card-band], #ow-card-band) :is(a, button):not([data-band-option]) {
  --rb-fg: #fff;
  --rb-bg: rgba(255, 255, 255, .12);
  --rb-border: rgba(255, 255, 255, .4);
  --rb-hover: rgba(255, 255, 255, .22);
  --rb-hover-fg: #fff;
  --btn-action-ring: #fff;   /* Keep focus visible on the purple surface. */
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 8px;
  text-decoration: none;
}
.ow [data-card-band="lead"]:is([data-card-band], #ow-card-band) :is(a, button):not([data-band-option]):hover { background: rgba(255, 255, 255, .22); }

/* A switch inside the Lead: translucent track, white selected option. Mark the
   group with data-band-switch and each option with data-band-option. */
.ow [data-card-band="lead"]:is([data-card-band], #ow-card-band) [data-band-switch] {
  background: rgba(255, 255, 255, .16);
  border-color: transparent;
}
.ow [data-card-band="lead"]:is([data-card-band], #ow-card-band) [data-band-option] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #fff;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.ow [data-card-band="lead"]:is([data-card-band], #ow-card-band) [data-band-option]:is(.is-on, [aria-pressed="true"], [aria-current="true"]) {
  color: var(--brand-purple-fill-2);
  background: #fff;
}
/* The default purple focus ring disappears on purple. */
.ow [data-card-band="lead"]:is([data-card-band], #ow-card-band) :is(a, button):focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* A chart's legend stays in the white body, straight after the band: series swatches
   (the indigo one most of all) are lost on the purple. */
.ow [data-card-band="lead"]:is([data-card-band], #ow-card-band) + .ow-chart-key { justify-content: flex-end; margin: 0 0 8px; }

/* Helper: the approved 14% lavender. One supporting card per page. */
.ow [data-card-band="helper"]:is([data-card-band], #ow-card-band) {
  background: var(--pastel-purple);
  border-bottom: 1px solid color-mix(in srgb, var(--brand-purple) 28%, var(--surface));
}
.ow [data-card-band="helper"]:is([data-card-band], #ow-card-band) :is(h1, h2, h3, h4) { color: var(--brand-purple-fill-2); }

/* Cards that do not use the shared padding variables. */
/* Payments workspace cards: 18px padding and a 14px radius (owners-payments-workspace.css). */
.ow .ow-pay-card > [data-card-band]:is([data-card-band], #ow-card-band) { --card-band-x: 18px; --card-band-top: 18px; --card-band-radius: 14px; }
@container ow-layout (max-width: 540px) {
  .ow .ow-pay-card > [data-card-band]:is([data-card-band], #ow-card-band) { --card-band-x: 13px; --card-band-top: 13px; }
}
.ow-property-overview-page .panel > [data-card-band]:is([data-card-band], #ow-card-band) { --card-band-radius: 8px; }
.ow-property-overview-page .overview-payments > [data-card-band]:is([data-card-band], #ow-card-band) { --card-band-x: 0px; --card-band-top: 0px; padding: 14px 20px 17px; margin-bottom: 0; }
.ow-property-overview-page .actions-panel > [data-card-band]:is([data-card-band], #ow-card-band) { --card-band-x: 12px; --card-band-top: 22px; padding: 14px 22px; }

@media (forced-colors: active) {
  .ow [data-card-band]:is([data-card-band], #ow-card-band) { background: Canvas; box-shadow: none; border-bottom: 1px solid CanvasText; }
}
