.ad-root {
  z-index: 1100;
}

.ad-root [hidden] {
  display: none !important;
}

#settings-drawer-backdrop.is-under-modal {
  opacity: 0;
}

.ad-modal {
  --ad-pad-x: 2.2rem;
  --ad-pad-b: 2rem;
  padding: 2.4rem var(--ad-pad-x) var(--ad-pad-b);
  scroll-padding-bottom: 5rem;
}

.ad-modal strong {
  font-weight: 700;
  color: var(--text-color);
}

.ad-why {
  height: auto;
  min-height: 7.5rem;
  padding: 0.75rem 0.875rem;
  line-height: 1.5;
  resize: vertical;
}

/* Continue stays pinned to the bottom of the pop-up on short screens. */
.ad-sticky-actions {
  position: sticky;
  /* Sticky offsets are measured inside the pop-up's padding, so pull the bar
     down by the bottom padding to sit flush with the pop-up's bottom edge. */
  bottom: calc(-1 * var(--ad-pad-b));
  z-index: 2;
  margin: 0 calc(-1 * var(--ad-pad-x)) calc(-1 * var(--ad-pad-b));
  padding: 1.1rem var(--ad-pad-x) var(--ad-pad-b);
  background: linear-gradient(
    rgba(var(--white-color-rgb), 0),
    var(--white-color) 1.1rem
  );
}

.ad-date-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(var(--danger-color-light-rgb), 0.22);
  background: linear-gradient(
    135deg,
    rgba(var(--danger-color-light-rgb), 0.06),
    var(--white-color) 60%
  );
}

.ad-cal {
  width: 52px;
  flex-shrink: 0;
  overflow: hidden;
  text-align: center;
  border-radius: 0.625rem;
  border: 1px solid rgba(var(--danger-color-light-rgb), 0.3);
  background: var(--white-color);
}

.ad-cal-mon {
  padding: 3px 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--danger-color-dark);
  background: rgba(var(--danger-color-light-rgb), 0.12);
}

.ad-cal-day {
  padding: 4px 0 6px;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-color);
}

.ad-date-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.ad-date-kicker {
  font-size: 0.75rem;
  color: var(--color-gray-500);
}

.ad-date-long {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-color);
}

.ad-date-sub {
  font-size: 0.78rem;
  color: var(--color-gray-500);
}

.ad-facts {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.ad-facts li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--color-gray-700);
}

.ad-facts svg,
.ad-facts i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--color-gray-400);
}

.ad-keep {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.1rem;
  padding: 0.9rem 1rem;
  text-align: left;
  border-radius: 0.85rem;
  border: 1px solid rgba(var(--primary-color-rgb), 0.5);
  background: rgba(var(--primary-color-rgb), 0.06);
}

.ad-keep-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9999px;
  background: rgba(var(--primary-color-rgb), 0.15);
  color: var(--primary-color-dark);
}

.ad-keep-ic svg,
.ad-keep-ic i {
  width: 16px;
  height: 16px;
}

.ad-keep-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.ad-keep-title {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-color);
}

.ad-keep-sub {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--color-gray-600);
}

.ad-keep-sub strong {
  font-weight: 600;
}

.ad-actions {
  margin-top: 1.1rem;
}

.ad-btn-danger {
  background: rgba(var(--danger-color-light-rgb), 0.9);
  color: var(--text-color);
  box-shadow:
    inset 0 1px 0 rgba(var(--white-color-rgb), 0.3),
    0 4px 14px rgba(var(--danger-color-light-rgb), 0.3);
}

.ad-btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(var(--danger-color-light-rgb), 1);
  box-shadow:
    inset 0 1px 0 rgba(var(--white-color-rgb), 0.35),
    0 8px 22px rgba(var(--danger-color-light-rgb), 0.35);
}

.ad-btn-danger:focus-visible {
  outline-color: rgba(var(--danger-color-light-rgb), 0.6);
}

.ad-note {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(var(--primary-color-rgb), 0.5);
  background: rgba(var(--primary-color-rgb), 0.05);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--color-gray-700);
}

.ad-note > svg,
.ad-note > i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--primary-color-dark);
}

.ad-note strong {
  font-weight: 600;
}

.ad-logout {
  margin-top: 1.1rem;
}

.ad-logout svg,
.ad-logout i {
  width: 17px;
  height: 17px;
}

@media (max-width: 480px) {
  .ad-modal {
    --ad-pad-x: 1.4rem;
    --ad-pad-b: 1.5rem;
    padding-top: 2.2rem;
  }
}
