/* Light glass dialogs share the header's restrained transparency. */
#action-dialog {
  inset: 0;
  margin: auto;
  width: calc(100% - 40px);
  max-width: 420px;
  max-height: calc(100dvh - 48px);
}

#action-dialog::backdrop {
  background: rgba(2, 7, 16, .22);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: veil-in .4s ease both;
}

#action-dialog.is-closing::backdrop {
  animation: veil-out .3s ease both;
}

.portal-surface {
  border-radius: 24px;
  border-color: rgba(189, 219, 249, .2);
  background: linear-gradient(145deg, rgba(15, 29, 47, .8), rgba(7, 17, 30, .72));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: 0 20px 60px #0004, inset 0 1px #dcf1ff0c;
}

.portal-surface::after {
  left: 16%;
  right: 16%;
  background: linear-gradient(90deg, transparent, #c9ecff42, transparent);
}

.dialog-close {
  top: 10px;
  left: 10px;
  width: 40px;
  height: 40px;
  background: #bedfff04;
  border-color: #bedfff12;
  color: #c7d9eb;
}

#dialog-content {
  min-height: 260px;
  padding: 31px 25px 27px;
  border-radius: 24px;
  overflow-x: hidden;
  scrollbar-width: none;
}

#dialog-content::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

#dialog-content.is-transitioning {
  overflow: hidden;
}

#dialog-title {
  font-size: 23px;
  letter-spacing: -.2px;
}

#dialog-description {
  color: #c0cede;
  font-size: 13px;
  margin-top: 5px;
}

#action-dialog[data-kind="keys"] #dialog-content:has(.key-options) {
  min-height: 0;
  padding: 28px 22px 23px;
}

#action-dialog[data-kind="keys"] #dialog-content:has(.key-options) #dialog-title,
#action-dialog[data-kind="keys"] #dialog-content:has(.key-options) #dialog-description {
  text-align: right;
  padding-left: 35px;
}

.key-options {
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 23px;
}

.key-choice {
  min-height: 84px;
  padding: 13px;
  border-radius: 16px;
  border-color: #bddbff24;
  background: linear-gradient(110deg, #b7dfff05, #b7dfff02);
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  text-align: right;
}

.key-choice::before {
  display: none;
}

.key-choice::after {
  background: linear-gradient(110deg, transparent 25%, #b2ddff09, transparent 75%);
}

.choice-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.choice-copy strong {
  font: 700 18px/1.6 var(--font);
  color: #f0f6ff;
}

.choice-copy small {
  font-size: 12px;
  color: #bdcee2;
}

.choice-copy .choice-free {
  display: inline-block;
  margin-inline-start: 4px;
  padding: 1px 6px;
  border: 1px solid #c1e5bb25;
  border-radius: 6px;
  background: #b4e6b706;
  color: #d6e9ce;
  font-size: 10px;
  font-weight: 500;
  vertical-align: middle;
}

.choice-arrow {
  display: grid;
  place-items: center;
  width: 25px;
  color: #b5ccdf;
}

.choice-arrow .icon {
  width: 16px;
  height: 16px;
  transform: rotate(180deg);
}

.app-logo {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 1px solid #afd2f618;
  border-radius: 14px;
  background: linear-gradient(145deg, #c2e5ff09, #07101d22);
  box-shadow: inset 0 1px #e2f4ff06;
}

.app-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

.monthly-choice .app-logo {
  background: linear-gradient(145deg, #f0f5ff0a, #07101d22);
}

.dialog-app-mark {
  display: flex;
  justify-content: center;
  margin: 0 auto 18px;
}

.app-logo-large {
  width: 84px;
  height: 84px;
  border-radius: 23px;
  background: radial-gradient(ellipse at 50% 0, #92caff0b, transparent 85%);
  border-color: #b2d5f814;
}

.app-logo-large img {
  padding: 1px;
}

.dialog-app-mark.loading .app-logo {
  animation: logo-breathe 1.8s ease-in-out infinite;
}

.key-choice:active {
  transform: scale(.985);
}

.key-choice.is-selected {
  background: #9dceff0c;
  border-color: #a6d9ff77;
  box-shadow: inset 0 0 15px #a0d8ff04;
}

@media (hover: hover) {
  .key-choice:hover {
    transform: translateX(-2px);
    background: #b9dfff09;
    border-color: #bddfff54;
    box-shadow: none;
  }
}

@media (max-width: 599px) {
  #action-dialog {
    inset: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
    margin: auto 0;
    max-width: none;
    width: calc(100% - 36px);
    max-height: calc(100dvh - 40px);
  }

  #dialog-content {
    max-height: calc(100dvh - 44px);
    padding: 30px 23px 27px;
  }

  #action-dialog[data-kind="keys"] #dialog-content:has(.key-options) {
    padding: 26px 19px 20px;
  }
}

@media (max-width: 359px) {
  #action-dialog {
    left: 15px;
    right: 15px;
    width: calc(100% - 30px);
  }

  #dialog-title { font-size: 21px; }
  .key-choice { gap: 10px; padding: 11px; min-height: 77px; }
  .app-logo { width: 46px; height: 46px; border-radius: 12px; }
  .choice-copy strong { font-size: 17px; }
  .app-logo-large { width: 78px; height: 78px; border-radius: 21px; }
}

@keyframes veil-in {
  from { background: rgba(2, 7, 16, 0); }
  to { background: rgba(2, 7, 16, .22); }
}

@keyframes veil-out {
  from { background: rgba(2, 7, 16, .22); }
  to { background: rgba(2, 7, 16, 0); }
}

@keyframes logo-breathe {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
