.site-dialog[hidden] { display:none !important; }
.site-dialog {
  --dialog-accent:#ef7500;
  --dialog-accent-soft:#fff1e2;
  position:fixed; inset:0; z-index:100000; display:grid; place-items:center;
  padding:clamp(16px, 4vw, 34px); isolation:isolate;
}
.site-dialog__backdrop {
  position:absolute; inset:0; background:rgba(8,20,27,.7);
  backdrop-filter:blur(7px) saturate(.85); animation:site-dialog-fade .2s ease-out;
}
.site-dialog__panel {
  position:relative; width:min(510px, 100%); overflow:hidden;
  border:1px solid #d6e1e6; border-top:4px solid var(--dialog-accent); border-radius:16px;
  background:#fff; color:#213642;
  box-shadow:0 28px 90px rgba(4,20,29,.38), 0 2px 8px rgba(4,20,29,.12);
  animation:site-dialog-in .22s cubic-bezier(.2,.8,.2,1);
}
.site-dialog__panel::after {
  content:""; position:absolute; z-index:0; top:-70px; right:-76px; width:190px; height:190px;
  border-radius:50%; background:radial-gradient(circle, color-mix(in srgb, var(--dialog-accent) 15%, transparent), transparent 68%);
  pointer-events:none;
}
.site-dialog__head { position:relative; z-index:1; display:flex; align-items:center; gap:14px; padding:24px 25px 13px; }
.site-dialog__icon {
  display:grid; flex:0 0 44px; height:44px; place-items:center;
  border:1px solid color-mix(in srgb, var(--dialog-accent) 25%, transparent); border-radius:12px;
  background:var(--dialog-accent-soft); color:var(--dialog-accent); font-size:1.08rem;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.6);
}
.site-dialog__title { margin:0; color:inherit; font-size:1.14rem; font-weight:800; letter-spacing:-.01em; }
.site-dialog__message {
  position:relative; z-index:1; margin:0; padding:3px 25px 25px 83px;
  color:#5d737f; font-size:.93rem; line-height:1.62; white-space:pre-line; overflow-wrap:anywhere;
}
.site-dialog__actions {
  position:relative; z-index:1; display:flex; justify-content:flex-end; gap:10px; padding:15px 18px;
  border-top:1px solid #e1e9ed; background:linear-gradient(180deg, #f8fafb, #f3f7f9);
}
.site-dialog__button {
  min-width:96px; height:39px; padding:0 18px; border:1px solid #c8d5db; border-radius:8px;
  background:#fff; color:#425c69; cursor:pointer; font:inherit; font-size:.72rem;
  font-weight:750 !important; letter-spacing:.055em; text-transform:uppercase;
  transition:transform .14s ease, border-color .14s ease, background-color .14s ease, box-shadow .14s ease;
}
.site-dialog__button:hover, .site-dialog__button:focus-visible {
  border-color:#8fa6b1; background:#edf3f6; outline:none; transform:translateY(-1px);
}
.site-dialog__button--primary {
  border-color:var(--dialog-accent); background:linear-gradient(180deg, #fa8615, var(--dialog-accent));
  color:#fff; box-shadow:0 5px 14px rgba(239,117,0,.24);
}
.site-dialog__button--primary:hover, .site-dialog__button--primary:focus-visible {
  border-color:#c65c00; background:#d96800; box-shadow:0 7px 18px rgba(217,104,0,.3);
}
.site-dialog--success { --dialog-accent:#2e8b49; --dialog-accent-soft:#e8f6ec; }
.site-dialog--warning { --dialog-accent:#ed7a00; --dialog-accent-soft:#fff2df; }
.site-dialog--error { --dialog-accent:#c94444; --dialog-accent-soft:#fcebec; }
.site-dialog--info { --dialog-accent:#27769f; --dialog-accent-soft:#e8f3f8; }
body.site-dialog-open { overflow:hidden; }

/* Materialize modals share the same surface language across the site. */
body .modal {
  overflow:hidden; border:1px solid #d6e1e6; border-top:4px solid #ef7500; border-radius:15px;
  background:#fff; color:#29404c; box-shadow:0 28px 85px rgba(5,22,31,.35);
}
body .modal .modal-content { padding:25px 27px; }
body .modal .modal-content > :is(h1,h2,h3,h4,h5):first-child {
  margin-top:0; color:#1d3440; font-weight:800; letter-spacing:-.02em;
}
body .modal .modal-footer {
  height:auto; min-height:62px; padding:12px 18px; border-top:1px solid #e1e9ed;
  background:linear-gradient(180deg, #f8fafb, #f2f6f8);
}
body .modal .modal-footer :is(.btn,.btn-flat,button) {
  min-height:38px; border-radius:8px; font-size:.75rem; font-weight:700 !important; letter-spacing:.04em;
}
body .modal-overlay { background:#07151d; backdrop-filter:blur(5px); opacity:.72 !important; }

body.site-night-ops .site-dialog__backdrop { background:rgba(1,6,10,.82); }
body.site-night-ops .site-dialog__panel {
  border-color:#385261; border-top-color:var(--dialog-accent);
  background:linear-gradient(145deg, #15242e, #101b23); color:#eef5f8;
  box-shadow:0 30px 100px rgba(0,0,0,.72), inset 0 1px 0 rgba(255,255,255,.025);
}
body.site-night-ops .site-dialog__icon {
  border-color:color-mix(in srgb, var(--dialog-accent) 38%, #263d49);
  background:color-mix(in srgb, var(--dialog-accent) 17%, #101b23);
  color:color-mix(in srgb, var(--dialog-accent) 78%, white); box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}
body.site-night-ops .site-dialog__message { color:#aebfc8; }
body.site-night-ops .site-dialog__actions { border-color:#2c414d; background:#0c161d; }
body.site-night-ops .site-dialog__button { border-color:#3e5967; background:#182a35; color:#cedbe1; }
body.site-night-ops .site-dialog__button:hover, body.site-night-ops .site-dialog__button:focus-visible { border-color:#66818f; background:#213743; }
body.site-night-ops .site-dialog__button--primary { border-color:var(--dialog-accent); background:var(--dialog-accent); color:#fff; }
html body.site-night-ops .modal {
  border-color:#385261 !important; border-top-color:#ef7500 !important;
  background:linear-gradient(145deg, #15242e, #101b23) !important; color:#d8e4e9 !important;
  box-shadow:0 30px 100px rgba(0,0,0,.68) !important;
}
html body.site-night-ops .modal .modal-content > :is(h1,h2,h3,h4,h5):first-child { color:#eef5f8 !important; }
html body.site-night-ops .modal .modal-footer { border-color:#2c414d !important; background:#0c161d !important; }
html body.site-night-ops .modal-overlay { background:#01060a !important; opacity:.82 !important; }

@keyframes site-dialog-fade { from { opacity:0; } to { opacity:1; } }
@keyframes site-dialog-in { from { opacity:0; transform:translateY(14px) scale(.975); } to { opacity:1; transform:none; } }
@media (max-width:560px) {
  .site-dialog__head { padding:21px 19px 12px; }
  .site-dialog__message { padding:4px 19px 22px; }
  .site-dialog__actions { padding:13px; }
  .site-dialog__button { flex:1; min-width:0; }
  body .modal .modal-content { padding:21px 19px; }
}
@media (prefers-reduced-motion:reduce) { .site-dialog__panel, .site-dialog__backdrop { animation:none; } }
