/* The desktop card keeps its existing fixed wrapper and Tailwind styling. */
dialog.kg-auth-layer { display:block; position:static; width:auto; max-width:none; height:auto; max-height:none; margin:0; padding:0; border:0; overflow:visible; background:transparent; color:inherit; }
.kg-auth-mobile-title { display:none; }
@media (max-width:767px) {
    /* Native modal top layer escapes page stacking contexts (header, nav, chat). */
    dialog.kg-auth-layer { position:fixed; inset:var(--auth-viewport-top,0px) 0 auto; width:100%; height:100vh; height:var(--auth-viewport-height,100dvh); overflow:hidden; overscroll-behavior:none; }
    .kg-auth-layer::backdrop { background:#0006; }
    .kg-auth-layer .kg-auth-backdrop { display:none; }
    .kg-customer .kg-auth-layer .kg-auth-modal { position:absolute; inset:0; display:block; height:100%; padding:0; overflow:hidden; }
    .kg-auth-layer .kg-auth-panel { display:flex; flex-direction:column; width:100%; max-width:none; height:100%; min-height:0; padding:0; border:0; border-radius:0; }
    .kg-auth-layer .kg-auth-heading { flex:none; margin:0; min-height:64px; padding:calc(8px + env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) 8px max(16px,env(safe-area-inset-left,0px)); border-bottom:1px solid #e5e5e5; }
    .dark .kg-auth-layer .kg-auth-heading { border-color:#404040; }
    .kg-auth-layer .kg-auth-close { display:flex; align-items:center; justify-content:center; flex:none; width:44px; height:44px; padding:0; border:0; font-size:28px; line-height:1; }
    .kg-auth-layer .kg-auth-content { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:24px max(20px,env(safe-area-inset-right,0px)) calc(24px + env(safe-area-inset-bottom,0px)) max(20px,env(safe-area-inset-left,0px)); scroll-padding-block:20px; overflow-wrap:anywhere; }
    .kg-auth-layer .kg-auth-content input { min-width:0; font-size:16px; scroll-margin-block:20px; }
    .kg-auth-layer .kg-auth-content svg { flex:none; }
    .dark .kg-auth-layer .kg-auth-footer p { color:#a3a3a3; }
    .dark .kg-auth-layer .kg-auth-content a,.dark .kg-auth-layer .kg-auth-footer button { color:#a5b4fc; }
    .dark .kg-auth-layer .kg-auth-content .text-red-600 { color:#fca5a5; }
    .kg-auth-layer .kg-auth-desktop-title { display:none; }
    .kg-auth-layer .kg-auth-mobile-title { display:inline; }
}
