.app-dialog {
  width: min(92vw, 720px);
  max-height: min(88dvh, 860px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: var(--radius-large);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 70px rgb(10 35 29 / 38%);
}

.app-dialog::backdrop {
  background: rgb(10 39 33 / 64%);
  backdrop-filter: blur(4px);
}

.dialog-panel {
  padding: clamp(20px, 4vw, 38px);
}

.dialog-panel h2 {
  margin-bottom: 12px;
  font-size: clamp(1.65rem, 4vw, 2.6rem);
}

.dialog-copy {
  padding: 18px 20px;
  border-left: 7px solid var(--sun);
  border-radius: 8px 18px 18px 8px;
  background: white;
  font-size: clamp(1.05rem, 2.3vw, 1.28rem);
}

.discovery-visual {
  margin: 0 0 16px;
  overflow: hidden;
  border: 4px solid white;
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.discovery-visual img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(43dvh, 430px);
  object-fit: contain;
}

@media (orientation: landscape) and (max-height: 780px) {
  .app-dialog:has(.discovery-visual) {
    width: min(94vw, 980px);
  }

  .app-dialog:has(.discovery-visual) .dialog-panel {
    display: grid;
    grid-template-columns: minmax(300px, 1.15fr) minmax(270px, 0.85fr);
    gap: 12px 22px;
    align-items: start;
  }

  .app-dialog:has(.discovery-visual) .eyebrow,
  .app-dialog:has(.discovery-visual) h2,
  .app-dialog:has(.discovery-visual) .dialog-actions {
    grid-column: 1 / -1;
  }

  .app-dialog:has(.discovery-visual) .dialog-copy {
    margin: 0;
  }

  .app-dialog:has(.discovery-visual) .discovery-visual {
    margin: 0;
  }

  .app-dialog:has(.discovery-visual) .discovery-visual img {
    max-height: 38dvh;
  }
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}

.settings-grid {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: white;
}

.setting-row label {
  font-weight: 900;
}

.toggle-button {
  min-width: 92px;
  min-height: 44px;
  border: 2px solid var(--moss);
  border-radius: 999px;
  color: white;
  background: var(--moss);
  font-weight: 900;
}

.toggle-button[aria-pressed="false"] {
  color: var(--ink);
  background: #e9e6dc;
}

.help-list {
  display: grid;
  gap: 12px;
  padding-left: 22px;
}

.help-list li {
  line-height: 1.45;
}

.toast {
  position: fixed;
  z-index: 90;
  right: 18px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 18px;
  border-radius: 15px;
  color: white;
  background: var(--moss-dark);
  box-shadow: var(--shadow);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 540px) {
  .app-dialog {
    width: calc(100vw - 18px);
    border-radius: 22px;
  }

  .dialog-actions > button {
    width: 100%;
  }
}
