/* Canvas < reading surface < foreground, shared by both themes. */
/* Nested surfaces use the foreground tone even when a component is reused. */
:is(
  .panel, .character-overview>[data-overview-group], .play-resources,
  .discipline-step>details, .discipline-stage, .wizard-field,
  .wiki-topic, .wiki-index, .price-category, .price-index, .sheet-panel,
  .creation-choice-preview, .creation-summary, .roster-card, .talent-category,
  .change-location, .overlay
) :where(
  .panel, .form-field, .value-card, .armor-card, .personal-weapon-card, .weapon-profile, .druid-form,
  .ability-text, .discipline-branches>*, .fate-choice, .fate-path, .fate-pick,
  .ancestry-root, .ancestry-attributes>div, .ancestry-traits>li, .ancestry-tree>li,
  .creation-attribute-facts>div, .creation-natural-ability,
  .wiki-article-link, .learning-card, .osteo-target, .wallet-coin,
  .weapon-choice, .roster-private-note, .rune-weapon, .rune-receipt,
  .bleeding-dice li, .illusion-bonuses, .illusion-image, .change-after,
  .team-equipment-card
):not(:where(.gain-bonus, .discipline-owned-form, .discipline-intro, .learning-card-unavailable, [aria-current], [aria-selected=true])) {
  background:var(--raised);
  box-shadow:var(--surface-shadow);
}

/* These are foreground pieces even without an enclosing card. */
.discipline-branches>:not(:where(.gain-bonus, .discipline-owned-form, .discipline-intro)), .druid-form,
.ancestry-traits>li, .ancestry-tree>li,
.creation-attribute-facts>div, .creation-natural-ability {
  background:var(--raised);
  box-shadow:var(--surface-shadow);
}

/* Overlays and menus sit above the page's reading surfaces. */
.overlay, .theme-menu>div, .character-action-links, .talent-menu>div,
.forge-mobile-budget, .skip:focus {
  background:var(--raised);
  box-shadow:var(--surface-shadow);
}

.inventory-slot {background:var(--raised);}

/* A personal weapon has one shared profile/description surface. */
.personal-weapon-card>.weapon-profile {background:transparent;box-shadow:none;}

/* Ability headings and flavor text sit below their inset rule passages. */
.discipline-branches>:is(.discipline-ability,.learned-profile,.gain-rule):has(.ability-text) {
  background:var(--surface);
}
:is(.discipline-ability,.learned-profile,.gain-rule) .ability-text {
  background:var(--raised);
}

@media (forced-colors:active) {
  .overlay, .theme-menu>div, .character-action-links,
  .discipline-branches>* {box-shadow:none;}
}
