/**
 * The notifications sheet.
 *
 * The Preferences sheet's backdrop and card, one layer above it, because Preferences is one of the
 * doors that opens this. On a phone it rises from the bottom, where a thumb already is.
 */
atomics-push-ask {
  --ask-surface: var(--background, light-dark(#ffffff, #111111));
  --ask-ink: var(--text, light-dark(#0f0f0f, #f4f5f6));
  --ask-soft: color-mix(in srgb, var(--ask-ink), transparent 92%);
  --ask-line: color-mix(in srgb, var(--ask-ink), transparent 88%);
  --ask-on: var(--ds-accent, #2f6bff);

  display: none;
  position: fixed;
  inset: 0;
  z-index: 210;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, black, transparent 68%);
  font-size: 14px;
}

atomics-push-ask[open] {
  display: flex;
}

atomics-push-ask [sheet] {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 48px));
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 28px 24px 24px;
  border-radius: 18px;
  background: var(--ask-surface);
  border: 1px solid var(--ask-line);
  box-shadow: 0 24px 64px color-mix(in srgb, black, transparent 78%);
  color: var(--ask-ink);
}

@media (max-width: 560px) {
  atomics-push-ask {
    align-items: flex-end;
  }

  atomics-push-ask [sheet] {
    width: 100%;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

/* One part at a time, chosen by the element's `state`. */
atomics-push-ask section {
  display: none;
  flex-direction: column;
  gap: 14px;
}

atomics-push-ask[state='ask'] [part='ask'],
atomics-push-ask[state='install'] [part='install'],
atomics-push-ask[state='blocked'] [part='blocked'],
atomics-push-ask[state='choose'] [part='choose'] {
  display: flex;
}

atomics-push-ask [close] {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
}

atomics-push-ask [close]:hover {
  opacity: 1;
  background: var(--ask-soft);
}

atomics-push-ask [close] svg {
  width: 18px;
  height: 18px;
}

atomics-push-ask [badge] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--ask-soft);
}

atomics-push-ask [badge] svg {
  width: 24px;
  height: 24px;
}

atomics-push-ask [badge][app] {
  background: light-dark(#111111, #f4f5f6);
  color: light-dark(#ffffff, #111111);
}

atomics-push-ask [badge][ok] {
  border-radius: 50%;
  background: light-dark(#e7f6ee, #133524);
  color: light-dark(#14804a, #86e0b0);
}

atomics-push-ask [badge][warn] {
  background: light-dark(#fff1dc, #3d2a12);
  color: light-dark(#8a4b00, #f5c38a);
}

atomics-push-ask [headline] {
  margin: 0;
  padding-right: 32px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

atomics-push-ask [lead] {
  margin: -4px 0 0;
  line-height: 1.55;
  opacity: 0.75;
  text-wrap: pretty;
}

atomics-push-ask [points] {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  opacity: 0.8;
}

atomics-push-ask [points] li {
  position: relative;
  padding-left: 22px;
  line-height: 1.45;
}

atomics-push-ask [points] li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 4px;
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--ask-on);
  border-bottom: 2px solid var(--ask-on);
  rotate: -45deg;
}

atomics-push-ask [steps] {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  border: 1px solid var(--ask-line);
  border-radius: 12px;
}

atomics-push-ask [steps] li {
  counter-increment: step;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  line-height: 1.4;
}

atomics-push-ask [steps] li + li {
  border-top: 1px solid var(--ask-line);
}

atomics-push-ask [steps] li::before {
  content: counter(step);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ask-ink);
  color: var(--ask-surface);
  font-size: 12px;
  font-weight: 700;
}

/* The blocked help shows the steps for the browser picked in its tabs. */
atomics-push-ask [part='blocked'] [steps] {
  display: none;
}

atomics-push-ask[device='ios'] [part='blocked'] [steps][device='ios'],
atomics-push-ask[device='chrome'] [part='blocked'] [steps][device='chrome'],
atomics-push-ask[device='safari'] [part='blocked'] [steps][device='safari'],
atomics-push-ask[device='firefox'] [part='blocked'] [steps][device='firefox'] {
  display: flex;
}

atomics-push-ask [tabs] {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--ask-soft);
}

atomics-push-ask [tabs] button {
  min-height: 34px;
  padding: 0 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.7;
}

atomics-push-ask [tabs] button[aria-selected='true'] {
  background: var(--ask-surface);
  font-weight: 600;
  opacity: 1;
  box-shadow: 0 1px 2px color-mix(in srgb, black, transparent 88%);
}

atomics-push-ask [rows] {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ask-line);
  border-radius: 12px;
}

atomics-push-ask [row] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
}

atomics-push-ask [row] + [row] {
  border-top: 1px solid var(--ask-line);
}

atomics-push-ask label[row] {
  cursor: pointer;
}

atomics-push-ask [copy] {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

atomics-push-ask [label] {
  font-weight: 600;
}

atomics-push-ask [hint],
atomics-push-ask [always] {
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.6;
}

atomics-push-ask [always] {
  flex: none;
}

/* The same switch as Preferences: hollow when off, filled with the accent when on. */
atomics-push-ask input[type='checkbox'][role='switch'] {
  appearance: none;
  flex: none;
  margin: 0;
  width: 40px;
  height: 24px;
  border-radius: 100vmax;
  background: var(--ask-soft);
  border: 1px solid color-mix(in srgb, var(--ask-ink), transparent 72%);
  position: relative;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

atomics-push-ask input[type='checkbox'][role='switch']::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 100vmax;
  background: color-mix(in srgb, var(--ask-ink), transparent 40%);
  translate: 0 -50%;
  transition: left 160ms ease, background 160ms ease;
}

atomics-push-ask input[type='checkbox'][role='switch']:checked {
  background: var(--ask-on);
  border-color: var(--ask-on);
}

atomics-push-ask input[type='checkbox'][role='switch']:checked::after {
  left: 18px;
  background: #ffffff;
}

atomics-push-ask input[type='checkbox'][role='switch']:disabled {
  opacity: 0.45;
  cursor: default;
}

atomics-push-ask [issue],
atomics-push-ask [tested] {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

atomics-push-ask [issue]:empty,
atomics-push-ask [tested]:empty {
  display: none;
}

atomics-push-ask [issue] {
  color: light-dark(#a1281f, #ff9b92);
}

atomics-push-ask [actions] {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

atomics-push-ask [actions][split] {
  flex-direction: row;
}

atomics-push-ask [actions][split] button {
  flex: 1;
}

atomics-push-ask [actions] button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

atomics-push-ask [actions] [primary] {
  border: 0;
  background: var(--ask-ink);
  color: var(--ask-surface);
}

atomics-push-ask [actions] [secondary] {
  border: 1px solid color-mix(in srgb, var(--ask-ink), transparent 78%);
  background: transparent;
  color: inherit;
}

atomics-push-ask [actions] [quiet] {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 500;
  opacity: 0.7;
}

atomics-push-ask [actions] button:disabled {
  opacity: 0.5;
  cursor: default;
}

atomics-push-ask button:focus-visible {
  outline: 2px solid var(--ask-on);
  outline-offset: 2px;
}
