.dialog-wrapper {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px 16px;
  padding-top: 5dvh;
  background: var(--backdrop);
  animation: fade-in 120ms ease;
}
.dialog-body {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-large);
  animation: dialog-in 160ms ease;
}
.dialog-body:focus {
  outline: none;
}
.dialog-body.dialog-wide {
  max-width: 1200px;
}
.dialog-body .dialog-title {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 20px;
  border-bottom: 1px solid var(--border);
}
.dialog-body .dialog-title > span {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 17px;
  font-weight: 650;
}
.dialog-body .dialog-title > .dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.dialog-body .dialog-title > .dialog-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.dialog-body .dialog-title > .dialog-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
}
.dialog-body .dialog-content {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 16px 20px;
  overflow: auto;
  overflow-wrap: anywhere;
}
.dialog-body .dialog-content.table-container {
  height: 75vh;
  overflow: hidden;
}
.dialog-body .dialog-buttons {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}
.dialog-body .dialog-buttons:empty {
  display: none;
}
.dialog-body .dialog-buttons .dialog-hint {
  margin-right: auto;
  color: var(--text-muted);
  font-size: 12px;
}
.dialog-body .dialog-buttons .btn {
  min-width: 96px;
  min-height: 34px;
}
@media (max-width: 639.98px) {
  .dialog-wrapper {
    align-items: flex-end;
    padding: 0;
  }
  .dialog-body,
  .dialog-body.dialog-wide {
    max-width: none;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 12px 12px 0 0;
  }
  .dialog-body .dialog-content {
    padding: 14px 16px;
  }
  .dialog-body .dialog-content.table-container {
    height: 80vh;
  }
  .dialog-body .dialog-buttons {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }
  .dialog-body .dialog-buttons .btn {
    flex: 1 1 0;
  }
  .dialog-body .dialog-buttons .dialog-hint {
    display: none;
  }
}
@media (max-height: 500px) {
  .dialog-wrapper {
    padding: 8px 16px;
  }
  .dialog-body,
  .dialog-body.dialog-wide {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }
  .dialog-body .dialog-title {
    padding: 6px 10px 6px 16px;
  }
  .dialog-body .dialog-content {
    padding: 10px 16px;
  }
  .dialog-body .dialog-content.table-container {
    height: calc(100dvh - 120px);
  }
  .dialog-body .dialog-buttons {
    padding: 8px 16px;
  }
}
.set-password {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.set-password .set-password-user {
  margin: 0;
  font-weight: 650;
}
.set-password .set-password-hint {
  margin: -4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}
.editor-notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  background: var(--warning-bg);
  font-size: 14px;
}
.editor-history {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.editor-history:hover {
  text-decoration: underline;
}
.editor-history kbd {
  text-decoration: none;
}
.conflict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.conflict-table th,
.conflict-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.conflict-table th {
  color: var(--text-muted);
  font-weight: 600;
}
