/**
 * YOOAdmin Dark Engine v2 — core tokens (single source of truth).
 *
 * One palette consumed by every dark layer (wp-core, compat, vendor). To keep
 * plugin/WP-core screens visually consistent with YOOAdmin-native pages, the
 * tokens DERIVE from the native --ysh-* system (the brand/theme-aware palette
 * defined in core/tokens.css) instead of hardcoding a parallel set. The literal
 * values below are fallbacks only — used when --ysh-* is not present.
 *
 * Two scopes:
 *  - :root keeps the vars defined everywhere (static fallbacks), so layers never
 *    resolve to nothing even outside the Studio Hub body.
 *  - body.yooadmin-theme-yooadmin-studio-hub re-binds them to --ysh-* (which is
 *    where those vars live and where their dark values are set), so any brand or
 *    theme customization flows through automatically.
 */

:root {
  --yp-dark-bg: #12161c;
  --yp-dark-surface: #1a1d23;
  --yp-dark-surface-raised: #22262e;
  --yp-dark-surface-sunken: #0f1216;

  --yp-dark-text: #cfd6e0;
  --yp-dark-text-muted: #9aa5b1;
  --yp-dark-text-faint: #6b7480;

  --yp-dark-border: rgba(255, 255, 255, 0.1);
  --yp-dark-border-soft: rgba(255, 255, 255, 0.06);
  --yp-dark-border-strong: rgba(255, 255, 255, 0.16);

  --yp-dark-field: #22262e;
  --yp-dark-field-border: rgba(255, 255, 255, 0.14);
  --yp-dark-field-focus: rgba(237, 169, 52, 0.55);

  --yp-dark-accent: var(--yooadmin-primary, #eda934);
  --yp-dark-accent-contrast: #1a1207;

  --yp-dark-link: #7db4ff;
  --yp-dark-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --yp-dark-radius: 12px;
}

/* Bind to the native YOOAdmin token palette where it exists, so plugin/WP-core
   dark surfaces match the rest of the admin exactly. Fallbacks preserve the
   original values if a --ysh-* token is ever missing. */
body.yooadmin-theme-yooadmin-studio-hub {
  --yp-dark-bg: var(--ysh-surface, #12161c);
  --yp-dark-surface: var(--ysh-card, #1a1d23);
  /* Keep a distinct elevated surface (native --ysh-card-raised == --ysh-card). */
  --yp-dark-surface-raised: color-mix(in srgb, var(--ysh-card, #1a1d23) 86%, #ffffff 14%);
  --yp-dark-surface-sunken: var(--ysh-surface, #0f1216);

  --yp-dark-text: var(--ysh-text, #cfd6e0);
  --yp-dark-text-muted: var(--ysh-muted, #9aa5b1);
  --yp-dark-text-faint: var(--ysh-text-faint, #6b7480);

  --yp-dark-border: var(--ysh-border, rgba(255, 255, 255, 0.1));
  --yp-dark-border-soft: var(--ysh-border-subtle, rgba(255, 255, 255, 0.06));

  --yp-dark-accent: var(--ysh-brand, var(--yooadmin-primary, #eda934));

  --yp-dark-radius: var(--ysh-radius, 12px);
}
