/**
 * YOOAdmin Dark Engine v2 — embedded dashboard widgets (third-party plugin output).
 *
 * Layer 2 only: scoped to `.yp-studio-widget-section__inner` on Studio Hub dashboard.
 * No adaptive JS on this screen — CSS tokens + targeted vendor overrides.
 */

html[data-yooadmin-studio-color-mode-effective='dark']
  body.yp-dark-v2-dashboard
  .yp-studio-widget-section__inner {
  color: var(--yp-dark-text);
}

html[data-yooadmin-studio-color-mode-effective='dark']
  body.yp-dark-v2-dashboard
  .yp-studio-widget-section__inner
  :is(.card, .postbox, .stuffbox, .inside, fieldset, table, .widefat) {
  background: var(--yp-dark-surface) !important;
  border-color: var(--yp-dark-border);
  color: var(--yp-dark-text);
}

html[data-yooadmin-studio-color-mode-effective='dark']
  body.yp-dark-v2-dashboard
  .yp-studio-widget-section__inner
  :is(h1, h2, h3, h4, h5, h6, p, li, td, th, label, span, a) {
  color: var(--yp-dark-text);
}

html[data-yooadmin-studio-color-mode-effective='dark']
  body.yp-dark-v2-dashboard
  .yp-studio-widget-section__inner
  :is(h2, h3, h4) {
  background: transparent !important;
  border-color: var(--yp-dark-border);
}

html[data-yooadmin-studio-color-mode-effective='dark']
  body.yp-dark-v2-dashboard
  .yp-studio-widget-section__inner
  :is(.description, .howto, small, .subsubsub) {
  color: var(--yp-dark-text-muted);
}

html[data-yooadmin-studio-color-mode-effective='dark']
  body.yp-dark-v2-dashboard
  .yp-studio-widget-section__inner
  a:not(.button):not(.button-primary) {
  color: var(--yp-dark-link, var(--yp-dark-accent));
}

/* Plugin shells embedded in dashboard widget sections (pattern-based). */
html[data-yooadmin-studio-color-mode-effective='dark']
  body.yp-dark-v2-dashboard
  .yp-studio-widget-section__inner
  :is(
    [id*='plugin-container'],
    [class*='-snapshot'],
    [class*='-card'],
    [class*='-box']
  ):not([class^='yp-']):not([class*=' yp-']) {
  background: var(--yp-dark-surface) !important;
  border-color: var(--yp-dark-border) !important;
  color: var(--yp-dark-text);
}

html[data-yooadmin-studio-color-mode-effective='dark']
  body.yp-dark-v2-dashboard
  .yp-studio-widget-section__inner
  :is([class*='section-header'], [class*='__header']) {
  background: transparent !important;
  box-shadow: none !important;
}

html[data-yooadmin-studio-color-mode-effective='dark']
  body.yp-dark-v2-dashboard
  .yp-studio-widget-section__inner
  :is(h1, h2, h3, h4, h5, h6)[class*='__header'] {
  background: none !important;
  color: var(--yp-dark-text-muted) !important;
}

html[data-yooadmin-studio-color-mode-effective='dark']
  body.yp-dark-v2-dashboard
  .yp-studio-widget-section__inner
  [class*='__chart']:not([class^='yp-']):not([class*=' yp-']) {
  background: var(--yp-dark-surface-sunken) !important;
  border: 1px solid var(--yp-dark-border) !important;
  border-radius: var(--yp-dark-radius, 8px);
  box-shadow: none !important;
  overflow: hidden;
}

html[data-yooadmin-studio-color-mode-effective='dark']
  body.yp-dark-v2-dashboard
  .yp-studio-widget-section__inner
  [class*='__chart']:has(iframe) iframe {
  filter: invert(1) hue-rotate(180deg);
  background: #fff;
}
