.alerts-page .alerts-panel {
  margin-top: 14px;
}

.alerts-panel__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin: 0 0 8px;
}

.alerts-panel__heading {
  margin: 0;
  font-size: var(--type-page);
  font-weight: 700;
  line-height: 1.3;
}

.alerts-panel__counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.alerts-panel__count {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 400;
}

.alerts-panel__count.is-on {
  color: var(--accent-bright);
}

.alerts-panel__list {
  margin: 0;
}

.alert-item {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.alert-item:first-child {
  border-top: 0;
}

.alert-item__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .875rem;
}

.alert-item__name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.5;
}

.alert-item__name .bell {
  margin-right: 3px;
}

.alert-item__name .ptag {
  margin-left: 2px;
  font-size: .75rem;
  font-weight: 500;
}

/* Colour, size and the 44px target come from the shared link rule. */
.alert-item__edit {
  flex: none;
  font-weight: 400;
  white-space: nowrap;
}

.alert-item__paused,
.alert-item__condition,
.alert-item__send {
  margin: 3px 0 0;
  font-size: .75rem;
  line-height: 1.5;
}

.alert-item__paused,
.alert-item__condition {
  color: var(--ink-soft);
}

.alert-item__send {
  color: var(--muted);
}

/* Inactive on free is a paused state, not a warning, so it stays neutral. */
.alert-item[data-alert-status="retained"] .alert-item__name {
  color: var(--ink-soft);
  font-weight: 600;
}

.alert-item[data-alert-status="retained"] .bell {
  color: var(--muted);
}

.alert-item[data-alert-status="retained"] .bell path {
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.3;
}

.alert-item[data-alert-status="retained"] .alert-item__edit {
  color: var(--muted);
}

.alerts-panel__new,
.alerts-panel__offer {
  margin-top: 8px;
}

.alerts-panel__new[hidden] {
  display: none;
}

.alerts-panel__no-favorites {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: .75rem;
}

.alerts-panel__no-favorites[hidden] {
  display: none;
}

.alerts-panel__delivery .panel__label {
  color: var(--ink-soft);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.5;
}

.alerts-panel__delivery .panel__footnote {
  color: var(--ink-soft);
  font-size: .75rem;
}

.delivery-field {
  display: flex;
  min-height: 56px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.push-delivery .delivery-field {
  align-items: flex-start;
  padding: 7px 0;
}

.delivery-field__copy {
  min-width: 0;
  flex: 1 1 130px;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.delivery-field__copy small {
  display: block;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 400;
}

.push-delivery__checking {
  color: var(--ink-soft);
}

.push-delivery__skeleton {
  display: inline-block;
  width: 12ch;
  height: 6px;
  border-radius: 4px;
  background: var(--line);
}

.push-delivery__note {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: .75rem;
  line-height: 1.5;
}

.push-delivery__note--warn {
  border: 1px solid var(--grade-b);
  background: color-mix(in srgb, var(--grade-b) 10%, transparent);
}

.push-delivery__note--bad {
  border: 1px solid var(--grade-c);
  background: color-mix(in srgb, var(--grade-c) 10%, transparent);
}

/* The state word pairs with its switch more tightly than the row's 12px gap. */
.delivery-field__control {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

/* Three characters wide, so flipping On and Off doesn't rewrap the copy. */
.delivery-field__control [data-switch-state] {
  min-width: 3ch;
  color: var(--ink-soft);
  font-size: .75rem;
}

/* Status lines keep the section's 12px rhythm between controls. */
.alerts-panel__delivery .notice {
  margin: 12px 0;
}

/* The button is the 44px target, with the visible track and knob drawn inside it. */
.delivery-switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
}

.delivery-switch::before {
  position: absolute;
  top: 12px;
  left: 5px;
  box-sizing: border-box;
  width: 34px;
  height: 19px;
  border: 1px solid var(--control-edge);
  border-radius: 999px;
  background: var(--bg);
  content: "";
}

.delivery-switch::after {
  position: absolute;
  top: 15px;
  left: 8px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}

.delivery-switch.is-on::before {
  border-color: var(--accent);
  background: var(--raised);
}

.delivery-switch.is-on::after {
  left: 23px;
  background: var(--accent-bright);
}

.delivery-switch.is-off-hard {
  opacity: 0.35;
}

.delivery-switch--checking::before {
  background: var(--line);
}

.delivery-switch--checking::after {
  content: none;
}

@media (forced-colors: active) {
  .delivery-switch::after {
    background: ButtonText;
  }
}

.alerts-panel__sign-out {
  margin-top: 14px;
  text-align: center;
}

.alerts-panel__sign-out-button {
  min-height: 44px;
  padding: 5px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .75rem;
  text-decoration: underline;
  cursor: pointer;
}
