/*
  NEXORA LAYOUT V1
  Preview-only shared layout.
  Graphite + Lime.
*/

/* Consistent Mini App frame */
html,
body,
#root {
  min-height:100%;
}

#root .app {
  box-sizing:border-box !important;
  width:100% !important;
  max-width:390px !important;
  min-height:100dvh !important;
  height:auto !important;
  margin-inline:auto !important;
  padding-bottom:calc(var(--nxr-nav-height, 76px) + 28px + env(safe-area-inset-bottom,0px)) !important;
}

/* Keep page contents inside the frame */
#root .app > *,
#root .app .vd2-dashboard,
#root .app .dv4-page,
#root .app .wv4-page,
#root .app .tv4-page {
  box-sizing:border-box !important;
  max-width:100%;
}

/* Home header: reserve space for profile information */
#root .app.app--home .vd2-top-slot {
  display:block !important;
  position:relative !important;
  min-height:112px !important;
  height:auto !important;
  overflow:visible !important;
}

#root .app.app--home
.vd2-top-slot > section.duh-header.duh-master {
  position:relative !important;
  min-height:112px !important;
  height:auto !important;
  padding:14px 12px 42px !important;
  box-sizing:border-box !important;
  overflow:visible !important;
}

#root .app.app--home .duh-user {
  min-width:0 !important;
  align-items:center !important;
}

#root .app.app--home .duh-copy {
  min-width:0 !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  justify-content:center !important;
  gap:4px !important;
}

/* Controlled overlap with the empty lower part of header */
#root .app.app--home .vd2-dashboard > .vd2-wallet {
  display:block !important;
  position:relative !important;
  top:auto !important;
  bottom:auto !important;
  left:auto !important;
  transform:none !important;
  translate:none !important;
  width:calc(100% - 30px) !important;
  margin:-18px 15px 0 !important;
  box-sizing:border-box !important;
  z-index:2 !important;
}

/* Shared fixed bottom navigation */
#root .app .bnv5.nxr-v5-nav {
  position:fixed !important;
  left:50% !important;
  right:auto !important;
  bottom:calc(12px + env(safe-area-inset-bottom,0px)) !important;
  width:calc(100% - 20px) !important;
  max-width:370px !important;
  margin:0 !important;
  transform:translateX(-50%) !important;
  box-sizing:border-box !important;
  z-index:1000 !important;
}

#root .app .bnv5-shell {
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}

/* Narrow Telegram webviews */
@media (max-width:390px) {
  #root .app {
    max-width:100% !important;
  }

  #root .app .bnv5.nxr-v5-nav {
    width:calc(100% - 16px) !important;
  }
}

/* NXR_LAYOUT_V1_SHARED_PAGES_START */

/*
  Shared page geometry.
  Keep content height natural.
  No changes to cards, balances or functionality.
*/

#root .app {
  --nxr-layout-gutter: 15px;
  min-width: 0 !important;
  overflow-x: clip !important;
}

/* Deposit / Withdraw / Team page containers */
#root .app :is(
  .dv4-page,
  .wv4-page,
  .tv4-page
) {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
}

/* Prevent direct page sections from exceeding the frame */
#root .app :is(
  .dv4-page,
  .wv4-page,
  .tv4-page
) > * {
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: 100%;
}

/* Consistent image and media sizing */
#root .app :is(
  .dv4-page,
  .wv4-page,
  .tv4-page
) :is(img,video,canvas) {
  max-width: 100%;
}

/* Maintain scrolling and safe mobile viewport sizing */
#root .app {
  min-height: 100dvh !important;
  overscroll-behavior-x: none;
}

/* Standard navigation width across all pages */
#root .app .bnv5.nxr-v5-nav {
  max-width: 370px !important;
  box-sizing: border-box !important;
}

/* NXR_LAYOUT_V1_SHARED_PAGES_END */



/* NXR_SHARED_HEADER_START */

/* One header geometry for the Home and Deposit wrappers */
#root .app :is(
  .vd2-top-slot,
  .dv4-hero-stack,
  .wv4-hero-stack,
  .tv4-hero-stack,
  .v8-plan-hero--shared
) > section.duh-header.duh-master {
  display:flex !important;
  position:relative !important;
  width:100% !important;
  min-height:112px !important;
  height:auto !important;
  padding:14px 12px 42px !important;
  margin:0 !important;
  box-sizing:border-box !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:8px !important;
  border-radius:0 0 20px 20px !important;
  overflow:visible !important;
}

#root .app :is(
  .vd2-top-slot,
  .dv4-hero-stack,
  .wv4-hero-stack,
  .tv4-hero-stack,
  .v8-plan-hero--shared
) .duh-user {
  display:flex !important;
  align-items:center !important;
  flex:1 1 auto !important;
  min-width:0 !important;
  gap:9px !important;
}

#root .app :is(
  .vd2-top-slot,
  .dv4-hero-stack,
  .wv4-hero-stack,
  .tv4-hero-stack,
  .v8-plan-hero--shared
) .duh-avatar {
  width:44px !important;
  height:44px !important;
  min-width:44px !important;
  min-height:44px !important;
  flex:0 0 44px !important;
  margin:0 !important;
  border:1.5px solid #E7FF51 !important;
  border-radius:50% !important;
}

#root .app :is(
  .vd2-top-slot,
  .dv4-hero-stack,
  .wv4-hero-stack,
  .tv4-hero-stack,
  .v8-plan-hero--shared
) .duh-copy {
  display:flex !important;
  flex:1 1 auto !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  justify-content:center !important;
  min-width:0 !important;
  gap:4px !important;
  margin:0 !important;
  padding:0 !important;
}

#root .app :is(
  .vd2-top-slot,
  .dv4-hero-stack,
  .wv4-hero-stack,
  .tv4-hero-stack,
  .v8-plan-hero--shared
) .duh-actions {
  display:flex !important;
  align-items:center !important;
  flex:0 0 auto !important;
  gap:6px !important;
  margin:0 !important;
}

#root .app :is(
  .vd2-top-slot,
  .dv4-hero-stack,
  .wv4-hero-stack,
  .tv4-hero-stack,
  .v8-plan-hero--shared
) .duh-actions .duh-action,
#root .app :is(
  .vd2-top-slot,
  .dv4-hero-stack,
  .wv4-hero-stack,
  .tv4-hero-stack,
  .v8-plan-hero--shared
) .duh-language-wrap {
  width:36px !important;
  height:36px !important;
  min-width:36px !important;
  min-height:36px !important;
  flex:0 0 36px !important;
}

/* Original shared header for pages without an internal header */
#root .app > .nxr-shared-top {
  display:block !important;
  width:100% !important;
  min-height:112px !important;
  height:auto !important;
  margin:0 !important;
  padding:0 !important;
}

@media (max-width:390px) {
  #root .app :is(
    .vd2-top-slot,
    .dv4-hero-stack,
    .wv4-hero-stack,
    .tv4-hero-stack,
    .v8-plan-hero--shared
  ) > section.duh-header.duh-master {
    padding-left:9px !important;
    padding-right:9px !important;
  }
}


/* Header surface cleanup — no geometry changes */
#root .app :is(
  .vd2-top-slot,
  .dv4-hero-stack,
  .wv4-hero-stack,
  .tv4-hero-stack,
  .v8-plan-hero--shared
) > section.duh-header.duh-master {
  box-shadow:none !important;
  background:#25282F !important;
}

/* Remove decorative circles and hairlines */
#root .app :is(
  .vd2-top-slot,
  .dv4-hero-stack,
  .wv4-hero-stack,
  .tv4-hero-stack,
  .v8-plan-hero--shared
) > section.duh-header.duh-master::before,
#root .app :is(
  .vd2-top-slot,
  .dv4-hero-stack,
  .wv4-hero-stack,
  .tv4-hero-stack,
  .v8-plan-hero--shared
) > section.duh-header.duh-master::after {
  content:none !important;
  display:none !important;
}

/* Preserve card styling below the header */

/* NXR_SHARED_HEADER_END */

