:host(:not(:is([hydrated], .hydrated))) {
  @apply not-hydrated;
}


mds-separator {
  &:not(:is([hydrated], .hydrated)) {
    @apply not-hydrated;
  }
}


/**
 * @prop --mds-price-table-list-separator-color: Color of the separator line in the price table list.
 */

:host {
  --mds-price-table-list-separator-color: rgb(var(--magma-text-muted, var(--text-neutral-muted, 73 73 73)) / 0.5);
  --mds-price-table-list-transition-duration: var(--duration-200, 200ms);
  --private-price-table-list-transition-duration: var(--mds-price-table-list-transition-duration);

  @apply ease-in-out;

  background-color: rgb(var(--label-green-10, 201 248 218));
  border-radius: var(--magma-radius-xl, var(--radius-squircle-xl, 36px));
  corner-shape: var(--magma-corner-shape, squircle);
  display: grid;
  gap: --spacing(600);
  padding: --spacing(600);
  transition-duration: var(--private-price-table-list-transition-duration);
  transition-property: background-color, color;
}

.separator {
  @apply ease-in-out;

  background-color: var(--mds-price-table-list-separator-color, rgb(var(--magma-text-muted, var(--text-neutral-muted, 73 73 73)) / 0.5));
  transition-duration: var(--private-price-table-list-transition-duration);
  transition-property: background-color;
}

.header {
  display: grid;
}

.main {
  display: grid;
  gap: --spacing(300);
}

.footer {
  display: grid;
  gap: --spacing(400);
}

/* Motion, held back.
 *
 * Every component zeroes the private durations its own base CSS reads, which composes
 * with the public knobs - but that only reaches the declarations that read them. An audit
 * of the 52 sheets found 21 transitions in 15 components that did not: the host's own
 * transition in mds-button and mds-table, the focus ring of the input family, the tab
 * slider, the close button of mds-note. This reset reaches the whole shadow tree, which is
 * what the preference promises, and keeps reaching it when a declaration is added.
 *
 * Transitions only, on purpose. A keyframe animation is usually a loader, and a loader has
 * to keep saying "working": mds-spinner slows to 8s under reduced motion instead of
 * freezing, and a duration of nearly zero on an infinite animation would spin it out of
 * control instead of stopping it.
 *
 * 0.01ms rather than 0s, so a component that waits for its own transitionend still gets
 * one: mds-modal, mds-push-notification and mds-tree-item all listen for it, and a
 * transition of zero never fires it. */

/* stylelint-disable time-min-milliseconds -- the floor is there to keep a transition
   perceivable; the point of these two is that it is not. */

:host([pref-animation='reduce']),
:host([pref-animation='reduce']) *,
:host([pref-animation='reduce']) *::before,
:host([pref-animation='reduce']) *::after {
  transition-duration: 0.01ms !important;
}

@media (prefers-reduced-motion: reduce) {
  :host([pref-animation='system']),
  :host([pref-animation='system']) *,
  :host([pref-animation='system']) *::before,
  :host([pref-animation='system']) *::after,
  :host(:not([pref-animation])),
  :host(:not([pref-animation])) *,
  :host(:not([pref-animation])) *::before,
  :host(:not([pref-animation])) *::after {
    transition-duration: 0.01ms !important;
  }
}

/* stylelint-enable time-min-milliseconds */


/* Animation preference. The component mirrors the resolved mode from <html>
 * onto its host as pref-animation (see subscribePreference in @common/preference);
 * these plain shadow selectors then zero the private duration(s) the base CSS
 * reads. `reduce` always stops; `system` and no controller follow the OS via
 * @media; `no-preference` keeps the base value. Customization composes (the base
 * sets --private from the public token, this only overrides it when reduced). */

:host([pref-animation='reduce']) {
  --private-price-table-list-transition-duration: 0s;
}

@media (prefers-reduced-motion: reduce) {
  :host([pref-animation='system']),
  :host(:not([pref-animation])) {
    --private-price-table-list-transition-duration: 0s;
  }
}

/* Theme preference. The component reflects the resolved theme mode and scheme
 * from <html> onto its host as pref-mode + pref-theme-scheme (see
 * subscribePreference in @common/preference); these plain shadow selectors refine
 * for dark. `dark` is the explicit choice; `system` and no controller follow the
 * OS via @media; the scheme axis gates it. Cross-browser, no :host-context. */

:host([pref-mode='dark']:not([pref-theme-scheme='light'])),
:host([pref-theme-scheme='dark']) {
  --mds-price-table-list-separator-color: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)) / 0.5);

  background-color: rgb(var(--label-green-09, 154 242 188));
  box-shadow: var(--shadow-ring, 0 0 0 1px rgb(var(--tone-neutral-01, 5 5 5) / 0.3));
}

@media (prefers-color-scheme: dark) {
  :host([pref-mode='system']:not([pref-theme-scheme='light'])),
  :host(:not([pref-mode]):not([pref-theme-scheme='light'])) {
    --mds-price-table-list-separator-color: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)) / 0.5);

    background-color: rgb(var(--label-green-09, 154 242 188));
    box-shadow: var(--shadow-ring, 0 0 0 1px rgb(var(--tone-neutral-01, 5 5 5) / 0.3));
  }
}

/* Contrast preference. The component reflects the resolved mode from <html> onto
 * its host as pref-contrast (see subscribePreference in @common/preference); these
 * plain shadow selectors refine for high contrast. `more` is the explicit choice;
 * `system` and no controller follow the OS via @media. Cross-browser, no :host-context. */

:host([pref-contrast='more']) {
  --mds-price-table-list-separator-color: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)) / 0.5);

  box-shadow: var(--shadow-ring-2, 0 0 0 2px rgb(var(--tone-neutral-01, 5 5 5) / 0.3)) inset;
  color: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)));
}

@media (prefers-contrast: more) {
  :host([pref-contrast='system']),
  :host(:not([pref-contrast])) {
    --mds-price-table-list-separator-color: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)) / 0.5);

    box-shadow: var(--shadow-ring-2, 0 0 0 2px rgb(var(--tone-neutral-01, 5 5 5) / 0.3)) inset;
    color: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)));
  }
}

