/*
 * accounts.css — domain CSS classes for the Account, Registration, User,
 * Webhook, Webhook Delivery, Session, Password, Invite, Confirmation,
 * and Support settings areas.
 *
 * ============================================================
 *  DESIGN SYSTEM RULES — read before adding any CSS to this file
 * ============================================================
 *
 *  1. VALUES
 *     Never hardcode colors or spacing. Always use var(--color-*) and
 *     calc(var(--spacing) * N). No #hex, no rgb(), no raw px/rem for
 *     color or spacing. Raw rem is OK for non-spacing, non-color
 *     dimensions (max-width, border-radius, font-size, breakpoints)
 *     when no token fits — but prefer tokens where they exist.
 *
 *  2. REACH FOR PRIMITIVES FIRST (see primitives.css)
 *       Layout?      Use .stack, .stack-sm, .stack-lg, .row, .row-between,
 *                    .cluster, .switcher, .center, .grid-auto, .box.
 *       Typography?  Use .text-heading, .text-body, .text-muted.
 *       Surface/bg?  Use .surface, .surface-elevated, .border-subtle.
 *     If the markup can be expressed as primitives, STOP. Do not create
 *     a new class. Duplication is worse than an imperfect class name.
 *
 *  3. NEW CLASSES ONLY WHEN ALL THREE HOLD
 *     a. The combination appears 3+ times (rule of three).
 *     b. You can name it after the domain thing (".accounts-integration-row"),
 *        not appearance (".gray-card-with-border").
 *     c. It is NOT expressible as a one-line primitive combo.
 *
 *  4. NAMING
 *     All classes in this file are prefixed .accounts-*.
 */

/**
 * .accounts-user-card-container
 * Constrains the user profile card to a narrow width on small+ screens.
 *
 * Used by: app/views/users/show.html.erb
 */
@media (min-width: 40rem) {
  .accounts-user-card-container {
    max-width: 32rem;
  }
}

/* ============================================================
 *  Wave 6.4a — Tailwind → domain CSS for auth + settings views
 * ============================================================ */

/**
 * .accounts-form-actions
 * Right-aligned submit button row with standard top margin. Used at the
 * bottom of settings forms and auth forms.
 *
 * Where used:
 *   - app/views/passwords/new.html.erb
 *   - app/views/passwords/_form.html.erb
 *   - app/views/invites/accept.html.erb
 *   - app/views/confirmations/set.html.erb
 *   - app/views/registrations/new.html.erb
 *   - app/views/registrations/password.html.erb
 *   - app/views/registrations/referrals.html.erb
 *   - app/views/registrations/onboarding.html.erb
 *   - app/views/accounts/api.html.erb
 *   - app/views/accounts/company.html.erb
 *   - app/views/users/edit.html.erb
 *   - app/views/webhooks/new.html.erb
 *   - app/views/webhooks/edit.html.erb
 *   - app/views/formats/_form.html.erb
 *
 * When to reuse: Any settings or auth form's submit button row.
 * When NOT to: Forms inside modals or inline forms — use .row-end instead.
 *
 * Note: inside .component-unauthenticated-page-card the top margin steps down
 * to 20px (components.css) so every auth page shares one field → CTA rhythm.
 */
.accounts-form-actions {
  margin-top: calc(var(--spacing) * 6);
  display: flex;
  gap: calc(var(--spacing) * 3);
}

/**
 * .accounts-password-group
 * Wraps the password Forms::FieldComponent together with the forgot-password
 * row so the forgot link sits 8px below the input rather than inheriting the
 * outer .stack gap.
 *
 * Where used:
 *   - app/views/sessions/new.html.erb
 */
.accounts-password-group {
  display: block;
}

/**
 * .accounts-forgot-password-row
 * Right-aligned row for the forgot-password link, 8px below the password
 * input.
 *
 * Where used:
 *   - app/views/sessions/new.html.erb
 *
 * When to reuse: Only for the forgot-password link on the sign-in page.
 * When NOT to: Any other right-aligned text — use .text-right or
 *   .accounts-form-actions.
 */
.accounts-forgot-password-row {
  text-align: right;
  margin-top: calc(var(--spacing) * 2);
  font-size: var(--font-size-xs);
}

/**
 * .accounts-first-time-row
 * One centered muted line under the sign-in button for someone who has never
 * set a password (a client whose login was made for them).
 *
 * Where used:
 *   - app/views/sessions/new.html.erb
 *
 * When to reuse: Only for the first-time line on the sign-in page.
 * When NOT to: Card footers; use the page component's footer slot.
 */
.accounts-first-time-row {
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/**
 * .accounts-form-grid
 * Responsive two-column form layout that collapses to single column when
 * its nearest sized container is narrow. Used for name/password field pairs.
 *
 * Sizes off the CONTAINER, not the viewport — same pattern as the stat-card
 * grid in components.css (`.component-stat-cards-container` / `@container
 * stat-cards`). Requires the nearest ancestor to declare
 * `container-type: inline-size` (unnamed, so any such ancestor qualifies);
 * `.component-unauthenticated-page-card` in components.css does this for
 * every auth page. Without a sized ancestor the query never matches, so the
 * grid degrades safely to single column rather than breaking.
 *
 * Where used:
 *   - app/views/invites/accept.html.erb (2 instances, inside the ~30rem
 *     .component-unauthenticated-page-card — stays single column there,
 *     which is the fix: the old viewport media query split it to two
 *     ~199px columns on any desktop viewport regardless of the card's
 *     actual width).
 *
 * When to reuse: Side-by-side form field pairs in auth/settings forms whose
 * ancestor establishes a `container-type: inline-size` context.
 * When NOT to: Non-form grids, grids with different column counts, or a
 * context with no sized container ancestor (add one rather than falling
 * back to a viewport media query).
 */
.accounts-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--spacing) * 4);
}

@container (min-width: 48rem) {
  .accounts-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/**
 * .accounts-page-title
 * Large title for webhook detail and form pages.
 *
 * Where used:
 *   - app/views/webhooks/show.html.erb
 *   - app/views/webhooks/new.html.erb
 *   - app/views/webhooks/edit.html.erb
 *   - app/views/webhook_deliveries/index.html.erb
 *
 * When to reuse: Detail/form page titles in the webhook area.
 * When NOT to: Card section headings — use SectionHeaderComponent.
 */
.accounts-page-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: calc(var(--spacing) * 6);
}

/**
 * .accounts-detail-text
 * Flex-1 min-width-0 text block inside a row. Prevents long text from
 * overflowing when siblings (badges, buttons) need fixed space.
 *
 * Where used:
 *   - app/views/users/index.html.erb
 *
 * When to reuse: Any list row where text needs to truncate or wrap
 *   within remaining space.
 * When NOT to: Fixed-width text blocks.
 */
.accounts-detail-text {
  flex: 1;
  min-width: 0;
}

/**
 * .accounts-detail-name
 * Primary name/title text inside a detail row.
 *
 * Where used:
 *   - app/views/registrations/edit.html.erb
 *   - app/views/users/index.html.erb
 *
 * When to reuse: Primary text line in integration, user, or profile rows.
 * When NOT to: Headings — use SectionHeaderComponent.
 */
.accounts-detail-name {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--color-text-heading);
}

/**
 * .accounts-detail-description
 * Secondary description/metadata text below a name.
 *
 * Where used:
 *   - app/views/registrations/edit.html.erb
 *
 * When to reuse: Secondary text line in integration/profile rows.
 * When NOT to: Standalone muted text — use .text-muted.
 */
.accounts-detail-description {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: calc(var(--spacing) * 1);
}

/**
 * .accounts-profile-avatar
 * Large circular avatar image on the profile edit page.
 *
 * Where used:
 *   - app/views/registrations/edit.html.erb
 *
 * When to reuse: Profile picture display in settings.
 * When NOT to: Smaller avatars in lists — use .accounts-user-avatar.
 */
.accounts-profile-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 9999rem;
  object-fit: cover;
}

/**
 * .accounts-profile-avatar-placeholder
 * Large circular placeholder with initials when no profile picture is set.
 *
 * Where used:
 *   - app/views/registrations/edit.html.erb
 *
 * When to reuse: Profile picture placeholder in settings.
 * When NOT to: Smaller placeholders — use .accounts-user-avatar-placeholder.
 */
.accounts-profile-avatar-placeholder {
  width: 4rem;
  height: 4rem;
  border-radius: 9999rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-inverted);
  /* deep blue (theme-independent) so white initials clear WCAG AA in both
   * themes; the bright accent / on-dark blue would be too light for white text. */
  background: var(--color-blue-strong);
}

/**
 * .accounts-user-row
 * A single user row in the team members list. Hosts a clickable inner
 * link (avatar + name + badge) and, optionally, a sibling delete button.
 *
 * Where used:
 *   - app/views/users/index.html.erb
 *
 * When to reuse: User list rows in team management.
 * When NOT to: Integration rows — use .accounts-integration-row.
 */
.accounts-user-row {
  padding-block: calc(var(--spacing) * 2);
  border-top: 1px solid var(--color-border-subtle);
}

.accounts-user-row:first-child {
  border-top: none;
}

/**
 * .accounts-user-row-link
 * The clickable inner link wrapping avatar, name, email, and role badge
 * in a team-members list row. Padding + border-radius shape the
 * .interactive-surface hover background into a rounded rectangle; the
 * negative left margin cancels the link's left padding so the avatar
 * sits flush with the card's natural content edge when not hovered,
 * while the rounded hover extends back into the card's padding.
 *
 * Where used:
 *   - app/views/users/index.html.erb
 */
.accounts-user-row-link {
  flex: 1;
  min-width: 0;
  padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3);
  margin-inline-start: calc(var(--spacing) * -3);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
}

/* On phones the role badge competes with the name/email for the row's
 * width and clips both. Let the row wrap and reserve the first line for
 * the avatar + name/email (basis ≈ full width minus the avatar), so the
 * role badge drops to its own line below and the name/email keep the
 * full row width. */
@media (max-width: 40rem) {
  .accounts-user-row-link {
    flex-wrap: wrap;
  }

  .accounts-user-row-link .accounts-detail-text {
    flex-basis: calc(100% - 5rem);
  }
}

/* Team member name reads at the prototype's sm/600 weight rather than
 * the global .accounts-detail-name default (xs/500), so the name is the
 * primary read in each row and the email recedes as metadata. */
.accounts-user-row .accounts-detail-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
}

/**
 * .accounts-invite-form
 * Inline invite form revealed under the Members card header when the
 * Invite button is clicked. Elevated surface with a hairline border so
 * the form reads as an inset action panel — replaces the old
 * InviteUserModalComponent dialog.
 *
 * Where used:
 *   - app/views/users/index.html.erb
 */
.accounts-invite-form {
  display: flex;
  gap: calc(var(--spacing) * 2);
  margin-bottom: calc(var(--spacing) * 4);
  padding: calc(var(--spacing) * 3);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border-themed);
  border-radius: var(--radius-xl);
}

.accounts-invite-form-input {
  flex: 1;
}

/**
 * .accounts-invoice-row
 * Container around a single invoice link in the billing-history card.
 * Provides the hairline border-top that separates each row from the
 * one above; the link inside owns the click area and rounded hover.
 *
 * Where used:
 *   - app/views/accounts/billing.html.erb
 */
.accounts-invoice-row {
  padding-block: calc(var(--spacing) * 2);
  border-top: 1px solid var(--color-border-subtle);
}

.accounts-invoice-row:first-child {
  border-top: none;
}

/**
 * .accounts-invoice-row-link
 * Clickable link wrapping the invoice description, date, and amount.
 * Negative inline margin pulls the rounded hover background into the
 * card's natural padding zone so the link content stays aligned with
 * the card body while the hover affordance extends outward.
 *
 * Where used:
 *   - app/views/accounts/billing.html.erb
 */
.accounts-invoice-row-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--spacing) * 4);
  padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3);
  margin-inline: calc(var(--spacing) * -3);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
}

.accounts-invoice-row-info {
  min-width: 0;
}

.accounts-invoice-row-description {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-heading);
}

.accounts-invoice-row-date {
  margin-top: calc(var(--spacing) * 0.5);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.accounts-invoice-row-amount {
  flex-shrink: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-heading);
}

/**
 * .billing-invoice-row / -row-title
 * Billing page invoice row: the linked invoice summary with its payment
 * badge beside the title, and a Pay button after the link for an invoice
 * still awaiting card payment. The button sits outside the link so the two
 * stay separate targets.
 *
 * Where used:
 *   - app/views/accounts/billing.html.erb
 */
.billing-invoice-row {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing) * 4);
}

.billing-invoice-row > .accounts-invoice-row-link {
  flex: 1;
  min-width: 0;
}

.billing-invoice-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--spacing) * 2);
}

/**
 * .accounts-credit-row / -row-info / -row-description / -row-date
 * / -row-amount
 * Static (non-linked) row in the credits page cards listing a credit
 * grant or a usage entry: description and date on the left, credit
 * amount on the right. Hairline border-top separates rows, mirroring
 * .accounts-invoice-row without the hover affordance since these rows
 * don't navigate anywhere.
 *
 * Where used:
 *   - app/views/accounts/credits.html.erb
 */
.accounts-credit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--spacing) * 4);
  padding-block: calc(var(--spacing) * 2);
  border-top: 1px solid var(--color-border-subtle);
}

.accounts-credit-row:first-child {
  border-top: none;
}

/* On phones the amount string ("1,000,000 of 1,000,000 remaining") is wide
 * enough to starve the info column to zero width and overlap it. Stack the
 * row so the label/date sits above the amount. */
@media (max-width: 40rem) {
  .accounts-credit-row {
    flex-direction: column;
    align-items: flex-start;
    gap: calc(var(--spacing) * 1);
  }
}

.accounts-credit-row-info {
  flex: 1;
  min-width: 0;
}

.accounts-credit-row-description {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-heading);
}

.accounts-credit-row-date {
  margin-top: calc(var(--spacing) * 0.5);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.accounts-credit-row-amount {
  flex-shrink: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-heading);
}

/**
 * .accounts-credit-row-icon
 * Rounded icon chip leading a credit grant or usage row, hinting at the
 * row's kind (gift for grants, coins for purchases, tool icons for usage)
 * so the lists scan visually instead of reading as a ledger dump.
 *
 * Where used:
 *   - app/views/accounts/credits.html.erb
 *   - app/components/billing/payment_method_row_component.html.erb
 */
.accounts-credit-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-lg);
  background: var(--color-surface-hover);
  color: var(--color-text-muted);
}

/**
 * .billing-payment-method / -info / -name / -detail / -actions
 * One saved card in the Billing page's payment methods card: icon chip,
 * card name with its default/expiry badges, a muted expiry and cardholder
 * line, and the make-default/remove actions. Hairline-divided like the
 * credit rows. The overflow menu stays at the end on every width, so the
 * row never wraps.
 *
 * Where used:
 *   - app/components/billing/payment_method_row_component.html.erb
 */
.billing-payment-method {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing) * 4);
  padding-block: calc(var(--spacing) * 4);
  border-top: 1px solid var(--color-border-subtle);
}

.billing-payment-method:first-child {
  border-top: none;
  padding-top: 0;
}

.billing-payment-method:last-child {
  padding-bottom: 0;
}

.billing-payment-method-info {
  flex: 1;
  min-width: 0;
}

.billing-payment-method-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--spacing) * 2);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-heading);
}

.billing-payment-method-detail {
  margin-top: calc(var(--spacing) * 1);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.billing-payment-method-actions {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: calc(var(--spacing) * 2);
}

/* Brand marks are wider than they are tall (credit-card proportions), so
 * they size by width to sit in the same chip as the generic card glyph. */
.billing-payment-method-brand-icon {
  width: 1.5rem;
  height: auto;
}

/**
 * .billing-payment-method-rename-row / -rename-error
 * In-place nickname editing on a saved card: the input, Save and Cancel on
 * one line, with the hint or error under it at the detail line's size.
 *
 * Where used:
 *   - app/components/billing/payment_method_row_component.html.erb
 */
/* While a row is being renamed, its menu steps aside so the form has the
 * row to itself and Save/Cancel are the only controls in reach. */
.billing-payment-method:has(.billing-payment-method-rename-row) .billing-payment-method-actions {
  display: none;
}

.billing-payment-method-rename-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--spacing) * 2);
}

.billing-payment-method-rename-row .component-form-field {
  flex: 1 1 12rem;
  width: auto;
  min-width: 0;
}

.billing-payment-method-rename-error {
  margin-top: calc(var(--spacing) * 1);
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--color-text-danger);
}

/**
 * .billing-add-card-actions
 * Footer of the add-card form: the one line about the $0 check on the
 * left, Cancel and Save card on the right, so the line reads as part of the
 * action it explains. Wraps with the buttons last on narrow screens.
 *
 * Where used:
 *   - app/views/payment_methods/new.html.erb
 */
.billing-add-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--spacing) * 4);
}

/**
 * .accounts-credit-row-progress
 * Slim remaining-balance bar under a credit grant's description, sizing
 * down the inline ProgressBarComponent so it reads as a quiet meter
 * rather than a task progress bar.
 *
 * Where used:
 *   - app/views/accounts/credits.html.erb
 */
.accounts-credit-row-progress {
  max-width: 14rem;
  height: 0.375rem;
  margin-top: calc(var(--spacing) * 2);
}

/**
 * .accounts-credit-row-amount-negative
 * Deduction amount on a usage row — softened red so spending reads as a
 * deduction at a glance without alarming every line of the history.
 *
 * Where used:
 *   - app/views/accounts/credits.html.erb
 */
.accounts-credit-row-amount-negative {
  color: color-mix(in srgb, var(--color-red) 75%, var(--color-text-muted));
  font-variant-numeric: tabular-nums;
}

/**
 * .accounts-credits-hero / -hero-icon / -hero-label / -hero-value
 * Headline balance panel at the top of the credits page: accent-washed
 * surface, large tabular number (animated by the count-up controller),
 * and the buy/manage actions. Makes the available balance the page's
 * focal point instead of one stat card among three.
 *
 * Where used:
 *   - app/views/accounts/credits.html.erb
 */
.accounts-credits-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(var(--spacing) * 2);
  padding: calc(var(--spacing) * 6);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-2xl);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--color-accent) 8%, transparent), transparent 60%),
    var(--color-surface-primary);
}

.accounts-credits-hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  color: var(--color-accent);
}

.accounts-credits-hero-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
}

.accounts-credits-hero-value {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-heading);
}

.accounts-credits-hero .cluster {
  margin-top: calc(var(--spacing) * 2);
}

/**
 * .accounts-credits-activity / -activity-month / -activity-track
 * / -activity-bar / -activity-label
 * Six-month usage strip on the credits page: one accent bar per month,
 * scaled against the busiest month, with the exact amount in the column's
 * title tooltip. Bars grow in on load.
 *
 * Where used:
 *   - app/views/accounts/credits.html.erb
 */
.accounts-credits-activity {
  display: flex;
  gap: calc(var(--spacing) * 2);
}

.accounts-credits-activity-month {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--spacing) * 1);
}

.accounts-credits-activity-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 6rem;
}

.accounts-credits-activity-bar {
  width: 100%;
  height: max(var(--value, 0%), 2%);
  border-radius: var(--radius-sm);
  background: linear-gradient(to top, var(--color-accent), color-mix(in srgb, var(--color-accent) 55%, transparent));
  animation: accounts-credits-activity-grow 600ms ease-out;
}

@keyframes accounts-credits-activity-grow {
  from {
    height: 0;
  }
}

.accounts-credits-activity-label {
  font-size: var(--font-size-2xs);
  color: var(--color-text-muted);
}

/**
 * .accounts-card-empty
 * Centered muted message rendered inside a card when there's nothing
 * to list. Pure text — no border or background — since the card chrome
 * already provides the surface; the standalone EmptyStateComponent
 * would double up that chrome.
 *
 * Where used:
 *   - app/views/accounts/billing.html.erb
 *   - app/views/webhooks/index.html.erb
 *   - app/views/webhook_deliveries/index.html.erb
 *   - app/views/webhook_deliveries/show.html.erb
 *   - app/views/formats/index.html.erb
 */
.accounts-card-empty {
  padding-block: calc(var(--spacing) * 6);
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/**
 * .accounts-webhook-row / -row-link / -row-info / -row-name / -row-url
 * / -row-trailing / -row-time
 *
 * Hairline-divided list of webhooks inside the Webhooks index card.
 * Mirrors the invoice/team-member row pattern: container holds the
 * border-top, link inside owns the rounded hover and padding, with a
 * left-aligned name+url info block and a right-aligned status badge +
 * last-triggered time.
 *
 * The Formats index runs the same recipe under .formats-row-* in
 * formats.css; keep the two in step when either changes.
 *
 * Where used:
 *   - app/views/webhooks/index.html.erb
 */
.accounts-webhook-row {
  padding-block: calc(var(--spacing) * 2);
  border-top: 1px solid var(--color-border-subtle);
}

.accounts-webhook-row:first-child {
  border-top: none;
}

.accounts-webhook-row-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--spacing) * 4);
  padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3);
  margin-inline: calc(var(--spacing) * -3);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
}

.accounts-webhook-row-info {
  flex: 1;
  min-width: 0;
}

.accounts-webhook-row-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-heading);
}

.accounts-webhook-row-url {
  margin-top: calc(var(--spacing) * 0.5);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounts-webhook-row-trailing {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing) * 3);
  flex-shrink: 0;
}

.accounts-webhook-row-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/**
 * .accounts-delivery-row / -row-link / -row-info / -row-event /
 * -row-time / -row-trailing / -row-code
 *
 * Hairline-divided list of webhook delivery attempts inside the
 * Deliveries card. Each row shows event_type + delivered timestamp
 * on the left, response_code + success/failure badge on the right.
 *
 * Where used:
 *   - app/views/webhook_deliveries/index.html.erb
 */
.accounts-delivery-row {
  padding-block: calc(var(--spacing) * 2);
  border-top: 1px solid var(--color-border-subtle);
}

.accounts-delivery-row:first-child {
  border-top: none;
}

.accounts-delivery-row-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--spacing) * 4);
  padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3);
  margin-inline: calc(var(--spacing) * -3);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
}

.accounts-delivery-row-info {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing) * 0.5);
  min-width: 0;
}

.accounts-delivery-row-event {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-heading);
}

.accounts-delivery-row-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.accounts-delivery-row-trailing {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing) * 3);
  flex-shrink: 0;
}

.accounts-delivery-row-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--font-size-xs);
  color: var(--color-text-body);
}

/**
 * .accounts-delivery-filters / -delivery-filter
 *
 * Segmented control for the All / Successful / Failed filter pills
 * on the deliveries index. Active segment gets a white surface + shadow
 * lift; inactive segments are transparent on the elevated track.
 * Documented in design-system.md § Segmented Control.
 *
 * Where used:
 *   - app/views/webhook_deliveries/index.html.erb
 */
.accounts-delivery-filters {
  display: inline-flex;
  gap: calc(var(--spacing) * 1);
  padding: calc(var(--spacing) * 1);
  background: var(--color-surface-elevated);
  border-radius: var(--radius-pill);
}

.accounts-delivery-filter {
  padding: calc(var(--spacing) * 1.5) calc(var(--spacing) * 4);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background var(--motion-fast), color var(--motion-fast);
}

.accounts-delivery-filter:hover {
  color: var(--color-text-heading);
}

.accounts-delivery-filter.is-active {
  background: var(--color-surface-primary);
  color: var(--color-text-heading);
  box-shadow: var(--shadow-sm);
}

/**
 * .accounts-user-avatar
 * 36px circular avatar image in the team members list, matching the
 * settings-team prototype pattern.
 *
 * Where used:
 *   - app/views/users/index.html.erb
 *
 * When to reuse: User avatars in team member rows.
 * When NOT to: Profile page — use .accounts-profile-avatar.
 */
.accounts-user-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999rem;
  object-fit: cover;
  flex-shrink: 0;
}

/**
 * .accounts-user-avatar-placeholder
 * Circular placeholder with initials when no profile picture is set.
 * Non-current users get the elevated surface so the row reads as a
 * peer of the others; the current user (.is-current) gets the accent
 * fill so "you" stands out at a glance.
 *
 * Where used:
 *   - app/views/users/index.html.erb
 */
.accounts-user-avatar-placeholder {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-body);
  flex-shrink: 0;
  background: var(--color-surface-elevated);
}

/* Same reasoning as .accounts-profile-avatar-placeholder above: the fill carries
 * initials, so it takes the theme-independent deep blue rather than
 * --color-accent, which brightens to #3fa7ed on Studio Dark and leaves white
 * initials at 2.64:1. --color-blue-strong holds 5.58:1 in both themes. */
.accounts-user-avatar-placeholder.is-current {
  background: var(--color-blue-strong);
  color: var(--color-text-inverted);
}

/**
 * .accounts-pagination-row
 * Centered pagination controls separated by a top border.
 *
 * Where used:
 *   - app/views/users/index.html.erb
 *   - app/views/accounts/billing.html.erb
 *   - app/views/accounts/credits.html.erb
 *   - app/views/webhook_deliveries/index.html.erb
 *
 * When to reuse: Pagination at the bottom of a card in settings.
 * When NOT to: Table pagination — handled by TableComponent.
 */
.accounts-pagination-row {
  margin-top: calc(var(--spacing) * 4);
  padding-top: calc(var(--spacing) * 4);
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  justify-content: center;
}

/**
 * .accounts-action-bar
 * Horizontal button group with bottom margin.
 *
 * Where used:
 *   - app/views/webhooks/show.html.erb
 *   - app/views/webhook_deliveries/index.html.erb
 *   - app/views/formats/show.html.erb
 *
 * When to reuse: Action button rows on detail pages.
 * When NOT to: Form submit rows — use .accounts-form-actions.
 */
.accounts-action-bar {
  display: flex;
  gap: calc(var(--spacing) * 4);
  margin-bottom: calc(var(--spacing) * 6);
}

/**
 * .accounts-code-block
 * Pre-formatted code display block with elevated surface background.
 *
 * Where used:
 *   - app/views/webhook_deliveries/show.html.erb (2 instances)
 *
 * When to reuse: JSON/code display in webhook delivery details.
 * When NOT to: Inline code — use <code> with no wrapper class.
 */
.accounts-code-block {
  background: var(--color-surface-elevated);
  padding: calc(var(--spacing) * 4);
  border-radius: var(--radius-xs);
  overflow-x: auto;
  font-size: var(--font-size-xs);
}

/**
 * .accounts-checkbox-row
 * Interactive checkbox row with hover highlight. Used for preference
 * lists (audience types, webhook active toggle).
 *
 * Where used:
 *   - app/views/registrations/onboarding.html.erb
 *
 * When to reuse: Checkbox option lists in settings forms.
 * When NOT to: Standalone checkboxes — use bare form helpers.
 */
.accounts-checkbox-row {
  display: flex;
  align-items: center;
  padding: calc(var(--spacing) * 1) calc(var(--spacing) * 2);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--transition-timing-standard);
}

.accounts-checkbox-row:hover {
  background: var(--color-surface-hover);
}

/**
 * .accounts-checkbox-input
 * Styled checkbox input matching the brand theme.
 *
 * Where used:
 *   - app/views/registrations/onboarding.html.erb
 *   - app/views/webhooks/new.html.erb
 *   - app/views/webhooks/edit.html.erb
 *
 * When to reuse: Standalone checkboxes in settings forms.
 * When NOT to: Checkboxes inside form components — let the component style.
 */
.accounts-checkbox-input {
  width: 1rem;
  height: 1rem;
  color: var(--color-brand-primary);
  border-color: var(--color-border-strong);
  border-radius: var(--radius-xs);
}

/* Focus doctrine: the shared ring on keyboard focus, replacing the bespoke
 * 2px accent ring this checkbox used to draw for itself. */
.accounts-checkbox-input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/**
 * .accounts-checkbox-label
 * Label text adjacent to a checkbox input.
 *
 * Where used:
 *   - app/views/registrations/onboarding.html.erb
 *   - app/views/webhooks/new.html.erb
 *   - app/views/webhooks/edit.html.erb
 *
 * When to reuse: Labels next to standalone checkboxes.
 * When NOT to: Form field labels — use Forms::LabelComponent.
 */
.accounts-checkbox-label {
  margin-left: calc(var(--spacing) * 4);
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--color-text-heading);
}

/**
 * .accounts-confirmation*
 * Compact confirmation state shown after registration. The icon composition,
 * supporting copy, and recovery note replace the legacy oversized illustration.
 *
 * Where used:
 *   - app/views/registrations/account_created.html.erb
 *
 * When to reuse: Account-created confirmation content.
 * When NOT to: General notices — use AlertComponent.
 */
.accounts-confirmation {
  margin-top: calc(var(--spacing) * 6);
}

.accounts-confirmation-icon {
  position: relative;
  display: grid;
  width: calc(var(--spacing) * 18);
  height: calc(var(--spacing) * 18);
  place-items: center;
  border-radius: var(--radius-2xl);
  background: var(--color-accent);
  color: var(--color-text-inverted);
}

.accounts-confirmation-icon-envelope {
  width: calc(var(--spacing) * 8);
  height: calc(var(--spacing) * 8);
}

/* Green success badge overlapping the tile's bottom-right corner, ringed by
 * the surface color so it reads as a distinct chip. */
.accounts-confirmation-icon-badge {
  position: absolute;
  right: calc(var(--spacing) * -1.5);
  bottom: calc(var(--spacing) * -1.5);
  display: grid;
  place-items: center;
  width: calc(var(--spacing) * 6);
  height: calc(var(--spacing) * 6);
  border: 0.125rem solid var(--color-surface-primary);
  border-radius: var(--radius-pill);
  /* A full-strength green disc: it takes the family's presentation face for
   * the theme, and the check glyph takes the ink that face can carry. */
  background: var(--color-green-mark);
}

.accounts-confirmation-icon-check {
  width: 0.8125rem;
  height: 0.8125rem;
  color: var(--color-text-on-vivid);
}

/**
 * .accounts-confirmation-resend / -resend-form / -resend-button
 * Muted one-line "can't find it? … resend the email" affordance below the
 * confirmation copy. The button_to form and its button render inline so the
 * resend action reads as accent text inside the sentence.
 *
 * Where used:
 *   - app/views/registrations/account_created.html.erb
 */
.accounts-confirmation-resend {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.accounts-confirmation-resend-form {
  display: inline;
}

.accounts-confirmation-resend-button {
  padding: 0;
  border: none;
  background: none;
  font-size: var(--font-size-xs);
  color: var(--color-accent);
  cursor: pointer;
}

.accounts-confirmation-resend-button:hover {
  text-decoration: underline;
}

/**
 * .accounts-webhook-cell
 * Table cell in the webhook toggle turbo_stream response.
 *
 * Where used:
 *   - app/views/webhooks/toggle_active.turbo_stream.erb
 *
 * When to reuse: Only for the webhook toggle turbo_stream row cells.
 * When NOT to: Regular tables — use Tables::TableComponent.
 */
.accounts-webhook-cell {
  padding: calc(var(--spacing) * 4) calc(var(--spacing) * 6);
  white-space: nowrap;
}

/**
 * .accounts-webhook-badge-active / .accounts-webhook-badge-inactive
 * Inline status badges in the webhook turbo_stream row.
 *
 * Where used:
 *   - app/views/webhooks/toggle_active.turbo_stream.erb
 *
 * When to reuse: Only for the webhook toggle status badge.
 * When NOT to: Regular badges — use BadgeComponent.
 */
.accounts-webhook-badge-active {
  display: inline-flex;
  align-items: center;
  padding: calc(var(--spacing) * 1) calc(var(--spacing) * 2);
  border-radius: 9999rem;
  font-size: var(--font-size-xs);
  font-weight: 500;
  background: color-mix(in srgb, var(--color-green) 12%, transparent);
  color: var(--color-status-text-green);
}

.accounts-webhook-badge-inactive {
  display: inline-flex;
  align-items: center;
  padding: calc(var(--spacing) * 1) calc(var(--spacing) * 2);
  border-radius: 9999rem;
  font-size: var(--font-size-xs);
  font-weight: 500;
  background: var(--color-surface-elevated);
  color: var(--color-text-muted);
}

/**
 * .accounts-webhook-time-cell
 * Time column cell in the webhook turbo_stream row.
 *
 * Where used:
 *   - app/views/webhooks/toggle_active.turbo_stream.erb
 */
.accounts-webhook-time-cell {
  padding: calc(var(--spacing) * 4) calc(var(--spacing) * 6);
  white-space: nowrap;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/**
 * .accounts-webhook-actions-cell
 * Right-aligned actions column cell in the webhook turbo_stream row.
 *
 * Where used:
 *   - app/views/webhooks/toggle_active.turbo_stream.erb
 */
.accounts-webhook-actions-cell {
  padding: calc(var(--spacing) * 4) calc(var(--spacing) * 6);
  white-space: nowrap;
  text-align: right;
  font-size: var(--font-size-xs);
  font-weight: 500;
}

/**
 * .accounts-webhook-action-link
 * Inline action links (edit, test, delete) in the webhook turbo_stream row.
 *
 * Where used:
 *   - app/views/webhooks/toggle_active.turbo_stream.erb
 */
.accounts-webhook-action-link {
  color: var(--color-brand-primary);
  margin-right: calc(var(--spacing) * 4);
}

.accounts-webhook-action-link:hover {
  opacity: 0.8;
}

.accounts-webhook-action-link-success {
  color: var(--color-text-success);
  margin-right: calc(var(--spacing) * 4);
}

.accounts-webhook-action-link-success:hover {
  opacity: 0.8;
}

.accounts-webhook-action-link-danger {
  color: var(--color-text-danger);
}

.accounts-webhook-action-link-danger:hover {
  opacity: 0.8;
}

/**
 * .accounts-webhook-url
 * Constrains the URL column to prevent long URLs from expanding the table.
 *
 * Where used:
 *   - app/views/webhooks/toggle_active.turbo_stream.erb
 */
.accounts-webhook-url {
  max-width: 20rem;
}

/**
 * .accounts-webhook-inline-form
 * Inline form wrapper for button_to actions in the webhook row.
 *
 * Where used:
 *   - app/views/webhooks/toggle_active.turbo_stream.erb (2 instances)
 */
.accounts-webhook-inline-form {
  display: inline;
}

/**
 * .accounts-settings-narrow / -medium / -wide
 * Max-width containers for settings page content areas.
 *
 * Where used:
 *   - app/views/registrations/edit.html.erb (.accounts-settings-narrow)
 *   - app/views/users/index.html.erb (.accounts-settings-narrow)
 *   - app/views/webhooks/new.html.erb (.accounts-settings-medium)
 *   - app/views/webhooks/edit.html.erb (.accounts-settings-medium)
 *   - app/views/webhooks/show.html.erb (.accounts-settings-wide)
 *   - app/views/webhook_deliveries/show.html.erb (.accounts-settings-wide)
 *   - app/views/support/index.html.erb (.accounts-settings-wide)
 *   - app/views/formats/index.html.erb (.accounts-settings-medium)
 *   - app/views/formats/new.html.erb (.accounts-settings-medium)
 *   - app/views/formats/edit.html.erb (.accounts-settings-medium)
 *   - app/views/formats/show.html.erb (.accounts-settings-wide)
 *   - app/views/users/edit.html.erb (max-w-lg via .accounts-settings-compact)
 *
 * When to reuse: Content width constraints on settings pages.
 * When NOT to: Card-level width — pass classes to CardComponent.
 */
.accounts-settings-compact {
  max-width: 32rem;
}

.accounts-settings-narrow {
  max-width: 36rem;
}

.accounts-settings-medium {
  max-width: 42rem;
}

.accounts-settings-wide {
  max-width: 48rem;
}

/**
 * .accounts-profile-header
 * Avatar + name/role row at the top of the profile edit card.
 *
 * Where used:
 *   - app/views/registrations/edit.html.erb
 */
.accounts-profile-header {
  margin-bottom: calc(var(--spacing) * 7);
}

/**
 * .accounts-card-tight-header
 * Wraps a card title plus a short description paragraph so the gap
 * between the two stays tight (8px) — the canonical card-title rule
 * (.component-card > .component-card-title) would put 24px of air
 * between them by default. The wrapper also owns the bottom margin to
 * the form/body that follows.
 *
 * Where used:
 *   - app/views/registrations/edit.html.erb (Change password card)
 */
.accounts-card-tight-header {
  margin-bottom: calc(var(--spacing) * 5);
}

.accounts-card-tight-header .component-card-title {
  margin-bottom: calc(var(--spacing) * 2);
}

.accounts-card-tight-header .accounts-password-description {
  margin-bottom: 0;
}

/**
 * .accounts-user-identity
 * Avatar + name + role badge row at the top of the user show card.
 * Bottom margin separates the identity header from the details list.
 *
 * Where used:
 *   - app/views/users/show.html.erb
 *
 * When to reuse: Identity headers on user/profile show pages.
 * When NOT to: Profile edit — use .accounts-profile-header.
 */
.accounts-user-identity {
  margin-bottom: calc(var(--spacing) * 6);
}

/**
 * .accounts-user-identity-text
 * Name + role badge stack beside the avatar in the identity header.
 * Aligns badge to the start of the text column.
 *
 * Where used:
 *   - app/views/users/show.html.erb
 */
.accounts-user-identity-text {
  align-items: flex-start;
}

/**
 * .accounts-user-identity-name
 * Display name heading in the user show identity header.
 *
 * Where used:
 *   - app/views/users/show.html.erb
 */
.accounts-user-identity-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text-heading);
}

/**
 * .accounts-save-row
 * Wrapper for a form's primary submit button. 24px of top margin so
 * the button sits clear of the last field — matches the prototype's
 * `space-y-4 + pt-2` pattern (16px stack gap + 8px wrapper padding).
 *
 * Where used:
 *   - app/views/registrations/edit.html.erb (Profile + Change password)
 */
.accounts-save-row {
  margin-top: calc(var(--spacing) * 6);
}

/**
 * .accounts-inline-annotation
 * Inline xs/muted text used within a name line (e.g., "(you)" tag).
 *
 * Where used:
 *   - app/views/users/index.html.erb
 *
 * When to reuse: Short inline metadata next to a name.
 * When NOT to: Block-level descriptions — use .accounts-detail-description.
 */
.accounts-inline-annotation {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/**
 * .accounts-delete-action
 * Red-text modifier for destructive action buttons (e.g., delete user).
 *
 * Where used:
 *   - app/views/users/index.html.erb
 *   - app/views/registrations/edit.html.erb (Remove photo)
 *
 * When to reuse: Destructive ghost/icon buttons in settings lists.
 * When NOT to: Red badges — use BadgeComponent with color: :red.
 */
.accounts-delete-action {
  color: var(--color-text-danger);
}

.accounts-delete-action:hover {
  color: var(--color-text-danger-hover);
}

/**
 * .accounts-create-action
 * Bottom margin on standalone "create" buttons above a list/table.
 *
 * Where used:
 *   - app/views/webhooks/index.html.erb
 *
 * When to reuse: Create/add buttons above settings tables.
 * When NOT to: Buttons inside forms — use .accounts-form-actions.
 */
.accounts-create-action {
  margin-bottom: calc(var(--spacing) * 8);
}

/**
 * .accounts-toggle-row / -row-text / -row-label / -row-help
 *
 * Stacked label + help text + toggle column for boolean form fields
 * (e.g. webhook "Active"). Used in place of a raw checkbox. Toggle
 * sits underneath rather than on the right so long help text doesn't
 * push the toggle off into wonky whitespace.
 *
 * Where used:
 *   - app/views/webhooks/new.html.erb
 *   - app/views/webhooks/edit.html.erb
 */
.accounts-toggle-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(var(--spacing) * 2);
}

.accounts-toggle-row-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-heading);
}

.accounts-toggle-row-help {
  margin-top: calc(var(--spacing) * 0.5);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/**
 * .accounts-inline-code
 * Small-font inline code element inside detail/table cells.
 *
 * Where used:
 *   - app/views/webhooks/show.html.erb
 *   - app/views/webhook_deliveries/show.html.erb (2 instances)
 *   - app/views/webhook_deliveries/index.html.erb
 *
 * When to reuse: Inline <code> inside detail rows or table cells.
 * When NOT to: Code blocks — use .accounts-code-block.
 */
.accounts-inline-code {
  font-size: var(--font-size-xs);
}

/**
 * .accounts-empty-value
 * Muted placeholder text for empty/null values in detail rows.
 *
 * Where used:
 *   - app/views/webhooks/show.html.erb (4 instances)
 *   - app/views/webhook_deliveries/show.html.erb (2 instances)
 *   - app/views/webhook_deliveries/index.html.erb
 *
 * When to reuse: Placeholder text when a detail field has no value.
 * When NOT to: General muted text — use .text-muted primitive.
 */
.accounts-empty-value {
  color: var(--color-text-muted);
}

/**
 * .accounts-status-success
 * Green status text for positive indicators (e.g., secret configured).
 *
 * Where used:
 *   - app/views/webhooks/show.html.erb
 *
 * When to reuse: Inline green status text in detail rows.
 * When NOT to: Badge-style status — use BadgeComponent with color: :green.
 */
.accounts-status-success {
  color: var(--color-text-success);
}

/**
 * .accounts-status-danger
 * Red status text for negative indicators (e.g., failure count).
 *
 * Where used:
 *   - app/views/webhooks/show.html.erb
 *
 * When to reuse: Inline red status text in detail rows.
 * When NOT to: Badge-style status — use BadgeComponent with color: :red.
 */
.accounts-status-danger {
  color: var(--color-text-danger);
}

/**
 * .accounts-card-description
 * Sm/muted intro paragraph between a card's title and its body content.
 * Mirrors the prototype's "Use at least 12 characters..." pattern on the
 * Change Password card and the API documentation link on the API card.
 *
 * Where used:
 *   - app/views/accounts/api.html.erb
 *   - app/views/market_dashboard_settings/show.html.erb
 */
.accounts-card-description {
  margin-bottom: calc(var(--spacing) * 5);
  font-size: var(--font-size-sm);
  line-height: 1.55;
  color: var(--color-text-muted);
}

/**
 * .accounts-copyable-label
 * Field label above a read-only copyable input (API token, referral
 * link). Matches the standard form label rhythm but doesn't need the
 * required/optional wrappers from Forms::LabelComponent.
 *
 * Where used:
 *   - app/views/accounts/api.html.erb
 *   - app/views/registrations/referrals.html.erb
 */
.accounts-copyable-label {
  display: block;
  margin-bottom: var(--field-label-gap);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-body);
}

/**
 * .accounts-copyable-row
 * Flex row pairing a read-only input with a trailing Copy button.
 * The input fills the available width via .accounts-copyable-input;
 * the button sits to its right without shrinking.
 *
 * Where used:
 *   - app/views/accounts/api.html.erb
 *   - app/views/registrations/referrals.html.erb
 */
.accounts-copyable-row {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing) * 2);
}

.accounts-copyable-input {
  flex: 1;
  min-width: 0;
}

/**
 * .accounts-password-description
 * Muted intro paragraph between a card's title and the password form
 * fields. Mirrors the prototype's "Change password" card layout
 * (~/Work/via-prototype § SettingsProfile).
 *
 * Where used:
 *   - app/views/registrations/edit.html.erb
 *
 * When to reuse: Only for the change-password card on the profile
 *   settings page.
 * When NOT to: Generic card descriptions — use .accounts-card-description.
 */
.accounts-password-description {
  margin-bottom: calc(var(--spacing) * 5);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/**
 * .accounts-field-help
 * Small muted help text below a non-component label/heading.
 *
 * Where used:
 *   - app/views/registrations/onboarding.html.erb
 *
 * When to reuse: Help text under manually-rendered field labels.
 * When NOT to: Form field help — use Forms::FieldComponent help param.
 */
.accounts-field-help {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/**
 * .accounts-change-photo-action
 * Compact ghost button for the "change photo" link in the profile header.
 *
 * Where used:
 *   - app/views/registrations/edit.html.erb
 *
 * When to reuse: Only for the change-photo action in profile settings.
 * When NOT to: General ghost buttons — use ButtonComponent color: :ghost.
 */
.accounts-change-photo-action {
  margin-top: calc(var(--spacing) * 1);
  padding-inline: 0;
}

/**
 * .accounts-submit-full
 * Full-width, center-justified submit button for narrow card forms.
 *
 * Where used:
 *   - app/views/registrations/edit.html.erb
 *
 * When to reuse: Prominent submit buttons in narrow settings cards.
 * When NOT to: Regular submit buttons — use .accounts-form-actions.
 */
.accounts-submit-full {
  width: 100%;
  justify-content: center;
}

/**
 * .accounts-persona-list / -row / -swatch / -name / -actions / -description
 *
 * The account's market dashboard personas in order: color swatch, audience
 * name and move/remove buttons on one line, the description field under them. Rows are
 * hairline-divided like .accounts-webhook-row. The row sets --persona-color
 * inline from AccountPersona#color, the one list of persona colors.
 *
 * Where used:
 *   - app/views/market_dashboard_settings/show.html.erb
 */
.accounts-persona-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: calc(var(--spacing) * 3);
  row-gap: calc(var(--spacing) * 2);
  padding-block: calc(var(--spacing) * 4);
  border-top: 1px solid var(--color-border-subtle);
}

.accounts-persona-row:first-child {
  padding-top: 0;
  border-top: none;
}

.accounts-persona-swatch {
  width: calc(var(--spacing) * 3);
  height: calc(var(--spacing) * 3);
  border-radius: var(--radius-pill);
  background: var(--persona-color);
}

.accounts-persona-description {
  grid-column: 2 / -1;
}

.accounts-persona-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-heading);
  text-decoration: none;
}

.accounts-persona-name:hover {
  text-decoration: underline;
}

.accounts-persona-actions {
  display: flex;
  flex-shrink: 0;
  gap: calc(var(--spacing) * 1);
}

/**
 * .accounts-market-areas / -area-total / -area-list / -area-row / -area-header
 * / -area-name / -area-count / -area-form / -area-new / -area-new-title
 *
 * The staff-only areas that define a store-less account's market, in order:
 * each row is a name, its exact ZIP count and move/remove buttons over the
 * area's own form, hairline-divided like .accounts-persona-row, whose spacing,
 * type and actions it reuses. The new-area form closes the card under one more
 * hairline. The card sits above the settings form, a .stack-lg gap away.
 *
 * Where used:
 *   - app/views/market_dashboard_settings/_market_areas.html.erb
 */
.accounts-market-areas {
  margin-bottom: calc(var(--spacing) * 6);
}

.accounts-market-area-total {
  margin-bottom: calc(var(--spacing) * 5);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-heading);
  font-variant-numeric: tabular-nums;
}

.accounts-market-area-row {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing) * 3);
  padding-block: calc(var(--spacing) * 4);
  border-top: 1px solid var(--color-border-subtle);
}

.accounts-market-area-row:first-child {
  padding-top: 0;
  border-top: none;
}

.accounts-market-area-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: calc(var(--spacing) * 3);
}

.accounts-market-area-name,
.accounts-market-area-new-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-heading);
  overflow-wrap: anywhere;
}

.accounts-market-area-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The kind select hides the fields a kind doesn't use; [hidden] has to beat
   .grid-auto's display. */
.accounts-market-area-form [hidden] {
  display: none;
}

.accounts-market-area-new {
  padding-top: calc(var(--spacing) * 4);
  border-top: 1px solid var(--color-border-subtle);
}

.accounts-market-area-new-title {
  margin-bottom: calc(var(--spacing) * 3);
}
