/* Step 18.22f: One movable / resizable Nexus window for all footer actions.
   Reuses the existing consent panel and the existing Room Editor window idiom. */
.nexus-consent[data-nexus-consent-root] {
    position: fixed; inset: 0; z-index: 2147480000;
    display: block; pointer-events: none; background: none;
}
.nexus-consent[data-nexus-consent-root][hidden] { display: none !important; }
.nexus-consent .nexus-consent__backdrop { display: none; }
.nexus-consent .nexus-legal-window {
    position: fixed; inset: auto; left: 24px; top: 70px;
    width: min(760px, calc(100vw - 32px));
    height: min(640px, calc(100dvh - 56px));
    min-width: min(360px, calc(100vw - 16px)); min-height: 260px;
    max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px);
    margin: 0; padding: 0; resize: both; overflow: hidden;
    display: flex; flex-direction: column;
    pointer-events: auto; box-sizing: border-box;
    color: #e9f6ff; background: #071421;
    border: 1px solid rgba(128,214,252,.46); border-radius: 10px;
    box-shadow: 0 22px 90px rgba(0,0,0,.72), 0 0 0 1px rgba(126,209,255,.06);
    font: 14px/1.5 system-ui,-apple-system,Segoe UI,sans-serif;
}
.nexus-legal-window.is-dragging { box-shadow: 0 30px 110px rgba(0,0,0,.82), 0 0 0 1px rgba(143,216,255,.3); }
.nexus-legal-window.is-maximized {
    left: 8px !important; top: 8px !important;
    width: calc(100vw - 16px) !important; height: calc(100dvh - 16px) !important;
    max-width: none; max-height: none; resize: none;
}
.nexus-legal-window__header {
    display: flex; align-items: center; flex: none; gap: 12px;
    min-height: 52px; box-sizing: border-box; padding: 8px 12px;
    background: linear-gradient(100deg, #102a3f, #0b1a2b);
    border-bottom: 1px solid rgba(143,216,255,.20);
    cursor: move; touch-action: none; user-select: none;
}
.nexus-legal-window__symbol { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid #335c76; border-radius: 7px; background: #0c2435; color: #8bdcff; font-size: 18px; }
.nexus-legal-window__title { font-size: 14px; font-weight: 750; color: #f5fbff; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nexus-legal-window__actions { display: flex; gap: 7px; flex: none; }
.nexus-legal-window__action { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #3a5c70; border-radius: 6px; background: #10273a; color: #eaf6ff; font-size: 22px; line-height: 1; cursor: pointer; }
.nexus-legal-window__action:hover { background: #1a3d54; }
.nexus-legal-window__close:hover { background: #78303a; border-color: #df8390; }
.nexus-legal-window__body { flex: 1 1 auto; min-height: 0; padding: 20px 23px 24px; overflow: auto; overscroll-behavior: contain; }
.nexus-legal-window__body[hidden] { display: none !important; }
.nexus-legal-window__footer { flex: none; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-height: 39px; box-sizing: border-box; padding: 7px 18px; background: #0a1b2c; border-top: 1px solid rgba(143,216,255,.18); color: #8faabf; font-size: 11px; }
.nexus-legal-window__footer a, .nexus-legal-window__legal a { color: #a3e2ff; text-decoration: underline; text-underline-offset: 3px; }
.nexus-legal-window__footer a[hidden] { display: none !important; }
.nexus-legal-window__legal .nexus-imprint-document {
    flex: none; width: auto; max-width: 850px; margin: 0 auto; padding: 0;
    border: 0; border-radius: 0; box-shadow: none; background: transparent;
    color: #e9f4ff; font: 14px/1.7 system-ui,-apple-system,Segoe UI,sans-serif;
}
.nexus-legal-window__legal .nexus-imprint-document h1 { font-size: clamp(24px,3vw,32px); line-height: 1.2; margin: 0 0 20px; }
.nexus-legal-window__legal .nexus-imprint-document h2 { font-size: 16px; color: #b4e6ff; }
.nexus-legal-window__legal .nexus-imprint-document section { border-top: 1px solid rgba(143,216,255,.14); padding: 12px 0; }
.nexus-legal-window__legal .nexus-privacy-text { overflow-wrap: anywhere; line-height: 1.8; }
.nexus-legal-window__legal .nexus-imprint-eyebrow { color: #96d9fa; text-transform: uppercase; letter-spacing: .10em; font-size: 11px; }
.nexus-legal-window button:focus-visible, .nexus-legal-window a:focus-visible, .nexus-legal-window input:focus-visible { outline: 2px solid #8cdeff; outline-offset: 2px; }
@media (max-width: 640px) {
    .nexus-consent .nexus-legal-window,
    .nexus-consent .nexus-legal-window.is-maximized {
        left: 8px !important; top: 8px !important;
        width: calc(100vw - 16px) !important; height: calc(100dvh - 16px) !important;
        min-width: 0; max-width: none; min-height: 0; max-height: none;
        border-radius: 9px; resize: none;
    }
    .nexus-legal-window__header { cursor: default; }
    .nexus-legal-window__body { padding: 16px; }
    .nexus-legal-window__footer > span { display: none; }
    .nexus-legal-window__footer { justify-content: flex-end; }
    .nexus-legal-window [data-nexus-window-maximize] { display: none; }
}
@media (prefers-reduced-motion: reduce) { .nexus-legal-window * { scroll-behavior: auto !important; } }
