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


mds-avatar,
mds-button,
mds-img,
mds-text {
  &:not(:is([hydrated], .hydrated)) {
    @apply not-hydrated;
  }
}


/**
 * @prop --mds-push-notification-item-duration: Duration of the individual push notification item animation.
 * @prop --mds-push-notification-item-icon-background-color: Background color of the item's icon.
 * @prop --mds-push-notification-item-icon-color: Color of the item's icon.
 * @prop --mds-push-notification-item-message-line-clamp: Public. Number of lines to clamp the message text.
 * @prop --mds-push-notification-item-shadow: Public. Shadow applied to the push notification item.
 * @prop --mds-push-notification-item-subject-line-clamp: Public. Number of lines to clamp the subject text.
 * @prop --mds-push-notification-item-timing-function: Timing function used for the item animation.
 */

/* ❌ Not supported
@property --mds-push-notification-item-shadow {
  inherits: false;
  initial-value: var(--shadow);
  syntax: "<box-shadow>";
}

@property --mds-push-notification-item-timing-function {
  inherits: false;
  initial-value: var(--ease-in-out-quint);
  syntax: "<timing-function>";
}
*/

:host {
  --mds-push-notification-item-duration: var(--duration-300, 300ms);
  --private-push-notification-item-duration: var(--mds-push-notification-item-duration, var(--duration-300, 300ms));
  --mds-push-notification-item-icon-background-color: transparent;
  --mds-push-notification-item-icon-color: rgb(var(--magma-text-subtle, var(--text-neutral-subtle, 99 99 99)));
  --mds-push-notification-item-message-line-clamp: 2;
  --mds-push-notification-item-shadow: var(--shadow-sm-sharp, 0 0 1px 1px rgb(0 0 0 / 0.06), 0 1px 3px 0 rgb(0 0 0 / 0.1));
  --mds-push-notification-item-subject-line-clamp: 1;
  --mds-push-notification-item-timing-function: var(--ease-in-out-quint, cubic-bezier(0.86, 0, 0.07, 1));

  align-items: flex-start;
  background-color: rgb(var(--magma-surface-overlay, var(--surface-neutral-overlay, 255 255 255)));
  border-radius: var(--magma-radius-lg, var(--radius-squircle-lg, 28px));
  box-shadow: var(--mds-push-notification-item-shadow);
  color: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)));
  corner-shape: var(--magma-corner-shape, squircle);
  display: flex;
  gap: --spacing(400);
  max-width: --spacing(8000);
  min-width: --spacing(7200);
  padding: --spacing(400);
  pointer-events: auto;
  position: relative;
  transition-duration: var(--private-push-notification-item-duration);
  transition-property: background-color, box-shadow, color, margin, transform;
  transition-timing-function: var(--mds-push-notification-item-timing-function);
}

:host([dismissible]:not([dismissible='false'])),
:host([deletable]:not([deletable='false'])) {
  @apply pr-800;
}

.content {
  display: grid;
  flex-grow: 1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: --spacing(200);
  min-width: 1px;
  padding-top: --spacing(200);
}

.actions--hidden,
.badge--hidden {
  display: none;
}

.avatar,
.picture {
  flex-shrink: 0;
}

.picture {
  border-radius: var(--magma-radius-3xs, var(--radius-squircle-3xs, 6px));
  box-shadow: var(--shadow-sm-sharp, 0 0 1px 1px rgb(0 0 0 / 0.06), 0 1px 3px 0 rgb(0 0 0 / 0.1));
  corner-shape: var(--magma-corner-shape, squircle);
  max-width: --spacing(1200);
  width: 100%;
}

.close-button {
  @apply transition-cosmetic;

  opacity: 0;
  padding: --spacing(150);
  position: absolute;
  right: 0;
  top: 0;
}

:host(:hover) .close-button {
  opacity: 1;
}

.close-button:focus-visible,
.close-button:hover {
  fill: rgb(var(--magma-text-muted, var(--text-neutral-muted, 73 73 73)));
  opacity: 1;
}

.header {
  align-items: baseline;
  display: flex;
  gap: --spacing(100);
  justify-content: space-between;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.infos {
  display: flex;
  flex-direction: column;
}

.time {
  flex-shrink: 0;
  margin-right: --spacing(100);
  white-space: nowrap;
}

.subject {
  --mds-text-line-clamp: var(--mds-push-notification-item-subject-line-clamp, 1);

  line-height: var(--leading-sm, 1.25rem);
  text-overflow: ellipsis;
}

.message {
  --mds-text-line-clamp: var(--mds-push-notification-item-message-line-clamp, 2);

  text-overflow: ellipsis;
}

.avatar {
  background-color: var(--mds-push-notification-item-icon-background-color, transparent);
  border-radius: var(--magma-radius-full, var(--radius-full, 1000px));
  fill: var(--mds-push-notification-item-icon-color, rgb(var(--magma-text-subtle, var(--text-neutral-subtle, 99 99 99))));
  height: --spacing(900);
  width: --spacing(900);
}

.avatar::part(svg) {
  width: --spacing(600);
}

:host([src]) .avatar {
  background-color: transparent;
}

:host([icon]) .avatar::part(wrapper) {
  padding: --spacing(150);
}

/* 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-push-notification-item-duration: 0s;
}

@media (prefers-reduced-motion: reduce) {
  :host([pref-animation='system']),
  :host(:not([pref-animation])) {
    --private-push-notification-item-duration: 0s;
  }
}

/* Theme preference. Background and elevation now come from the semantic surface
 * layer (--magma-surface-*, spec 6.1): it flips per mode at :root and inherits
 * into the shadow DOM, so this component needs no per-mode dark refinement. The
 * former dark override (a wash background re-set plus a ring that faked elevation
 * on the old flat-black canvas) is intentionally gone. */

/* 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-push-notification-item-shadow: var(--shadow-ring-strong-2, 0 0 0 2px rgb(var(--tone-neutral-01, 5 5 5) / 0.6)) 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-push-notification-item-shadow: var(--shadow-ring-strong-2, 0 0 0 2px rgb(var(--tone-neutral-01, 5 5 5) / 0.6)) inset;

    color: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)));
  }
}

:host([variant='primary'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--magma-accent-fg, var(--variant-primary-03, 0 73 211)));
  --mds-push-notification-item-icon-color: rgb(var(--magma-accent-surface-subtle, var(--variant-primary-10, 231 237 248)));
}

:host([variant='primary']),
:host([variant='primary'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--magma-accent-surface, var(--variant-primary-09, 213 224 245)));
  --mds-push-notification-item-icon-color: rgb(var(--magma-accent-fg, var(--variant-primary-03, 0 73 211)));
}

:host([variant='orange'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-orange-05, 208 95 16));
  --mds-push-notification-item-icon-color: rgb(var(--label-orange-10, 255 233 222));
}

:host([variant='orange']),
:host([variant='orange'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-orange-09, 255 215 194));
  --mds-push-notification-item-icon-color: rgb(var(--label-orange-05, 208 95 16));
}

:host([variant='amaranth'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-amaranth-05, 232 60 89));
  --mds-push-notification-item-icon-color: rgb(var(--label-amaranth-10, 255 232 233));
}

:host([variant='amaranth']),
:host([variant='amaranth'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-amaranth-09, 255 214 215));
  --mds-push-notification-item-icon-color: rgb(var(--label-amaranth-05, 232 60 89));
}

:host([variant='orchid'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-orchid-05, 225 60 143));
  --mds-push-notification-item-icon-color: rgb(var(--label-orchid-10, 255 231 240));
}

:host([variant='orchid']),
:host([variant='orchid'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-orchid-09, 255 212 229));
  --mds-push-notification-item-icon-color: rgb(var(--label-orchid-05, 225 60 143));
}

:host([variant='purple'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-purple-05, 168 86 247));
  --mds-push-notification-item-icon-color: rgb(var(--label-purple-10, 243 233 255));
}

:host([variant='purple']),
:host([variant='purple'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-purple-09, 233 217 255));
  --mds-push-notification-item-icon-color: rgb(var(--label-purple-05, 168 86 247));
}

:host([variant='red'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-red-05, 230 66 66));
  --mds-push-notification-item-icon-color: rgb(var(--label-red-10, 252 233 233));
}

:host([variant='red']),
:host([variant='red'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-red-09, 250 215 215));
  --mds-push-notification-item-icon-color: rgb(var(--label-red-05, 230 66 66));
}

:host([variant='violet'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-violet-05, 143 101 247));
  --mds-push-notification-item-icon-color: rgb(var(--label-violet-10, 238 235 255));
}

:host([variant='violet']),
:host([variant='violet'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-violet-09, 225 219 255));
  --mds-push-notification-item-icon-color: rgb(var(--label-violet-05, 143 101 247));
}

:host([variant='blue'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-blue-05, 69 120 254));
  --mds-push-notification-item-icon-color: rgb(var(--label-blue-10, 228 238 255));
}

:host([variant='blue']),
:host([variant='blue'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-blue-09, 209 224 254));
  --mds-push-notification-item-icon-color: rgb(var(--label-blue-05, 69 120 254));
}

:host([variant='sky'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-sky-05, 10 137 194));
  --mds-push-notification-item-icon-color: rgb(var(--label-sky-10, 222 240 252));
}

:host([variant='sky']),
:host([variant='sky'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-sky-09, 196 229 250));
  --mds-push-notification-item-icon-color: rgb(var(--label-sky-05, 10 137 194));
}

:host([variant='aqua'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-aqua-05, 5 141 165));
  --mds-push-notification-item-icon-color: rgb(var(--label-aqua-10, 199 245 253));
}

:host([variant='aqua']),
:host([variant='aqua'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-aqua-09, 151 237 252));
  --mds-push-notification-item-icon-color: rgb(var(--label-aqua-05, 5 141 165));
}

:host([variant='green'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-green-05, 26 148 71));
  --mds-push-notification-item-icon-color: rgb(var(--label-green-10, 201 248 218));
}

:host([variant='green']),
:host([variant='green'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-green-09, 154 242 188));
  --mds-push-notification-item-icon-color: rgb(var(--label-green-05, 26 148 71));
}

:host([variant='lime'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-lime-05, 93 143 15));
  --mds-push-notification-item-icon-color: rgb(var(--label-lime-10, 214 249 159));
}

:host([variant='lime']),
:host([variant='lime'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-lime-09, 186 240 97));
  --mds-push-notification-item-icon-color: rgb(var(--label-lime-05, 93 143 15));
}

:host([variant='yellow'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-yellow-05, 161 124 22));
  --mds-push-notification-item-icon-color: rgb(var(--label-yellow-10, 255 235 200));
}

:host([variant='yellow']),
:host([variant='yellow'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--label-yellow-09, 254 219 157));
  --mds-push-notification-item-icon-color: rgb(var(--label-yellow-05, 161 124 22));
}

:host([variant='error'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--magma-danger-emphasis, var(--status-error-04, 196 64 65)));
  --mds-push-notification-item-icon-color: rgb(var(--magma-danger-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='error']),
:host([variant='error'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--magma-danger-wash-base, var(--status-error-09, 255 214 211)));
  --mds-push-notification-item-icon-color: rgb(var(--magma-danger-text-default, var(--text-error-default, 89 0 0)));
}

:host([variant='warning'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--magma-warning-emphasis, var(--status-warning-04, 142 106 0)));
  --mds-push-notification-item-icon-color: rgb(var(--magma-warning-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='warning']),
:host([variant='warning'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--magma-warning-wash-base, var(--status-warning-09, 255 220 117)));
  --mds-push-notification-item-icon-color: rgb(var(--magma-warning-text-default, var(--text-warning-default, 58 44 0)));
}

:host([variant='success'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--magma-success-emphasis, var(--status-success-04, 0 128 57)));
  --mds-push-notification-item-icon-color: rgb(var(--magma-success-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='success']),
:host([variant='success'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--magma-success-wash-base, var(--status-success-09, 191 233 205)));
  --mds-push-notification-item-icon-color: rgb(var(--magma-success-text-default, var(--text-success-default, 0 53 0)));
}

:host([variant='info'][tone='strong']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--magma-info-emphasis, var(--status-info-04, 0 119 164)));
  --mds-push-notification-item-icon-color: rgb(var(--magma-info-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
}

:host([variant='info']),
:host([variant='info'][tone='weak']) {
  --mds-push-notification-item-icon-background-color: rgb(var(--magma-info-wash-base, var(--status-info-09, 193 230 246)));
  --mds-push-notification-item-icon-color: rgb(var(--magma-info-text-default, var(--text-info-default, 0 45 86)));
}

