/* App dialogs share the project's outlined and blue primary button styles.
   Scoped rules also support standalone pages such as Orbitcast. */
.app-dialog-overlay {
  position: fixed; inset: 0; z-index: 20000;
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(0, 0, 0, .45);
}
.app-dialog {
  width: min(340px, 100%); max-height: 100%; overflow: auto;
  box-sizing: border-box; margin: 0; padding: 22px 18px 16px;
  border: 0; border-radius: 16px; background: #f4f4f5;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  color: #1c1f26; font-family: inherit; text-align: center;
}
.app-dialog h2 {
  margin: 0 0 18px; font-size: 17px; font-weight: 400; line-height: 1.3;
  color: #1c1f26; white-space: pre-line; overflow-wrap: anywhere;
}
.app-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.app-dialog-actions.is-single { grid-template-columns: 1fr; }
.app-dialog-actions.has-secondary { grid-template-columns: 1fr; }
.app-dialog-actions .btn {
  appearance: none; width: auto; min-height: 44px; margin: 0;
  border: 1.5px solid color-mix(in srgb, var(--accent, #1c58d9) 35%, transparent);
  border-radius: 12px; padding: 12px 10px;
  background: #fff; color: var(--accent, #1c58d9);
  font-family: inherit; font-size: 15px; font-weight: 400;
  cursor: pointer;
}
.app-dialog-actions .btn.primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #1c58d9) 78%, var(--button-primary-highlight, #6a8dff)), var(--accent, #1c58d9));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent, #1c58d9) 35%, transparent);
}
.app-dialog-actions .btn.primary.destructive {
  --accent: #c32f39;
  --button-primary-highlight: #ff858b;
}
.app-dialog-actions .btn:focus-visible { outline: 2px solid var(--accent, #1c58d9); outline-offset: 3px; }
.app-dialog-input {
  display: block; box-sizing: border-box; width: 100%; min-height: 44px;
  margin: 0 0 18px; border: 1px solid #c5c8ce; border-radius: 10px;
  padding: 10px 12px; background: #fff; color: #1c1f26; font: inherit;
  font-size: 16px;
}
.app-dialog-check {
  display: flex; align-items: center; gap: 10px; margin: 0 4px 18px;
  text-align: left; font-size: 15px; font-weight: 400; line-height: 1.3; cursor: pointer;
}
.app-dialog-check input {
  appearance: none; width: 22px; height: 22px; margin: 0; flex: none;
  display: grid; place-items: center; border: 2px solid #c5c8ce;
  border-radius: 50%; background: #fff;
}
.app-dialog-check input:checked { background: var(--accent, #1c58d9); border-color: var(--accent, #1c58d9); }
.app-dialog-check input:checked::after {
  content: ""; width: 10px; height: 6px; border: 2px solid #fff;
  border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px);
}
.app-dialog-check input:focus-visible { outline: 2px solid var(--accent, #1c58d9); outline-offset: 3px; }
