/*
 * Final button contrast guard.
 *
 * Feature stylesheets intentionally load after the base theme.  Without an
 * explicit final color, buttons can inherit the color of a dark panel (or an
 * iOS native control), leaving their label and icon effectively invisible.
 */
:where(.primary-button, .secondary-button, .ghost-button, .danger-button) {
  -webkit-appearance: none;
  appearance: none;
  text-decoration: none;
  opacity: 1;
  -webkit-text-fill-color: currentColor;
}

:where(.primary-button, .secondary-button, .ghost-button, .danger-button) :where(span, strong, small, svg, path) {
  color: inherit;
  -webkit-text-fill-color: currentColor;
}

:where(.primary-button, .secondary-button, .ghost-button, .danger-button) svg {
  fill: none;
  stroke: currentColor;
}

/* Light work surfaces. */
.primary-button {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  background-color: #087f7a;
}

.secondary-button {
  color: #102f4c;
  -webkit-text-fill-color: #102f4c;
  background-color: #ffffff;
  border-color: #a9c0d2;
}

.ghost-button {
  color: #075f70;
  -webkit-text-fill-color: #075f70;
}

.danger-button {
  color: #982f27;
  -webkit-text-fill-color: #982f27;
  background-color: #fff4f1;
  border-color: #e7aaa3;
}

:where(.primary-button, .secondary-button, .ghost-button, .danger-button):focus-visible {
  outline: 3px solid #25c9d6;
  outline-offset: 3px;
}

.secondary-button:hover,
.secondary-button:active,
.ghost-button:hover,
.ghost-button:active {
  color: #083a55;
  -webkit-text-fill-color: #083a55;
}

.danger-button:hover,
.danger-button:active {
  color: #79241e;
  -webkit-text-fill-color: #79241e;
  background-color: #ffe4df;
}

/* Paradise OS uses a bright aqua primary action with intentionally dark text. */
.paradise-os .primary-button {
  color: #021b2c;
  -webkit-text-fill-color: #021b2c;
}

.paradise-os :where(.secondary-button, .ghost-button) {
  color: #173654 !important;
  -webkit-text-fill-color: #173654;
}

/* Cleaner workspace keeps its controls on the dark portal canvas. */
.employee-shell .primary-button {
  color: #02111f;
  -webkit-text-fill-color: #02111f;
}

.employee-shell :where(.secondary-button, .ghost-button) {
  color: #f5f9ff;
  -webkit-text-fill-color: #f5f9ff;
  background-color: #0b2944;
  border-color: #3d6683;
}

.employee-shell :where(.secondary-button, .ghost-button):hover,
.employee-shell :where(.secondary-button, .ghost-button):active {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  background-color: #123b5d;
  border-color: #40d4df;
}

/* Disabled actions remain legible instead of fading into their card. */
:where(.primary-button, .secondary-button, .ghost-button, .danger-button):disabled,
:where(.primary-button, .secondary-button, .ghost-button, .danger-button)[aria-disabled="true"] {
  color: #526576 !important;
  -webkit-text-fill-color: #526576;
  background: #e7edf1 !important;
  border-color: #bdcbd5 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  opacity: 1;
}

.employee-shell :where(.primary-button, .secondary-button, .ghost-button, .danger-button):disabled,
.employee-shell :where(.primary-button, .secondary-button, .ghost-button, .danger-button)[aria-disabled="true"] {
  color: #b8c8d6 !important;
  -webkit-text-fill-color: #b8c8d6;
  background: #20364b !important;
  border-color: #49637a !important;
}

@media (forced-colors: active) {
  :where(.primary-button, .secondary-button, .ghost-button, .danger-button) {
    border: 2px solid ButtonText;
  }
}
