/* Shared presentation only: never infer numbers/status from arbitrary user text.
   Pages marked data-original-page-style keep their component styles inside the
   marked content only; navigation and dialogs outside it keep this theme. */
/* Defaults sit below every existing component stylesheet, even when this file
   loads last. A semantic action attribute must not repaint an existing button. */
@layer action-defaults {
  :where([data-ui-action]):where(:not([data-original-page-style] *)):where(:not(
      .primary, .gradient, .primary-mini, .community-primary, .auth-login-submit,
      .recharge-pay-button, .secondary, .outline-button, .mini-button,
      .danger, .is-danger, .team-button-danger, .delete-result)) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    max-width: 100%;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid #394451;
    border-radius: 8px;
    background: #19212b;
    color: #e3e9f0;
    font: inherit;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
  }
  :where([data-ui-action=secondary]) {
    background: #141920;
    border-color: #303844;
    color: #b7c2cf;
  }
  :where([data-ui-action=danger]) {
    background: #291c23;
    border-color: #70404a;
    color: #f0a0ac;
  }
  :where([data-ui-action]):not(:disabled):not([aria-disabled=true]):hover {
    background: #232e3b;
    border-color: var(--site-theme-primary);
  }
  :where([data-ui-action=danger]):not(:disabled):not([aria-disabled=true]):hover {
    background: #39222b;
    border-color: #b56474;
  }
  :where([data-ui-action]):focus-visible {
    outline: 2px solid var(--site-theme-primary);
    outline-offset: 3px;
  }
  :where([data-ui-action]):is(:disabled, [aria-disabled=true]) {
    opacity: .52;
    cursor: not-allowed;
  }
  @media (prefers-reduced-motion: reduce) {
    :where([data-ui-action]) { transition: none; }
  }
}

/* Neutral fallback overrides browser link/visited defaults without repainting
   component-specific navigation, cards, or brand colors. */
:where(a:link, a:visited):where(:not([data-original-page-style] *)) { color: inherit; }
a:any-link:where(:not([data-original-page-style] *)) { text-decoration: none !important; }
a:focus-visible:where(:not([data-original-page-style] *)) { outline: 2px solid var(--site-theme-primary); outline-offset: 3px; }

/* New classless destructive actions have no component-specific danger skin.
   Keep that meaning visible when a page has generic form-button defaults. */
button[data-ui-action=danger]:not([class]),
a[data-ui-action=danger]:not([class]) {
  background: #291c23;
  border-color: #70404a;
  color: #f0a0ac;
}

/* Only explicitly identified business values. No blanket td/strong/digit rules:
   email addresses, free text, dates, IDs and video durations remain unchanged. */
.recharge-dialog.team-credit-ui .recharge-amount-grid .ui-number,
.recharge-dialog.team-credit-ui .recharge-option-heading .ui-number {
  display: inline;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}
body :where(:not([data-original-page-style] *)):is(.ui-number, .credit-number, .ledger-amount,
    .sidebar-credit .sidebar-copy > b, .credit-summary strong, .production-streaming-stats b,
    [data-project-notes-count], [data-streaming-retry-count], [data-recharge-summary-yuan], [data-recharge-summary-credits]) {
  /* Typography only: components own available/frozen/total and signed amounts. */
  font-variant-numeric: tabular-nums;
}

body :where(:not([data-original-page-style] *)):is(.ui-status, .scene-status, .production-status-badge) {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px solid #596271 !important;
  border-radius: 999px;
  background: #252b34 !important;
  color: #cbd3de !important;
  font-size: 12px;
  font-weight: 600;
  font-style: normal;
  line-height: 1.5;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
body :where(:not([data-original-page-style] *)).scene-status:is([data-status-code=SUCCESS i]) {
  background: #103c2a !important; border-color: #2d8058 !important; color: #8aefb8 !important;
}
body :where(:not([data-original-page-style] *)).scene-status:is([data-status-code=RUNNING i], [data-status-code=QUEUED i], [data-status-code=RETRYING i]) {
  background: #453211 !important; border-color: #98702d !important; color: #ffcf80 !important;
}
body :where(:not([data-original-page-style] *)).scene-status[data-status-code=FAILED i] {
  background: #481d27 !important; border-color: #a8485b !important; color: #ffadba !important;
}
body :where(:not([data-original-page-style] *)).state-completed .production-status-badge {
  background: #103c2a !important; border-color: #2d8058 !important; color: #8aefb8 !important;
}
body :where(:not([data-original-page-style] *)).state-working .production-status-badge {
  background: #453211 !important; border-color: #98702d !important; color: #ffcf80 !important;
}
body :where(:not([data-original-page-style] *)).state-failed .production-status-badge {
  background: #481d27 !important; border-color: #a8485b !important; color: #ffadba !important;
}
body :where(:not([data-original-page-style] *)).ui-status:is([data-status=active], [data-status=success], [data-status=succeeded],
    [data-status=paid], [data-status=confirmed], [data-status=completed], [data-status=approved],
    [data-status=accepted], [data-status=published], [data-status=resolved], [data-status=credited], [data-status=settled],
    [data-status=processed], [data-status=deducted]) {
  background: #103c2a !important; border-color: #2d8058 !important; color: #8aefb8 !important;
}
body :where(:not([data-original-page-style] *)).ui-status:is([data-status=pending], [data-status=processing], [data-status=running],
    [data-status=queued], [data-status=waiting], [data-status=closing], [data-status=open],
    [data-status=unconfirmed], [data-status=held], [data-status=refunding], [data-status=reviewing],
    [data-status=removing], [data-status=authorized], [data-status=confirming], [data-status=created],
    [data-status=draft], [data-status=unknown], [data-status=retrying], [data-status=reserved], [data-status=received]) {
  background: #453211 !important; border-color: #98702d !important; color: #ffcf80 !important;
}
body :where(:not([data-original-page-style] *)).ui-status:is([data-status=failed], [data-status=error], [data-status=rejected],
    [data-status=blocked], [data-status=restricted], [data-status=abnormal]) {
  background: #481d27 !important; border-color: #a8485b !important; color: #ffadba !important;
}
@media (forced-colors: active) {
  body :where(:not([data-original-page-style] *))[data-ui-action], body :where(:not([data-original-page-style] *)).ui-status { border-color: ButtonText !important; }
}
