.app-dialog-overlay {
  backdrop-filter: blur(12px);
  background: rgba(5, 9, 5, 0.48);
}

.chat-image-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2200;
}

.chat-image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 5, 0.82);
  backdrop-filter: blur(10px);
}

.chat-image-modal-content {
  position: relative;
  z-index: 1;
  width: min(92vw, 980px);
  max-height: min(88vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-image-modal-img {
  max-width: 100%;
  max-height: 88vh;
  display: block;
  border-radius: 18px;
  border: 1px solid rgba(221, 220, 169, 0.18);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.42);
  background: rgba(12, 18, 11, 0.96);
}

.chat-image-close-btn {
  position: absolute;
  top: -14px;
  inset-inline-end: -14px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(220, 218, 169, 0.2);
  background: linear-gradient(180deg, rgba(45, 57, 28, 0.98), rgba(30, 38, 19, 0.98));
  color: #f4f0d6;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
}

.chat-image-close-btn:hover {
  background: linear-gradient(180deg, rgba(62, 77, 39, 0.98), rgba(40, 51, 24, 0.98));
}

.app-dialog-card {
  width: min(92vw, 420px);
  padding: 20px;
}

.app-dialog-header {
  margin-bottom: 8px;
}

.app-dialog-header h3 {
  margin: 0;
}

#appDialogMessage {
  white-space: pre-line;
}

.app-dialog-input-wrap {
  margin-top: 16px;
}

.app-dialog-input-wrap input {
  width: 100%;
}

.app-dialog-actions {
  margin-top: 18px;
  justify-content: flex-end;
}

.modal-cancel-btn {
  background: linear-gradient(180deg, var(--surface-strong), var(--surface)) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--card-border) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 18px rgba(0, 0, 0, 0.12) !important;
}

.modal-cancel-btn:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), var(--surface-strong)) !important;
}

.app-dialog-confirm-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-deep, var(--primary))) !important;
  color: #fff !important;
}

.app-dialog-confirm-warning {
  background: linear-gradient(180deg, #9b7b43, #7d6234) !important;
  color: #fff8e8 !important;
}

.app-dialog-confirm-danger {
  background: linear-gradient(180deg, var(--danger), var(--danger-hover)) !important;
  color: #fff !important;
}

.app-dialog-confirm-success {
  background: linear-gradient(180deg, #5d8a45, #466835) !important;
  color: #fff !important;
}

html[data-theme="light"] .app-dialog-overlay {
  background: rgba(76, 80, 72, 0.18);
}

html[data-theme="light"] .chat-image-modal-backdrop {
  background: rgba(82, 86, 79, 0.36);
}

html[data-theme="light"] .chat-image-modal-img {
  border-color: rgba(86, 102, 71, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 50px rgba(80, 84, 72, 0.18);
}

html[data-theme="light"] .chat-image-close-btn {
  border-color: rgba(80, 97, 60, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 241, 233, 0.96));
  color: #334027;
  box-shadow: 0 12px 26px rgba(77, 82, 68, 0.12);
}

html[data-theme="light"] .chat-image-close-btn:hover {
  background: linear-gradient(180deg, rgba(248, 246, 240, 0.98), rgba(238, 234, 224, 0.98));
}

html[data-theme="light"] .modal-cancel-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 242, 236, 0.92)) !important;
  color: var(--text-main) !important;
  border-color: rgba(72, 89, 62, 0.12) !important;
  box-shadow: 0 8px 18px rgba(77, 82, 68, 0.08) !important;
}
