/* Scoped independently of the host page; safe to reuse in the Vue client. */
dialog.app-dialog {
  --app-dialog-ink: #202631;
  --app-dialog-muted: #657184;
  --app-dialog-line: #dfe5ee;
  --app-dialog-blue: #284b9b;
  --app-dialog-red: #bd3d3d;
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(460px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--app-dialog-line);
  border-radius: 12px;
  background: #fff;
  color: var(--app-dialog-ink);
  box-shadow: 0 24px 80px rgb(23 34 56 / 22%);
  font: 14px/1.6 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  text-align: left;
  overscroll-behavior: contain;
}
dialog.app-dialog::backdrop { background: rgb(23 34 56 / 44%); }
.app-dialog .app-dialog-form { display: flex; flex-direction: column; margin: 0; max-height: inherit; min-width: 0; }
.app-dialog .app-dialog-header { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 12px; flex: 0 0 auto; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--app-dialog-line); }
.app-dialog .app-dialog-title { min-width: 0; margin: 0; color: var(--app-dialog-ink); font-size: 18px; font-weight: 700; line-height: 28px; overflow-wrap: anywhere; }
.app-dialog .app-dialog-close { display: grid; place-items: center; box-sizing: border-box; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--app-dialog-muted); font: 26px/1 system-ui, sans-serif; cursor: pointer; }
.app-dialog .app-dialog-close:hover { background: #f3f5f8; color: var(--app-dialog-ink); }
.app-dialog .app-dialog-content { flex: 1 1 auto; min-width: 0; min-height: 0; padding: 22px 24px 0; overflow: auto; overscroll-behavior: contain; }
.app-dialog .app-dialog-message { max-width: 100%; margin: 0 0 20px; color: var(--app-dialog-ink); font-size: 14px; line-height: 24px; white-space: pre-wrap; overflow-wrap: anywhere; }
.app-dialog .app-dialog-field { display: grid; gap: 8px; min-width: 0; }
.app-dialog .app-dialog-label { display: block; min-width: 0; color: var(--app-dialog-ink); font-size: 14px; font-weight: 600; line-height: 22px; overflow-wrap: anywhere; }
.app-dialog .app-dialog-input { display: block; box-sizing: border-box; width: 100%; min-width: 0; height: 44px; min-height: 44px; padding: 10px 12px; border: 1px solid #b9c4d4; border-radius: 6px; background: #fff; color: var(--app-dialog-ink); font: inherit; line-height: 22px; }
.app-dialog .app-dialog-input[aria-invalid="true"] { border-color: var(--app-dialog-red); }
.app-dialog .app-dialog-error { min-height: 22px; margin: 0 0 4px; color: #a53030; font-size: 13px; line-height: 22px; overflow-wrap: anywhere; }
.app-dialog .app-dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex: 0 0 auto; padding: 4px 24px 24px; }
.app-dialog .app-dialog-button { display: inline-flex; box-sizing: border-box; justify-content: center; align-items: center; gap: 8px; width: auto; min-width: 96px; max-width: 100%; min-height: 44px; margin: 0; padding: 10px 18px; border: 1px solid var(--app-dialog-line); border-radius: 6px; background: #fff; color: var(--app-dialog-ink); font: inherit; font-weight: 600; line-height: 22px; white-space: normal; overflow-wrap: anywhere; cursor: pointer; transition: background-color 120ms ease, border-color 120ms ease; }
.app-dialog .app-dialog-cancel:hover { background: #f3f5f8; border-color: #b9c4d4; }
.app-dialog .app-dialog-confirm { border-color: var(--app-dialog-blue); background: var(--app-dialog-blue); color: #fff; }
.app-dialog .app-dialog-confirm:hover { border-color: #203e82; background: #203e82; }
.app-dialog .app-dialog-danger { border-color: var(--app-dialog-red); background: var(--app-dialog-red); }
.app-dialog .app-dialog-danger:hover { border-color: #a53030; background: #a53030; }
.app-dialog .app-dialog-button:disabled, .app-dialog .app-dialog-close:disabled { opacity: .65; cursor: default; }
.app-dialog :is(button, input):focus-visible { outline: 3px solid #7e9fe8; outline-offset: 3px; }
@media (max-width: 480px) {
  .app-dialog .app-dialog-header { padding-left: 20px; }
  .app-dialog .app-dialog-content { padding-right: 20px; padding-left: 20px; }
  .app-dialog .app-dialog-actions { padding-right: 20px; padding-left: 20px; }
  .app-dialog .app-dialog-button { flex: 1 1 0; min-width: 0; }
  .app-dialog .app-dialog-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .app-dialog .app-dialog-button { transition: none; } }
