/* Shared Relay button faces. Keep the page's own grids, widths and hidden states. */
:root {
  --relay-button-edge: 14px;
  --relay-button-icon-size: 20px;
  --relay-button-icon-gap: 10px;
}

:root:root:root :where(
  button:not([role="switch"]):not([role="checkbox"]):not([role="radio"]):not([data-slot="slider-thumb"]):not([data-slot="slider"]),
  input[type="button"], input[type="submit"], input[type="reset"],
  a.relaybutton, a.herocta, a.button, a.browsebutton, a.seller-browse-link,
  .freebanner a, .shoplinks a, .marketing-nav > a, .beta-nav > a,
  summary, [role="button"], [role="menuitem"], [role="tab"], [data-relay-action]
) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid #bdcee0 !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 48%, #e6eef7 100%) !important;
  color: #132c48 !important;
  box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 #d1deec, 0 3px 0 #8a9fb7, 0 6px 12px #030b1a26 !important;
  text-decoration: none !important;
  text-shadow: none !important;
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  background-clip: padding-box;
  -webkit-font-smoothing: antialiased;
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

/* Center labels within the space reserved after the left-aligned icon. */
:root:root:root [data-relay-action][data-relay-icon-layout="labelled"] {
  position: relative;
  padding-inline-start: calc(var(--relay-button-edge) + var(--relay-button-icon-size) + var(--relay-button-icon-gap)) !important;
  padding-inline-end: var(--relay-button-edge) !important;
  padding-block: 10px;
  text-align: center !important;
  justify-content: center !important;
  justify-items: center;
  align-items: center;
  flex-direction: row !important;
  gap: var(--relay-button-icon-gap);
  min-inline-size: min(100%, var(--relay-label-min-width, 0px)) !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: none !important;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
:root:root:root [data-relay-action][data-relay-icon-layout="labelled"] > :is(span, strong, small, b) {
  min-width: 0;
  text-align: center !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: none !important;
}
:root:root:root [data-relay-action][data-relay-icon-layout="labelled"] :is(span, strong, small, b) {
  text-align: center !important;
  text-decoration: none !important;
}
:root:root:root [data-relay-action][data-relay-icon-layout="labelled"]::before {
  inset-inline-start: var(--relay-button-edge);
  width: var(--relay-button-icon-size);
  height: var(--relay-button-icon-size);
}
:root:root:root [data-relay-action][data-relay-icon-layout="icon"] {
  min-width: 44px;
  min-height: 44px;
  padding: 10px !important;
  justify-content: center !important;
  text-align: center !important;
}
:root:root:root summary[data-relay-action] { list-style: none; }
:root:root:root summary[data-relay-action]::marker { content: ""; }
:root:root:root summary[data-relay-action]::-webkit-details-marker { display: none; }

/* A row may wrap whole buttons before a label is squeezed inside a word. */
:root:root:root [data-relay-wrap-row] {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch;
}
:root:root:root [data-relay-wrap-row] > :is([data-relay-action], details) {
  flex: 1 1 calc((100% - (var(--relay-wrap-columns, 1) - 1) * var(--relay-wrap-gap, 0px)) / var(--relay-wrap-columns, 1));
}
:root:root:root [data-relay-wrap-row] > details { min-inline-size: min(100%, var(--relay-label-min-width, 0px)) !important; max-inline-size: 100%; }
@media (max-width: 650px) {
  :root:root:root .beta-demo-steps > button[data-relay-action] {
    --relay-button-edge: 7px;
    --relay-button-icon-size: 16px;
    --relay-button-icon-gap: 5px;
  }
}

/* Selected controls keep a clear state as well as a raised face. */
:root:root:root [data-relay-action]:is([aria-pressed="true"], [aria-selected="true"], [aria-current="page"], [aria-current="step"], [data-state="active"], [data-state="open"]) {
  background: linear-gradient(180deg, #f7fcff, #dceeff) !important;
  border-color: #6d9dc4 !important;
  box-shadow: inset 0 1px 0 #ffffff, inset 0 0 0 1px #a1c5e3, 0 3px 0 #6c8eae, 0 6px 12px #030b1a26 !important;
}
:root:root:root [data-relay-action]:is(:disabled, [aria-disabled="true"]) {
  background: linear-gradient(180deg, #edf2f7, #dce5ee) !important;
  color: #52677d !important;
  border-color: #bdcbd9 !important;
  box-shadow: inset 0 1px 0 #ffffffa6, 0 2px 0 #a8b7c7 !important;
  cursor: default;
}
:root:root:root [data-relay-action]:focus-visible {
  outline: 3px solid #75bfff;
  outline-offset: 4px;
}
@media (hover: hover) and (pointer: fine) {
  :root:root:root [data-relay-action]:not(:disabled):not([aria-disabled="true"]):hover {
    background: linear-gradient(180deg, #ffffff, #eef8ff) !important;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 #ffffff, 0 4px 0 #8a9fb7, 0 8px 16px #030b1a30 !important;
  }
}
:root:root:root [data-relay-action]:not(:disabled):not([aria-disabled="true"]):active {
  transform: translateY(2px);
  box-shadow: inset 0 1px 3px #41617f1c, 0 1px 0 #8a9fb7, 0 2px 5px #030b1a20 !important;
}

/* Four header buttons stay in one row, with matching insets on smaller phones. */
:root:root:root .landingnav :is(.marketing-nav, .beta-nav) > a[data-relay-action] {
  --relay-button-edge: 10px;
  --relay-button-icon-size: 18px;
  --relay-button-icon-gap: 8px;
  text-decoration: none !important;
}
@media (max-width: 650px) {
  :root { --relay-button-edge: 12px; --relay-button-icon-size: 18px; --relay-button-icon-gap: 8px; }
  :root:root:root .landingnav :is(.marketing-nav, .beta-nav) > a[data-relay-action] {
    --relay-button-edge: 7px;
    --relay-button-icon-size: 16px;
    --relay-button-icon-gap: 5px;
    border-radius: 12px !important;
    font-size: clamp(12px, 3.2vw, 14px);
  }
}
@media (max-width: 360px) {
  :root:root:root .landingnav :is(.marketing-nav, .beta-nav) > a[data-relay-action] {
    --relay-button-edge: 4px;
    --relay-button-icon-size: 14px;
    --relay-button-icon-gap: 2px;
    font-size: 11.25px;
  }
}
@media (prefers-reduced-motion: reduce) {
  :root:root:root [data-relay-action] { transition: none !important; }
  :root:root:root [data-relay-action]:is(:hover, :active) { transform: none !important; }
}
@media (forced-colors: active) {
  :root:root:root [data-relay-action] { border: 1px solid ButtonText !important; box-shadow: none !important; }
}
