/* Shared dimensions for page actions, secondary actions, and inline tools. */
:root {
  --action-prominent: 42px;
  --action-hero: 40px;
  --action-standard: 34px;
  --action-form: 32px;
  --action-compact: 30px;
  --action-inline: 28px;
  --action-touch-gap: 8px;
  --action-focus: #087b77;
}

#pg-creator .me-mast-actions {
  align-items: center;
  flex-flow: row wrap;
}

#pg-creator .me-mast-actions > :is(.me-save-btn, .me-secondary-btn),
#pg-private .knowledge-actions > :is(.primary-button, .quiet-button) {
  --action-height: var(--action-hero);
  --action-padding: 15px;
}

#pg-creator .me-mast-actions > :is(.me-save-btn, .me-secondary-btn) {
  width: fit-content;
  flex: 0 0 auto;
}

#pg-sim .lab-resume > .lab-btn.primary,
#pg-sim .lab-idle-panel > .lab-btn.primary,
#pg-ai .cloud-workbench .cloud-welcome > .cloud-primary {
  --action-height: var(--action-prominent);
  --action-padding: 17px;
  --action-type-size: 13px;
}

#pg-ai .cloud-workbench .cloud-card-actions > .cloud-primary {
  --action-height: var(--action-form);
  --action-padding: 12px;
}

#pg-sim .lab-entry-actions > .lab-btn,
#pg-sim .lab-prepare-actions > .lab-btn,
#pg-creator .da :is(.da-heading, .da-detail-heading, .da-section-heading) button,
#pg-ai .cloud-workbench .cloud-workbench-dialog .cloud-primary {
  --action-height: var(--action-standard);
  --action-padding: 12px;
}

#pg-creator .me-tab-view :is(.me-save-btn, .me-secondary-btn),
#pg-creator .da :is(.da-table-wrap, .da-records) button,
#pg-ai .cloud-workbench .cloud-workbench-actions > button,
#pg-sim :is(.lab-library-heading, .lab-entry-connection) > .lab-btn,
#pg-sim .lab-observer .ob-actions > button {
  --action-height: var(--action-compact);
  --action-padding: 10px;
}

#pg-creator .me-mast-actions > :is(.me-save-btn, .me-secondary-btn):not([hidden]),
#pg-creator .me-tab-view :is(.me-save-btn, .me-secondary-btn):not([hidden]),
#pg-creator .da :is(.da-heading, .da-detail-heading, .da-section-heading, .da-table-wrap, .da-records) button:not([hidden]),
.da-dialog footer > button:not([hidden]),
#pg-private .knowledge-actions > :is(.primary-button, .quiet-button):not([hidden]),
#pg-sim :is(.lab-library-heading, .lab-entry-actions, .lab-entry-connection, .lab-resume, .lab-idle-panel, .lab-prepare-actions) > .lab-btn:not([hidden]),
#pg-sim .lab-observer .ob-actions > button:not([hidden]),
#pg-ai .cloud-workbench :is(.cloud-card-actions, .cloud-welcome, .cloud-workbench-actions) > button:not([hidden]),
#pg-ai .cloud-workbench .cloud-workbench-dialog .cloud-primary:not([hidden]) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-inline-size: 100%;
  min-block-size: var(--action-height, var(--action-standard));
  block-size: auto;
  padding: 4px var(--action-padding, 12px);
  font-family: var(--font-ui, system-ui);
  font-size: var(--action-type-size, 12px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: normal;
  text-align: center;
  white-space: normal;
}

#pg-creator .me-mast-actions > .me-secondary-btn.is-ghost {
  border-color: #ffffff9c;
  background: #142d3e70;
}

#pg-creator .me-tab-view :is(#me-profile-save, #me-public-save) {
  --action-height: var(--action-form);
  --action-padding: 12px;
  justify-self: end;
  align-self: flex-end;
  flex: 0 0 auto;
  width: fit-content;
}

#pg-creator .me-tab-view :is(.me-editorial-actions, .me-safety-actions) {
  align-items: center;
  flex-flow: row wrap;
  gap: 8px;
}

#pg-creator .me-tab-view :is(.me-editorial-heading, .me-view-heading, .me-editorial-actions, .me-safety-actions) > :is(.me-save-btn, .me-secondary-btn) {
  width: fit-content;
  flex: 0 0 auto;
}

#pg-creator .me-safety-actions > .me-save-btn {
  border-color: #c6dedb;
  background: #edf7f5;
  color: #08615e;
}

#pg-creator .me-safety-actions > .me-save-btn:hover {
  border-color: #76aaa4;
  background: #dcefed;
}

#pg-creator .me-tab-view :is(.me-save-btn, .me-secondary-btn):focus-visible {
  outline: 2px solid var(--action-focus);
  outline-offset: 3px;
}

#pg-creator .me-editorial-cover .me-secondary-btn.is-ghost:focus-visible {
  outline-color: #86e8dd;
}

#pg-creator .da .da-table-wrap button[data-action=select] {
  white-space: nowrap;
}

#pg-creator .da .da-table-wrap td {
  padding-block: 10px;
}

#pg-creator .da .da-records :is([data-action=revoke], [data-mode=remove]) {
  color: var(--da-danger);
}

/* Keep the search and sort aligned while the search field takes the remaining width. */
#pg-creator #me-view-favorites .me-favorite-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  align-items: center;
  width: min(100%, 318px);
  min-width: 0;
  gap: 6px;
}

#pg-creator #me-view-favorites .me-favorite-tools :is(input, select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: var(--action-form);
  font-size: 11px;
  line-height: 1.35;
}

#pg-creator #me-view-favorites .me-favorite-tools input {
  padding-inline: 28px 8px;
}

#pg-creator #me-view-favorites .me-favorite-tools select {
  padding-inline: 9px 24px;
}

#pg-creator #me-view-favorites .me-favorite-search-icon {
  inset-inline-start: 9px;
}

@media (max-width: 340px) {
  #pg-creator #me-view-favorites .me-favorite-tools {
    grid-template-columns: 1fr;
  }
}

#pg-creator .me-deployment-item {
  grid-template-columns: 10px minmax(0, 1fr) fit-content(44%);
  column-gap: 10px;
}

#pg-creator .me-deployment-copy :is(strong, small) {
  white-space: normal;
  overflow-wrap: anywhere;
}

#pg-creator .me-deployment-copy small:empty {
  display: none;
}

#pg-creator .me-deployment-state {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  place-self: center end;
  min-width: 0;
  max-width: 100%;
}

#pg-creator .me-deployment-state span {
  box-sizing: border-box;
  display: block;
  max-width: 100%;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Keep the five deployment steps in order and in the banner's layout flow. */
#pg-creator .me-algorithm-feature {
  flex-direction: column;
  gap: 24px;
}

#pg-creator .me-algorithm-feature ol {
  --deployment-step-gap: 14px;
  position: static;
  align-self: flex-end;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 380px);
  gap: var(--deployment-step-gap);
}

#pg-creator .me-algorithm-feature li {
  display: grid;
  grid-template-rows: 10px 1fr;
  place-items: center;
  row-gap: 3px;
  min-height: 40px;
  padding: 4px 3px;
  border-color: #aec7cc82;
  border-radius: 4px;
  background: #0b2837ed;
  color: #f3f9fa;
  font: 600 11px/1.25 var(--font-ui, system-ui);
  text-wrap: balance;
}

#pg-creator .me-algorithm-feature li b {
  margin: 0;
  color: #67e2d8;
  font-size: 9px;
  line-height: 1;
}

#pg-creator .me-algorithm-feature li:not(:last-child)::after {
  content: "";
  width: calc(var(--deployment-step-gap) - 4px);
  height: 8px;
  top: 50%;
  left: calc(100% + 3px);
  right: auto;
  transform: translateY(-50%);
  background: currentColor;
  clip-path: polygon(0 40%, 48% 40%, 48% 0, 100% 50%, 48% 100%, 48% 60%, 0 60%);
}

@media (max-width: 520px) {
  #pg-creator .me-algorithm-feature ol {
    --deployment-step-gap: 5px;
  }
}

#pg-creator .me-mast-actions > .me-secondary-btn.is-ghost:hover {
  background: #29465a;
  border-color: #fff;
}

#pg-creator .me-mast-actions > button:focus-visible,
#pg-private .knowledge-actions > button:focus-visible {
  outline: 2px solid #86e8dd;
  outline-offset: 3px;
}

#pg-creator .me-security-row > .me-secondary-btn {
  inline-size: max-content;
  border-color: #a7c0be;
}

#pg-creator .me-security-row > .me-secondary-btn:hover {
  border-color: #558d88;
  background: #eff8f6;
}

#pg-creator .me-security-row > .me-secondary-btn:focus-visible {
  outline: 2px solid var(--action-focus);
  outline-offset: 3px;
}

#pg-detail .detail--editorial :is(.d-fav-btn, .d-share-btn) {
  min-height: var(--action-inline);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
}

#pg-detail .detail--editorial .d-linkrow .big-btn {
  min-height: var(--action-standard);
}

#pg-detail .hardware-detail-actions > :is(a, button):not(.hardware-primary-action),
#pg-detail .flight-tool-actions > a:not(.flight-tool-primary) {
  min-height: var(--action-compact);
  padding-block: 4px;
  font-size: 12px;
  line-height: 1.35;
}

#pg-detail .detail--editorial #d-check-desktop {
  min-height: var(--action-standard);
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
}

#pg-detail .detail--editorial :is(#d-run-btn, #d-bind-desktop, #d-read-btn) {
  min-height: 46px;
  font-size: 14px;
  font-weight: 650;
}

#discover-browse-all.bbtn {
  min-height: var(--action-prominent);
  padding-inline: 17px;
  font-weight: 600;
}

#pg-points .points-panel-heading > .points-text-action,
#pg-points .points-state-help button {
  min-height: var(--action-compact);
  font-size: 12px;
  line-height: 1.35;
}

#pg-ai .cloud-workbench .cloud-workbench-actions > button {
  margin-inline: 0;
  background: transparent;
}

#pg-ai .cloud-workbench-actions > :is([data-cloud-refresh], [data-toolbar-lab]) {
  border-color: transparent;
  color: #17666b;
}

#pg-ai .cloud-workbench-actions > :is([data-toolbar-end], [data-toolbar-unbind]),
#assigned-desktop .wuying-tools > [data-cloud-end] {
  border-color: #e3c6c8;
  color: #9b393f;
}

#pg-ai .cloud-workbench-actions > :is([data-toolbar-end], [data-toolbar-unbind]):hover:not(:disabled),
#assigned-desktop .wuying-tools > [data-cloud-end]:hover:not(:disabled) {
  border-color: #cc9398;
  background: #fff2f2;
}

#pg-ai .cloud-desktop-main:has(.cloud-welcome .cloud-device-art) [data-cloud-bind] {
  border-color: #087b77;
  background: #087b77;
  color: #fff;
}

#pg-ai .cloud-desktop-main:has(.cloud-welcome .cloud-device-art) [data-cloud-bind]:hover {
  border-color: #056561;
  background: #056561;
}

#assigned-desktop .wuying-tools > :is([data-cloud-home], [data-cloud-full], [data-cloud-recover]):not([hidden]) {
  border-color: transparent;
  background: transparent;
}

#assigned-desktop .wuying-tools > :is([data-cloud-home], [data-cloud-full], [data-cloud-recover]):hover {
  border-color: #c3d7d4;
  background: #edf5f2;
}

#pg-sim.lab-v3.lab-refined .lab-actions {
  align-items: center;
  flex-wrap: wrap;
}

#pg-sim.lab-v3.lab-refined .lab-actions > button.lab-btn:not([hidden]),
#pg-sim.lab-v3.lab-refined .lab-actions > .lab-more > summary.lab-btn {
  min-height: var(--action-standard);
  height: auto;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

#pg-sim.lab-v3.lab-refined .lab-actions > .lab-more > summary {
  border-color: transparent;
  background: transparent;
}

#pg-sim.lab-v3.lab-refined .lab-actions > .lab-more > summary:hover {
  border-color: #d5e4e6;
  background: #edf5f5;
}

#pg-sim.lab-v3.lab-refined .lab-actions > #sim-stop-btn {
  background: transparent;
}

#pg-sim.lab-v3.lab-refined .lab-actions > #sim-stop-btn:hover:not(:disabled) {
  background: #fff0ef;
}

/* Align labels without baseline offsets. Enlarge the control itself on touch. */
@media (pointer: coarse) {
  :root {
    --action-prominent: 46px;
    --action-hero: 44px;
    --action-standard: 44px;
    --action-form: 44px;
    --action-compact: 44px;
    --action-inline: 44px;
  }

  #pg-creator .me-security-row > .me-security-action::after {
    content: none;
  }

  #pg-ai .cloud-workbench .cloud-workbench-actions,
  #pg-sim.lab-v3.lab-refined .lab-actions,
  #pg-sim .lab-observer .ob-actions {
    gap: var(--action-touch-gap);
  }
}
