/* Shared Nerofix dialog shell; no Bootstrap modal selectors. */
.nf-dialog {
  --nf-dialog-bg: var(--bs-body-bg, #fff);
  --nf-dialog-color: var(--bs-body-color, #283447);
  --nf-dialog-border: var(--bs-border-color, #dce2e9);
  color: var(--nf-dialog-color);
  background: var(--nf-dialog-bg);
  border: 1px solid var(--nf-dialog-border);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgb(0 0 0 / 35%);
  padding: 0;
  margin: auto;
  width: min(640px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  overscroll-behavior: contain;
  text-align: start;
}
.nf-dialog[open] { display: flex; flex-direction: column; }
.nf-dialog::backdrop { background: rgb(8 13 22 / 64%); }
.nf-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 16px;
  padding: 10px 12px 10px 20px;
  border-bottom: 1px solid var(--nf-dialog-border);
}
.nf-dialog-title {
  min-width: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.nf-dialog-title--accessible {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.nf-dialog-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  font: 30px/1 system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
.nf-dialog-close:hover { background: var(--bs-tertiary-bg, #edf1f5); }
.nf-dialog-close > svg { display: block; width: 24px; height: 24px; }
.nf-dialog--headless > .nf-dialog-close {
  position: absolute;
  z-index: 2;
  inset-block-start: max(var(--nf-media-frame, 12px), env(safe-area-inset-top));
  inset-inline-end: max(var(--nf-media-frame, 12px), env(safe-area-inset-right));
  border-color: rgb(255 255 255 / 25%);
  color: #fff;
  background: rgb(15 22 32 / 75%);
}
.nf-dialog--headless > .nf-dialog-close:hover { background: #334256; }
.nf-dialog--headless > .nf-dialog-close:focus-visible { outline-color: #fff; }
.nf-dialog :focus-visible { outline: 3px solid var(--bs-primary, #3878a7); outline-offset: -3px; }
.nf-dialog-content { display: flex; flex: 1 1 auto; min-height: 0; min-width: 0; overflow: hidden; }
.nf-dialog-body { flex: 1 1 auto; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; }
.nf-dialog-aside { flex: 0 0 340px; min-width: 0; overflow: auto; background: var(--nf-dialog-bg); border-inline-start: 1px solid var(--nf-dialog-border); overscroll-behavior: contain; }
.nf-dialog-aside[hidden] { display: none; }
.nf-dialog--with-aside { width: min(1100px, calc(100vw - 32px)); }
.nf-dialog--media {
  --nf-media-frame: 12px;
  --nf-media-max-width: calc(100vw - 40px);
  --nf-media-max-height: calc(100vh - 40px);
  --nf-media-max-height: calc(100dvh - 40px);
  border: 0;
  background: #10151d;
  width: var(--nf-media-max-width);
  height: var(--nf-media-max-height);
}
.nf-dialog--media .nf-dialog-body { display: flex; overflow: hidden; }
@media (max-width: 700px) {
  .nf-dialog--media {
    --nf-media-frame: 8px;
    --nf-media-max-width: calc(100vw - 16px);
    --nf-media-max-height: calc(100vh - 16px);
    --nf-media-max-height: calc(100dvh - 16px);
    width: var(--nf-media-max-width);
    max-width: var(--nf-media-max-width);
    height: var(--nf-media-max-height);
    max-height: var(--nf-media-max-height);
    border: 0;
    border-radius: 12px;
  }
  .nf-dialog-header {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
  }
  .nf-dialog--with-aside .nf-dialog-content { flex-direction: column; overflow: auto; }
  .nf-dialog--with-aside .nf-dialog-body { flex: 0 0 55dvh; min-height: 200px; }
  .nf-dialog-aside { flex: 1 0 auto; border-inline-start: 0; border-top: 1px solid var(--nf-dialog-border); overflow: visible; }
}
@media (prefers-reduced-motion: no-preference) {
  .nf-dialog[open] { animation: nf-dialog-enter 140ms ease-out; }
  @keyframes nf-dialog-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
