.nexora-dialog-layer {
  --nd-bg: rgba(7, 16, 36, .96);
  --nd-surface: rgba(12, 27, 56, .92);
  --nd-line: rgba(102, 193, 255, .34);
  --nd-text: #eff7ff;
  --nd-muted: #94aac4;
  --nd-accent: #4fd9ec;
  --nd-accent-strong: #268da8;
  --nd-danger: #ff7489;
  position: fixed;
  inset: var(--nd-viewport-top, 0px) auto auto var(--nd-viewport-left, 0px);
  margin: 0;
  width: var(--nd-viewport-width, 100%);
  height: var(--nd-viewport-height, 100dvh);
  max-width: none;
  max-height: none;
  border: 0;
  box-sizing: border-box;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 8, 20, .58);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: nexora-dialog-fade .16s ease both;
}
.nexora-dialog-layer[hidden] { display: none !important; }
.nexora-dialog-layer::backdrop { background: transparent; }
.nexora-dialog {
  width: min(460px, 100%);
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--nd-line);
  border-radius: 20px;
  color: var(--nd-text);
  background: linear-gradient(145deg, rgba(18, 35, 71, .98), var(--nd-bg));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .08);
  animation: nexora-dialog-rise .2s cubic-bezier(.2, .75, .25, 1) both;
}
.nexora-dialog-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 12px; }
.nexora-dialog-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--nd-line); border-radius: 14px; color: var(--nd-accent); background: rgba(79, 217, 236, .1); font-size: 21px; }
.nexora-dialog-title { min-width: 0; margin: 0; font-size: 18px; font-weight: 750; letter-spacing: .02em; }
.nexora-dialog-close { width: 34px; height: 34px; margin-left: auto; border: 1px solid var(--nd-line); border-radius: 11px; color: var(--nd-muted); background: transparent; cursor: pointer; font-size: 20px; line-height: 1; }
.nexora-dialog-close:hover { color: var(--nd-text); background: rgba(255, 255, 255, .08); }
.nexora-dialog-body { display: grid; gap: 15px; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 5px 22px 20px; }
.nexora-dialog-message { margin: 0; color: var(--nd-muted); font-size: 14px; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.nexora-dialog-input { width: 100%; min-height: 44px; padding: 0 13px; outline: 0; border: 1px solid var(--nd-line); border-radius: 12px; color: var(--nd-text); background: var(--nd-surface); box-shadow: inset 0 1px 4px rgba(0, 0, 0, .12); }
.nexora-dialog-input:focus { border-color: var(--nd-accent); box-shadow: 0 0 0 3px rgba(79, 217, 236, .13); }
.nexora-dialog-options { max-height: 260px; display: grid; gap: 8px; overflow: auto; }
.nexora-dialog-option { min-height: 48px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--nd-line); border-radius: 12px; color: var(--nd-text); background: var(--nd-surface); cursor: pointer; text-align: left; }
.nexora-dialog-option:hover, .nexora-dialog-option.is-selected { border-color: var(--nd-accent); background: rgba(38, 141, 168, .2); }
.nexora-dialog-option-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--nd-accent); background: rgba(79, 217, 236, .1); }
.nexora-dialog-option-copy { min-width: 0; display: grid; gap: 2px; }
.nexora-dialog-option-copy strong, .nexora-dialog-option-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nexora-dialog-option-copy small { color: var(--nd-muted); }
.nexora-dialog-option-check { color: var(--nd-accent); opacity: 0; }
.nexora-dialog-option.is-selected .nexora-dialog-option-check { opacity: 1; }
.nexora-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid rgba(118, 174, 220, .13); }
.nexora-dialog-button { min-width: 86px; min-height: 40px; padding: 0 16px; border: 1px solid var(--nd-line); border-radius: 12px; color: var(--nd-text); background: rgba(255, 255, 255, .045); cursor: pointer; font-weight: 650; }
.nexora-dialog-button:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .09); }
.nexora-dialog-button.is-primary { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--nd-accent-strong), #3969bd); box-shadow: 0 7px 18px rgba(36, 115, 174, .25); }
.nexora-dialog.is-danger .nexora-dialog-icon { border-color: rgba(255, 116, 137, .35); color: var(--nd-danger); background: rgba(255, 116, 137, .1); }
.nexora-dialog.is-danger .nexora-dialog-button.is-primary { background: linear-gradient(135deg, #d94e68, #a83450); box-shadow: 0 7px 18px rgba(185, 50, 76, .25); }

html[data-home-theme="forest-glass"] .nexora-dialog-layer {
  --nd-bg: rgba(239, 248, 244, .96);
  --nd-surface: rgba(249, 252, 251, .92);
  --nd-line: rgba(66, 127, 108, .3);
  --nd-text: #173b34;
  --nd-muted: #617a73;
  --nd-accent: #398c76;
  --nd-accent-strong: #398c76;
  --nd-danger: #b8465b;
  background: rgba(30, 57, 50, .34);
}
html[data-home-theme="forest-glass"] .nexora-dialog { background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(226, 241, 235, .96)); box-shadow: 0 24px 64px rgba(31, 69, 58, .24), inset 0 1px 0 rgba(255, 255, 255, .85); }
html[data-home-theme="forest-glass"] .nexora-dialog-icon { background: rgba(57, 140, 118, .1); }
html[data-home-theme="forest-glass"] .nexora-dialog-close:hover { background: rgba(57, 140, 118, .09); }
html[data-home-theme="forest-glass"] .nexora-dialog-input:focus { box-shadow: 0 0 0 3px rgba(57, 140, 118, .13); }
html[data-home-theme="forest-glass"] .nexora-dialog-option:hover,
html[data-home-theme="forest-glass"] .nexora-dialog-option.is-selected { background: #ddf2eb; }
html[data-home-theme="forest-glass"] .nexora-dialog-button { background: rgba(255, 255, 255, .68); }
html[data-home-theme="forest-glass"] .nexora-dialog-button:hover { background: #ddf2eb; }
html[data-home-theme="forest-glass"] .nexora-dialog-button.is-primary { background: linear-gradient(135deg, #398c76, #2f7866); box-shadow: 0 7px 18px rgba(47, 120, 102, .2); }

@keyframes nexora-dialog-fade { from { opacity: 0; } }
@keyframes nexora-dialog-rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 560px) {
  .nexora-dialog-layer { align-items: end; padding: 10px; }
  .nexora-dialog { width: 100%; border-radius: 19px; }
  .nexora-dialog-head { padding: 17px 17px 10px; }
  .nexora-dialog-body { padding: 5px 17px 17px; }
  .nexora-dialog-actions { padding: 12px 17px 17px; }
  .nexora-dialog-button { flex: 1; }
  .nexora-dialog-options { max-height: min(54vh, 460px); padding-right: 2px; }
  .nexora-dialog-option { min-height: 55px; border-radius: 13px; }
}
@media (prefers-reduced-motion: reduce) { .nexora-dialog-layer, .nexora-dialog { animation: none; } }
.nexora-dialog-layer.is-centered { align-items: center; }
